MCP.so
登录

MySQL MCP Server

@MCP-Mirror

基本信息

分类

数据库

许可证

MIT license

传输方式

stdio

作者

MCP-Mirror

关于 MySQL MCP Server

Mirror of

MySQL MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "SuMiaoALi_mysql-mcp-server": {
      "command": "npx",
      "args": [
        "mysql-mcp-server"
      ]
    }
  }
}

MySQL MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

点击上方按钮,在临时沙箱中运行此服务器并实时获取工具列表。

概览

What is MySQL MCP Server?

MySQL MCP Server is a Model Context Protocol server that provides secure MySQL database operations for AI assistants and other MCP clients. It exposes database queries and schema introspection as MCP tools and resources.

How to use MySQL MCP Server?

Install via npm install mysql-mcp-server and configure with environment variables (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB, MYSQL_TIMEZONE). Add it to your Claude Desktop config or run directly with npx mysql-mcp-server.

Features of MySQL MCP Server

  • Execute safe SQL queries (SELECT, INSERT, SHOW, DESCRIBE)
  • Get detailed table structure information
  • Insert data with automatic parameterization
  • List all tables in the database
  • Automatic LIMIT clauses on SELECT queries
  • Connection pooling for efficient database management

Use cases of MySQL MCP Server

  • AI assistants answering questions from a MySQL database
  • Automated database schema inspection and documentation
  • Safe, read-mostly database access for chat-based tools
  • Inserting records via natural language instructions
  • Exploring and understanding table structures interactively

常见问题

1

What operations are allowed?

Only SELECT, INSERT, SHOW, and DESCRIBE operations are permitted. Destructive operations like UPDATE and DELETE are explicitly forbidden.

2

How do I configure the server?

Set environment variables for MySQL connection: `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_DB`, and `MYSQL_TIMEZONE`. All have defaults except password and database.

3

Does the server protect against SQL injection?

Yes. All user inputs are handled with parameterized queries, and SELECT queries automatically get LIMIT clauses to prevent large data dumps.

4

What are the runtime dependencies?

Node.js 18 or later, TypeScript, and access to a MySQL database. The server uses connection pooling to manage database connections.

5

How do I test or debug the server?

Run `npm run inspector` to start the MCP Inspector, which provides a browser URL for testing tools and resources interactively.

评论

数据库 分类下的更多 MCP 服务器