This MCP server provides compressed schema information for MySQL databases, making it useful when dealing with large database schemas that don't fit within context size limits. It offers tools to list tables and describe table structures from your MySQL databases.
To install the MySQL Schema MCP Server, follow these steps:
Install the command using Go:
go install github.com/shibayu36/mysql-schema-explorer-mcp@latest
Configure the MCP server by creating an mcp.json
file:
{
"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"
}
}
}
}
Make sure to replace /path/to/mysql-schema-explorer-mcp
with the actual path to the installed executable, and update the database connection details as needed.
The MySQL Schema MCP Server provides two main tools:
The list_tables
tool provides information about all tables in a specified database, including:
Parameters:
dbName
: The name of the database to retrieve information fromExample usage: When using with an MCP-compatible agent, you can request:
List all tables in the 'ecshop' database
The describe_tables
tool provides detailed information about specific tables in a database, including:
Parameters:
dbName
: The name of the database to retrieve information fromtableNames
: An array of table names to retrieve detailed information forExample usage: When using with an MCP-compatible agent, you can request:
Describe the structure of the 'users' and 'orders' tables in the 'ecshop' database
Using this MCP server with a compatible agent, you can execute complex tasks like:
Using the structure of the ecshop database, list the names of the 3 most recently ordered products by the user shibayu36.
The MCP server will provide the necessary schema information to the agent, allowing it to generate appropriate SQL queries for your request.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.