MCP MySQL Server
Allows connection to and operations on a local MySQL database, including querying databases, viewing tables, and executing parameterized queries
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP MySQL Servershow me the top 10 customers by total purchases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP MySQL 本地数据库服务
MCP MySQL服务是一个轻量级的个人使用服务程序,用于连接和操作本地MySQL数据库。此服务可作为Cursor的MCP服务使用,通过API接口使Cursor能够轻松地执行各种数据库操作。
特性
连接本地MySQL数据库
提供RESTful API进行数据库操作
支持参数化查询防止SQL注入
支持SSE (Server-Sent Events) 推送能力
支持作为Cursor MCP服务集成
Related MCP server: MCP MySQL Server
快速开始
前置条件
Node.js (v14+)
MySQL服务器
安装
克隆此仓库
安装依赖
npm install创建并配置
.env文件# 服务器配置 PORT=3000 NODE_ENV=development # MySQL数据库配置 DB_HOST=localhost DB_PORT=3306 DB_USER=你的用户名 DB_PASSWORD=你的密码 DB_NAME=你的数据库名 # API配置 API_KEY=你的API密钥
运行
npm start开发模式(自动重启):
npm run devAPI接口
获取所有数据库
GET /api/databases获取数据库的所有表
GET /api/databases/:database/tables获取表结构
GET /api/databases/:database/tables/:table/structure执行查询
POST /api/query
Content-Type: application/json
{
"sql": "SELECT * FROM users WHERE age > ?",
"params": [18],
"limit": 10,
"offset": 0
}SSE连接
GET /api/sse?apiKey=your-api-key在Cursor中使用
SSE方式
{
"name": "MySQL数据库服务",
"url": "http://localhost:3000/api/sse",
"type": "sse"
}Command方式
{
"name": "MySQL数据库服务",
"command": "node /path/to/mcp_server_mysql/src/app.js",
"type": "command"
}安全性考虑
此服务仅限本地使用,不建议暴露到公网
使用API密钥保护接口
默认只允许执行SELECT查询
许可证
MIT
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
- Flicense-qualityDmaintenanceProvides MySQL database integration for AI assistants and other MCP clients, allowing them to list tables, read table data, and execute SQL queries.Last updated
- Alicense-qualityDmaintenanceEnables interaction with MySQL databases through MCP, supporting query execution, table operations (insert, update, delete), and schema inspection for natural language database management.Last updated77MIT
- Alicense-qualityDmaintenanceA specialized MySQL MCP server for Cursor that enables users to query table structures, execute SQL, and generate database documentation. It features multiple security modes to ensure safe interaction while providing tools for database overviews and query caching.Last updated5MIT
- Alicense-qualityDmaintenanceEnables Cursor AI to interact with MySQL databases through natural language, supporting SQL queries, table schema retrieval, and data operations.Last updated94617MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Local-first RAG engine with MCP server for AI agent integration.
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/TristanLib/mcp_server_mysql_windows'
If you have feedback or need assistance with the MCP directory API, please join our Discord server