MCP Server for MySQL based on NodeJS
A Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
Overview
MCP Server for MySQL is a Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.
To use this server, configure it in the "mcpServers" section of your claude_desktop_config.json file with the necessary MySQL connection details and run the server using the command provided in the configuration.
- Provides read-only access to MySQL databases. - Allows execution of read-only SQL queries. - Automatically discovers and provides JSON schema information for each table in the database.
- Inspecting database schemas for data analysis.
- Executing read-only queries for reporting purposes.
- Integrating with LLMs for enhanced data interaction.
Add to your AI client
Use these steps to connect MCP Server for MySQL based on NodeJS in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-server-mysql-benborla": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-server-mysql-benborla": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-server-mysql-benborla": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-server-mysql-benborla": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-server-mysql-benborla": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-server-mysql-benborla": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-mysql-benborla"
]
}
}
}FAQ
Can I modify the database using this server?
No, this server only allows read-only access to the database.
What do I do if I encounter connection errors?
Ensure that your MySQL connection details are correct and that the server is running.
Is there a license for this project?
Yes, the MCP Server for MySQL is licensed under the MIT License.