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 "Deploy 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-database
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 deployed
Maintenance
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Public MCP server for summaries, DNS lookup, catalog, replies, and JSON checks.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides read-only access to MySQL databases.4371 npm72MIT
- AlicenseAqualityCmaintenanceRead-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.36 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to MySQL databases, enabling schema exploration, table inspection, and safe SELECT query execution via MCP.1-
- FlicenseAqualityAmaintenanceSecurity-hardened, read-only MySQL MCP server that enables safe, read-only access to MySQL databases for running SELECT queries, exploring schemas, and sampling data via MCP clients.9-