
Go-MCP-Mysql
ENCORT DE LA BURDE ZERO, Protocole de contexte de modèle prêt à l'emploi (MCP) pour interagir avec MySQL et Automation. Aucun environnement Node.js ou Python nécessaire.
1
Github Watches
3
Github Forks
11
Github Stars
go-mcp-mysql
Overview
Zero burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL and automation. No Node.js or Python environment needed. This server provides tools to do CRUD operations on MySQL databases and tables, and a read-only mode to prevent surprise write operations. You can also make the MCP server check the query plan by using a EXPLAIN
statement before executing the query by adding a --with-explain-check
flag.
Please note that this is a work in progress and may not yet be ready for production use.
Installation
-
Get the latest release and put it in your
$PATH
or somewhere you can easily access. -
Or if you have Go installed, you can build it from source:
go install -v github.com/Zhwt/go-mcp-mysql@latest
Usage
Method A: Using Command Line Arguments
{
"mcpServers": {
"mysql": {
"command": "go-mcp-mysql",
"args": [
"--host", "localhost",
"--user", "root",
"--pass", "password",
"--port", "3306",
"--db", "mydb"
]
}
}
}
Method B: Using DSN With Custom Options
{
"mcpServers": {
"mysql": {
"command": "go-mcp-mysql",
"args": [
"--dsn", "username:password@tcp(localhost:3306)/mydb?parseTime=true&loc=Local"
]
}
}
}
Please refer to MySQL DSN for more details.
Note: For those who put the binary outside of your $PATH
, you need to replace go-mcp-mysql
with the full path to the binary: e.g.: if you put the binary in the Downloads folder, you may use the following path:
{
"mcpServers": {
"mysql": {
"command": "C:\\Users\\<username>\\Downloads\\go-mcp-mysql.exe",
"args": [
...
]
}
}
}
Optional Flags
- Add a
--read-only
flag to enable read-only mode. In this mode, only tools beginning withlist
,read_
anddesc_
are available. Make sure to refresh/restart the MCP server after adding this flag. - By default, CRUD queries will be first executed with a
EXPLAIN ?
statement to check whether the generated query plan matches the expected pattern. Add a--with-explain-check
flag to disable this behavior.
Tools
Schema Tools
-
list_database
- List all databases in the MySQL server.
- Parameters: None
- Returns: A list of matching database names.
-
list_table
- List all tables in the MySQL server.
- Parameters:
-
name
: If provided, list tables with the specified name, same as SQLSHOW TABLES LIKE '%name%'
. Otherwise, list all tables.
-
- Returns: A list of matching table names.
-
create_table
- Create a new table in the MySQL server.
- Parameters:
-
query
: The SQL query to create the table.
-
- Returns: x rows affected.
-
alter_table
- Alter an existing table in the MySQL server. The LLM is informed not to drop an existing table or column.
- Parameters:
-
query
: The SQL query to alter the table.
-
- Returns: x rows affected.
-
desc_table
- Describe the structure of a table.
- Parameters:
-
name
: The name of the table to describe.
-
- Returns: The structure of the table.
Data Tools
-
read_query
- Execute a read-only SQL query.
- Parameters:
-
query
: The SQL query to execute.
-
- Returns: The result of the query.
-
write_query
- Execute a write SQL query.
- Parameters:
-
query
: The SQL query to execute.
-
- Returns: x rows affected, last insert id: <last_insert_id>.
-
update_query
- Execute an update SQL query.
- Parameters:
-
query
: The SQL query to execute.
-
- Returns: x rows affected.
-
delete_query
- Execute a delete SQL query.
- Parameters:
-
query
: The SQL query to execute.
-
- Returns: x rows affected.
License
MIT
相关推荐
I find academic articles and books for research and literature reviews.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)
Reviews

user_9FvrwyAS
I've been using go-mcp-mysql for a few months now, and I'm thoroughly impressed. Zhwt did an excellent job creating a seamless integration with MySQL databases. The performance is top-notch, and the documentation is clear and helpful. If you're looking for a reliable and efficient MySQL connector in Go, this is a must-try. Check it out on GitHub!