mysql-readonly-mcp
Provides read-only access to MySQL databases for schema inspection and SELECT-style queries, with safety features to prevent write and DDL operations.
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-readonly-mcplist all tables"
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.
@chenyingxian/mysql-readonly-mcp
Read-only MySQL MCP server for safe schema inspection and SELECT-style queries.
This package is intended for MCP clients that need controlled access to MySQL metadata and sample data. It rejects common write and DDL statements, but you should still run it with a dedicated read-only MySQL account.
Documentation
Related MCP server: mcp-mysql-lens
Installation
npm install -g @chenyingxian/mysql-readonly-mcpYou can also run it without a global install:
npx @chenyingxian/mysql-readonly-mcpQuick Configuration
Put credentials in a local config file:
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USER=readonly_user
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
MYSQL_MCP_MAX_LIMIT=500
MYSQL_MCP_QUERY_TIMEOUT_MS=10000
MYSQL_MCP_CONNECTION_LIMIT=5Then expose only the file path to your MCP client:
{
"mcpServers": {
"mysql-readonly": {
"command": "npx",
"args": ["-y", "@chenyingxian/mysql-readonly-mcp@latest"],
"env": {
"MYSQL_CONFIG_FILE": "/path/to/mysql-readonly.env"
}
}
}
}Environment variables override values from MYSQL_CONFIG_FILE.
Tools
list_tables: List tables and views.describe_table: Read column and index metadata.sample_table: Read a limited sample from one table.execute_readonly_sql: Execute a read-onlySELECT,SHOW,DESCRIBE,DESC,EXPLAIN, orWITHstatement.
Safety Notes
Use a dedicated MySQL account with only the minimum read permissions.
Do not expose production credentials in MCP client config.
Do not publish real
.envfiles, internal hosts, database names, usernames, or passwords.
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.
Latest Blog Posts
- 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/a1030307996-hash/mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server