MySQL Schema Explorer
STDIOMCP server providing compressed schema information for MySQL databases.
MCP server providing compressed schema information for MySQL databases.
This is a Model Context Protocol (MCP) server that provides compressed schema information for MySQL databases. This MCP server is useful when the schema dump file does not fit in the context size because you are using a large database schema.
https://github.com/user-attachments/assets/0cecef84-cd70-4f84-95cb-01c6ec7c9ac7
list_tables
)
dbName
: The name of the database to retrieve information from (not required when DB_NAME environment variable is set)describe_tables
)
dbName
: The name of the database to retrieve information from (not required when DB_NAME environment variable is set)tableNames
: An array of table names to retrieve detailed information forInstall the command
go install github.com/shibayu36/mysql-schema-explorer-mcp@latest
Configure mcp.json
{ "mcpServers": { "mysql-schema-explorer-mcp": { "command": "/path/to/mysql-schema-explorer-mcp", "env": { "DB_HOST": "127.0.0.1", "DB_PORT": "3306", "DB_USER": "root", "DB_PASSWORD": "root" }, } } }
Execute SQL generation using the agent
Example: Using the structure of the ecshop database, list the names of the 3 most recently ordered products by the user shibayu36.
When accessing only one database, you can set the DB_NAME
environment variable to avoid specifying the database name each time.
{ "mcpServers": { "mysql-schema-explorer-mcp": { "command": "/path/to/mysql-schema-explorer-mcp", "env": { "DB_HOST": "127.0.0.1", "DB_PORT": "3306", "DB_USER": "root", "DB_PASSWORD": "root", "DB_NAME": "ecshop" }, } } }