mysql-mcp
Provides read-only access to MySQL databases, allowing AI agents to execute SQL queries, list configured database connections, and switch between multiple MySQL instances safely.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mysql-mcpshow me the top 10 customers by total orders"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mysql-mcp
A lightweight MCP server that provides safe, read-only access to MySQL databases.
Features
Multi-database — connect to multiple MySQL instances, switch between them on the fly
Read-only — write operations (
INSERT,UPDATE,DELETE,DROP, etc.) are blockedLazy connections — pools are created on first use, not at startup
MCP native — built on
@modelcontextprotocol/sdk, works with any MCP client
Related MCP server: mcp-database
Setup
Create a JSON config file with your database connections:
{
"my-db": {
"host": "db.example.com",
"port": 3306,
"user": "readonly",
"password": "secret",
"database": "mydb",
"environment": "production",
"ssl": false
}
}Set the
MYSQL_DATABASES_CONFIGenvironment variable pointing to that file.Run the server:
npx tsx index.tsTools
Tool | Description |
| List all configured databases and the active one |
| Switch the active database connection |
| Execute a read-only SQL query |
MCP Client Configuration
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["tsx", "/path/to/mysql-mcp/index.ts"],
"env": {
"MYSQL_DATABASES_CONFIG": "/path/to/databases.json"
}
}
}
}License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides read-only access to MySQL databases.Last updated494769MIT
- AlicenseAqualityCmaintenanceRead-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.Last updated316MIT
- Alicense-qualityDmaintenanceA readonly MCP server for MySQL databases that ensures safety by whitelisting only SELECT, SHOW, DESCRIBE, and EXPLAIN statements, with table blacklist support and configurable limits.Last updatedMIT
- Alicense-qualityDmaintenanceA secure, read-only MySQL database proxy using MCP protocol, enabling SQL queries and table inspections via HTTP.Last updated141MIT
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Federated commerce search across independent WooCommerce merchants. Keyless, read-only MCP server.
Read-only MCP server for wafergraph.com's semiconductor & AI supply-chain data: 30 tools, no auth.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rlembo06/mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server