WHAT IT CONNECTS
michael7736 mysql mcp server 为 AI Agent 提供什么
- Execute SQL queries against a MySQL database:
- Read data (SELECT statements)
- Create tables (CREATE TABLE statements)
- Insert data (INSERT INTO statements)
- Update data (UPDATE statements)
- Delete data (DELETE FROM statements)
- Returns query results in JSON format
- Configurable database connection settings
- Transaction logging with unique IDs
- Node.js (v14 or higher)
- MySQL server
- MCP SDK
- Clone or download this repository
- Install dependencies:
- Build the server:
- `MYSQL_HOST`: MySQL server hostname (default: 'localhost')
- `MYSQL_PORT`: MySQL server port (default: 3306)
- `MYSQL_USER`: MySQL username (default: 'mcp101')
- `MYSQL_PASSWORD`: MySQL password (default: '123qwe')
- `MYSQL_DATABASE`: MySQL database name (default: 'mcpdb')
- Create a MySQL database:
- Create a MySQL user with access to the database:
- Create a test table with sample data:
- `query`: The SQL SELECT query to execute.
- `query`: The SQL CREATE TABLE query to execute.
- `query`: The SQL INSERT INTO query to execute.
- `query`: The SQL UPDATE query to execute.
- `query`: The SQL DELETE FROM query to execute.
- Use a dedicated MySQL user with appropriate privileges for the MCP server
- Consider using read-only privileges if you only need to query data
- Store sensitive information like database credentials securely
- All operations are logged with unique transaction IDs for auditing
SECURITY
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。