Token导航 LogoToken导航TokenDH.com
Pcpro MCP Mysql logo
数据服务stdio官方级别未说明来源级核验

Pcpro MCP Mysql

MCP Server

@smithery/cli

一个提供MySQL数据库操作功能的Model Context Protocol服务器,使AI模型能够通过标准化接口与MySQL数据库交互。

工具数

5

提示词数

0

GitHub Stars

0

资源数

0
JavaScriptClaude数据管理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

franHR11

提供方

franHR11

最后核验

2026/5/17 20:23

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude

详细介绍

@f4ww4z/mcp mysql服务器

![Trust Score](https://archestra.ai/mcp-catalog/f4ww4z__mcp-mysql-server) ](https://smithery.ai/server/@f4ww4z/mcp-mysql-server)

提供MySQL数据库操作的模型上下文协议服务器。该服务器使AI模型能够通过标准化的接口与MySQL数据库进行交互。

安装

通过Smithery安装

通过以下方式自动安装MySQL Server for Claude Desktop 史密瑟里:

npx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude

手动安装

npx @f4ww4z/mcp-mysql-server

配置

服务器要求在MCP设置配置文件中设置以下环境变量:

推荐使用
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server", "mysql://user:password@localhost:port/database"],
    }
  }
}
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server"],
      "env": {
        "MYSQL_HOST": "your_host",
        "MYSQL_USER": "your_user",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

法典

苹果电脑

~/.codex/config.toml

[mcp_servers.mcp-mysql-server]
command = "npx"
args = [
  "-y",
  "@f4ww4z/mcp-mysql-server",
  "mysql://user:password@127.0.0.1:3306/database"
]

窗户

%USERPROFILE%\.codex\config.toml

[mcp_servers.mcp-mysql-server]
command = "npx"
args = [
  "-y",
  "@f4ww4z/mcp-mysql-server",
  "mysql://user:password@127.0.0.1:3306/database"
]

运行评估

evals包加载一个mcp客户端,然后运行index.ts文件,因此不需要在测试之间重建。您可以通过在npx命令前加前缀来加载环境变量。可以找到完整的文档 这里.

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

可用工具

1.connect_db

使用提供的凭据建立与MySQL数据库的连接。

use_mcp_tool({
  server_name: "mysql",
  tool_name: "connect_db",
  arguments: {
    host: "localhost",
    user: "your_user",
    password: "your_password",
    database: "your_database"
  }
});

2.查询

使用可选的准备语句参数执行SELECT查询。

use_mcp_tool({
  server_name: "mysql",
  tool_name: "query",
  arguments: {
    sql: "SELECT * FROM users WHERE id = ?",
    params: [1]
  }
});

3.执行

使用可选的准备语句参数执行INSERT、UPDATE或DELETE查询。

use_mcp_tool({
  server_name: "mysql",
  tool_name: "execute",
  arguments: {
    sql: "INSERT INTO users (name, email) VALUES (?, ?)",
    params: ["John Doe", "john@example.com"]
  }
});

4.列表表

列出连接数据库中的所有表。

use_mcp_tool({
  server_name: "mysql",
  tool_name: "list_tables",
  arguments: {}
});

5.描述表

获取特定表的结构。

use_mcp_tool({
  server_name: "mysql",
  tool_name: "describe_table",
  arguments: {
    table: "users"
  }
});

特性

  • 通过自动清理实现安全的连接处理
  • 查询参数的准备语句支持
  • 全面的错误处理和验证
  • TypeScript支持
  • 自动连接管理

安全

  • 使用预处理语句防止SQL注入
  • 通过环境变量支持安全密码处理
  • 执行前验证查询
  • 完成后自动关闭连接

错误处理

服务器为常见问题提供详细的错误消息:

  • 连接失败
  • 无效查询
  • 缺少参数
  • 数据库错误

贡献

欢迎投稿!请随时向提交拉取请求https://github.com/f4ww4z/mcp-mysql-server

许可证

麻省理工学院

目录标签

目录标签

JavaScriptClaude数据管理MySQL数据库本地部署数据库操作AI模型交互标准化接口

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP