MySQL

by pengcunfu

384 downloads
Not rated
GitHub

About

零负担、开箱即用的模型上下文协议(MCP)服务器,用于与 MySQL 交互和自动化操作。无需 Node.js 或 Python 环境。该服务器提供对 MySQL 数据库和表进行 CRUD 操作的工具,以及只读模式以防止意外的写入操作。您还可以通过添加 --with-explain-check 标志让 MCP 服务器在执行查询前使用 EXPLAIN 语句检查查询计划。

Details

Author
pengcunfu
Downloads
384
Categories
Database, Automation

- List all databases on the server.
- List, create, and describe tables.
- Alter existing tables (without deleting tables or columns).
- Execute read-only SQL queries.
- Execute write, update, and delete SQL queries.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MySQL
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Invoke the server’s tools via the Model Context Protocol to perform database operations. The README does not include installation or configuration steps; it only lists the available tools and their parameters.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mysql": {
            "mysql": {
                "command": "C:\\Users\\<username>\\Downloads\\go-mcp-mysql.exe",
                "args": [
                    "--host",
                    "localhost",
                    "--user",
                    "root",
                    "--pass",
                    "password",
                    "--port",
                    "3306",
                    "--db",
                    "mydb"
                ]
            }
        }
    }
}

McpServers

{
    "mysql": {
        "command": "C:\\Users\\<username>\\Downloads\\go-mcp-mysql.exe",
        "args": [
            "--host",
            "localhost",
            "--user",
            "root",
            "--pass",
            "password",
            "--port",
            "3306",
            "--db",
            "mydb"
        ]
    }
}

模式工具
list_database

列出 MySQL 服务器中的所有数据库。
参数:无
返回:匹配的数据库名称列表。
list_table

列出 MySQL 服务器中的所有表。
参数:
name:如果提供,列出具有指定名称的表,与 SQL SHOW TABLES LIKE '%name%' 相同。否则,列出所有表。
返回:匹配的表名称列表。
create_table

在 MySQL 服务器中创建新表。
参数:
query:创建表的 SQL 查询。
返回:受影响的行数。
alter_table

修改 MySQL 服务器中的现有表。LLM 被告知不要删除现有表或列。
参数:
query:修改表的 SQL 查询。
返回:受影响的行数。
desc_table

描述表的结构。
参数:
name:要描述的表名。
返回:表的结构。
数据工具
read_query

执行只读 SQL 查询。
参数:
query:要执行的 SQL 查询。
返回:查询结果。
write_query

执行写入 SQL 查询。
参数:
query:要执行的 SQL 查询。
返回:受影响的行数,最后插入 ID:<last_insert_id>。
update_query

执行更新 SQL 查询。
参数:
query:要执行的 SQL 查询。
返回:受影响的行数。
delete_query

执行删除 SQL 查询。
参数:
query:要执行的 SQL 查询。
返回:受影响的行数。

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.