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

mcpp-mysql

v1.1.0

Published

MCPP MySQL MCP Server - AI 助手直接操作 MySQL 数据库

Readme

mcpp-mysql

MCPP MySQL MCP Server - 让 AI 助手直接操作你的 MySQL 数据库

支持直连和 SSH 隧道两种连接方式。

安装配置

方式一:直连(公网可访问的数据库)

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "mcpp-mysql"],
      "env": {
        "MCP_ACCESS_KEY": "your-access-key",
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

方式二:SSH 隧道(内网数据库)

适用于阿里云 RDS 内网、公司内网数据库等需要通过跳板机访问的场景。

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "mcpp-mysql"],
      "env": {
        "MCP_ACCESS_KEY": "your-access-key",
        "SSH_HOST": "47.xx.xx.xx",
        "SSH_PORT": "22",
        "SSH_USER": "root",
        "SSH_PASSWORD": "your_ssh_password",
        "MYSQL_HOST": "rm-xxx.mysql.rds.aliyuncs.com",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "your_mysql_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

使用密钥认证:

{
  "env": {
    "SSH_HOST": "47.xx.xx.xx",
    "SSH_USER": "ubuntu",
    "SSH_PRIVATE_KEY": "~/.ssh/id_rsa",
    "SSH_PASSPHRASE": "私钥密码(可选)"
  }
}

环境变量说明

| 变量 | 必填 | 说明 | |------|------|------| | MCP_ACCESS_KEY | 是 | 访问密钥,从 https://mcp.hxstudio.website 获取 | | MYSQL_HOST | 是 | MySQL 主机地址 | | MYSQL_PORT | 否 | MySQL 端口,默认 3306 | | MYSQL_USER | 是 | MySQL 用户名 | | MYSQL_PASSWORD | 是 | MySQL 密码 | | MYSQL_DATABASE | 否 | 默认数据库,不填则需要手动 USE | | SSH_HOST | 否 | SSH 跳板机地址,填写则启用隧道 | | SSH_PORT | 否 | SSH 端口,默认 22 | | SSH_USER | 否 | SSH 用户名 | | SSH_PASSWORD | 否 | SSH 密码(与 SSH_PRIVATE_KEY 二选一) | | SSH_PRIVATE_KEY | 否 | SSH 私钥路径,支持 ~ | | SSH_PASSPHRASE | 否 | 私钥密码 |

可用工具

  • list_databases - 列出所有数据库
  • list_tables - 列出数据库中的所有表
  • describe_table - 查看表结构
  • read_query - 执行 SELECT/SHOW/DESCRIBE/USE 查询
  • write_query - 执行 INSERT/UPDATE/DELETE
  • create_table - 创建新表

安全特性

  • 30 秒查询超时
  • 结果限制 500 行
  • UPDATE/DELETE 必须有 WHERE
  • 禁止 DROP/TRUNCATE 操作

License

MIT