MCP.so
登录

MySQL MCP Server

@kevinwatt

基本信息

分类

数据库

许可证

MIT

传输方式

stdio

作者

kevinwatt

关于 MySQL MCP Server

An MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs.

MySQL MCP Server 配置

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

{
  "mcpServers": {
    "mysql-mcp": {
      "command": "npx",
      "args": [
        "@kevinwatt/mysql-mcp"
      ]
    }
  }
}

MySQL MCP Server 工具

4

Execute read-only SELECT queries against the MySQL database. - Maximum query length: 4096 characters - Maximum result rows: 1000 - Query timeout: 30 seconds

Execute data modification queries (INSERT/UPDATE/DELETE). - Returns affected rows count and insert ID - Supports parameterized queries - Automatic transaction handling

List all tables in current database

Show table structure

概览

What is MySQL MCP Server?

MySQL MCP Server is an MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs. It enables language models to execute SQL queries, list tables, describe schemas, and perform data modifications with transaction support.

How to use MySQL MCP Server?

Install via npm install -g @kevinwatt/mysql-mcp, then configure environment variables (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB) and run with a compatible MCP host like Dive Desktop. Alternatively, start manually with npx @kevinwatt/mysql-mcp.

Key features of MySQL MCP Server

  • Execute read-only SELECT queries with safety limits
  • Perform INSERT/UPDATE/DELETE with automatic transactions
  • List all tables and describe table structures
  • Parameterized queries for data safety
  • Query length (4096 chars) and result row (1000) limits

Use cases of MySQL MCP Server

  • Natural-language database querying via LLM
  • Automated schema exploration and documentation
  • Safe data modification with transaction rollback
  • Integration with MCP‑compatible AI assistants

常见问题

1

What limits are enforced on queries?

Maximum query length is 4096 characters, maximum result rows are 1000, and query timeout is 30 seconds.

2

What are the system requirements?

Node.js 18+ and a running MySQL Server are required. The server must be used with an MCP‑compatible LLM service.

3

How are write transactions handled?

`mysql_execute` automatically wraps INSERT/UPDATE/DELETE in transactions, returning affected rows count and last insert ID.

4

Is the server read‑only for SELECT queries?

Yes, the `mysql_query` tool enforces a read‑only transaction mode for all SELECT statements.

5

What authentication or transport configuration is needed?

Connection is configured via environment variables for host, port, user, password, and database. No separate auth mechanism is mentioned beyond standard MySQL credentials.

评论

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