MCP MySQL Server
Enables read-only MySQL database connectivity, allowing execution of SELECT queries, listing tables, and describing table structures via natural language.
README
MCP MySQL Server
Model Context Protocol (MCP) server for MySQL database connectivity.
Features
- Execute SQL SELECT queries with parameterized inputs (read-only)
- List all tables in the database (read-only metadata)
- Describe table structure (read-only metadata)
- Read-only access only - no INSERT, UPDATE, DELETE operations
Installation
- Clone this repository
- Install dependencies:
npm install - Build the TypeScript code:
npm run build
Configuration
Copy .env.example to .env and update the MySQL connection settings:
cp .env.example .env
Edit .env with your MySQL credentials:
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=yourpassword
MYSQL_DATABASE=yourdatabase
Usage
Development mode
npm run dev
Production mode
npm run build
npm start
Integration with WorkBuddy
Add this server to your WorkBuddy configuration. Example configuration for WorkBuddy:
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/absolute/path/to/mcp-mysql/dist/index.js"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "yourpassword",
"MYSQL_DATABASE": "yourdatabase"
}
}
}
}
Tools
mysql_query
Execute a SQL SELECT query with parameterized inputs. Read-only - only SELECT queries are allowed.
Parameters:
sql(string): SQL SELECT query with?placeholdersparameters(string[]): Array of parameter values
mysql_list_tables
List all tables in the current database. Read-only metadata query.
mysql_describe_table
Get the schema of a table. Read-only metadata query.
Parameters:
tableName(string): Name of the table to describe
Permissions
This MCP server provides read-only access only. The following restrictions are enforced:
- Only SELECT queries are allowed via
mysql_query - No INSERT, UPDATE, DELETE, or other data modification operations
- Metadata queries (
mysql_list_tables,mysql_describe_table) are read-only - All queries use parameterized statements to prevent SQL injection
Security
- All SQL queries use parameterized statements to prevent SQL injection
- Table names are validated with regex before use
- Connection credentials are loaded from environment variables
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器