npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wangy_as/query-db

v1.0.8

Published

A MySql database query tool for MCP

Readme

@wangy_as/query-db

MCP (Model Context Protocol) MySQL 数据库查询工具

项目描述

这是一个为 MCP 生态系统开发的 MySQL 数据库查询工具。它提供了命令行界面,可以方便地进行数据库查询操作,并与 Model Context Protocol SDK 无缝集成。

安装方法

全局安装(使用 npm):

npm install -g @wangy_as/query-db

或使用 yarn:

yarn global add @wangy_as/query-db

主要功能

  • MySQL 数据库查询功能
  • 集成 MCP SDK
  • 命令行界面(基于 yargs)
  • 使用 TypeScript 和 Zod 实现类型安全

依赖项

使用说明

MCP 服务器配置说明

配置参数

在 MCP 服务器中使用本工具时,需要配置以下数据库连接参数:

  • host: MySQL 服务器地址(默认:localhost)
  • port: MySQL 服务器端口(默认:3306)
  • user: MySQL 用户名(默认:root)
  • password: MySQL 密码(默认:空)
  • database: MySQL 数据库名称(必填)

可用功能

工具提供两个主要功能:

  1. execute-query: 执行 SELECT 查询语句

    • 用于查询数据的只读操作
    • 返回查询结果的 JSON 格式数据
  2. execute-non-query: 执行 INSERT、UPDATE、DELETE 语句

    • 用于修改数据的操作
    • 返回操作结果的影响行数等信息

错误处理

工具会自动处理以下情况:

  • 数据库连接失败
  • SQL 语句执行错误
  • 参数验证错误

如果遇到错误,会在控制台输出详细的错误信息。

注意事项

  1. 确保 MySQL 服务器已经启动并可访问
  2. 确保提供的数据库用户具有足够的操作权限
  3. 建议在生产环境中使用专门的数据库用户,避免使用 root 账户
  4. 密码等敏感信息建议通过环境变量或配置文件传入,避免在命令行中明文显示

许可证

ISC

作者

wangy_as