MySQL MCP Server
MySQL MCP 服务器
功能强大的 MCP 服务器,可直接访问 MySQL 数据库。该服务器使 AI 代理能够通过简单的界面与 MySQL 数据库交互、执行 SQL 查询并管理数据库内容。
特征
资源
通过
note:///{id}URI 访问存储在数据库中的笔记每个笔记都有标题和内容
用于简单内容访问的纯文本 MIME 类型
工具
create_note- 在数据库中创建新的文本注释将标题和内容作为必需参数
将注释存储在 MySQL 数据库中
list_tables- 列出所连接数据库中的所有表count_tables获取数据库中表的总数search_tables- 使用 LIKE 模式搜索表describe_table- 获取特定表的结构execute_sql自定义 SQL 查询
Related MCP server: MySQL MCP Server
先决条件
Node.js 18 或更高版本
MySQL 服务器已安装并正在运行
具有适当权限的数据库
设置
克隆此存储库:
git clone git@github.com:LeonMelamud/mysql-mcp.git cd mysql-mcp安装依赖项:
npm install使用您的 MySQL 连接详细信息在根目录中创建一个
.env文件:MYSQL_HOST=localhost MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_database构建服务器:
npm run build
安装
对于克劳德桌面
将服务器配置添加到您的 Claude Desktop 配置文件:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/path/to/mysql-server/build/index.js"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}对于克莱恩
将服务器配置添加到您的 Cline MCP 设置文件:
在 MacOS 上: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json在 Windows 上: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/path/to/mysql-server/build/index.js"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
},
"disabled": false,
"autoApprove": []
}
}
}使用示例
安装完成后,您可以在与 Claude 的对话中使用 MySQL MCP 服务器:
列出数据库中的所有表
Please list all the tables in my MySQL database.执行 SQL 查询
Run this SQL query: SELECT * FROM users LIMIT 5创建笔记
Create a note titled "Meeting Notes" with the content "Discussed project timeline and assigned tasks."发展
对于使用自动重建的开发:
npm run watch调试
使用 MCP Inspector 调试服务器:
npm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
执照
麻省理工学院
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceThis server enables AI models to interact with MySQL databases through a standardized interface.5466168MIT
- AlicenseNot gradedqualityCmaintenanceA server that enables AI models to interact with MySQL databases through a Model Control Protocol, providing tools for table creation, schema inspection, query execution, and data retrieval.28MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that allows AI agents to execute SQL queries against a MySQL database, supporting operations like reading data, creating tables, inserting, updating, and deleting records.65198MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that connects AI agents to MySQL databases for schema exploration, data querying, and SQL execution via natural language.2MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Appeared in Searches
- A tool for comparing design documents and source code, and accumulating business knowledge
- Exploring MySQL Database Information
- Information about MySQL database management system
- An open-source relational database management system
- Connect to MySQL server, edit database structure, and run manual migrations
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LeonMelamud/mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server