Mysql Db Reader
FreeNot checkedRead-only MySQL database access via MCP. Enables listing databases, tables, schemas, running SELECT queries, and EXPLAIN plans.
About
Read-only MySQL database access via MCP. Enables listing databases, tables, schemas, running SELECT queries, and EXPLAIN plans.
README
Read-only MySQL tools for xmcp. Connect via a connection-string env var; all operations are read-only.
Prerequisites
- Node 20+
- pnpm
Install & build
pnpm i
pnpm build
Configure database connection
Set one of (first found wins): MYSQL_URL, MYSQL_CONNECTION_STRING, or DATABASE_URL.
export MYSQL_URL="mysql://user:password@localhost:3306/mydb"
SSL is controlled by MYSQL_SSL (default: "true"):
| Value | Behavior |
|---|---|
true (default) |
Encrypted, skips cert hostname validation — use when connecting through a tunnel or proxy |
strict |
Encrypted, validates server certificate — use for direct connections with a valid cert |
false |
No SSL — local dev only |
export MYSQL_SSL=true # tunnel / hosted DB (default)
export MYSQL_SSL=strict # direct connection, valid cert
export MYSQL_SSL=false # local dev, no SSL
Use in Cursor (STDIO)
Via npx (after publishing to npm — no local clone needed):
{
"mcpServers": {
"mysql-reader": {
"command": "npx",
"args": ["-y", "mysql-db-reader"],
"env": { "MYSQL_URL": "mysql://user:password@host:3306/db" }
}
}
}
Local build (after pnpm build):
{
"mcpServers": {
"mysql-reader": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/mysql-db-reader/dist/stdio.js"],
"env": { "MYSQL_URL": "mysql://user:password@host:3306/db" }
}
}
}
Use via HTTP (optional)
pnpm dev
Then point your MCP client to http://localhost:3002/mcp.
To use a different port (e.g., 3001):
export MYSQL_URL="mysql://user:password@localhost:3306/mydb"
PORT=3001 pnpm dev
Example HTTP client config (TOML):
[mcp_servers.mysql-reader]
transport = "http"
url = "http://127.0.0.1:3001/mcp"
project = "/ABSOLUTE/PATH/TO/your/project"
Tools
mysql_list_databases(includeSystem=false)— list databasesmysql_list_tables(database, includeViews=true)— list tables/viewsmysql_get_table_schema(database, table)— columns/constraints/indexesmysql_preview_table(database, table, limit=50, orderBy?)— sample rowsmysql_query(sql, params?)— read-only SQL (SELECT/SHOW/DESC/EXPLAIN/WITH), max 10k rowsmysql_explain_query(sql)— EXPLAIN a SELECT
Codex compatibility
Tool names use lowercase snake_case (underscores, no dots) to comply with Codex's tool name pattern ^[a-zA-Z0-9_-]+$ (Codex models prefer lower_snake). See: MCP in Codex docs
Read-only is enforced via session settings and SQL guards.
Docs: xmcp docs
Installing Mysql Db Reader
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/riefer02/mysql-db-readerFAQ
Is Mysql Db Reader MCP free?
Yes, Mysql Db Reader MCP is free — one-click install via Unyly at no cost.
Does Mysql Db Reader need an API key?
No, Mysql Db Reader runs without API keys or environment variables.
Is Mysql Db Reader hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install Mysql Db Reader in Claude Desktop, Claude Code or Cursor?
Open Mysql Db Reader on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolCompare Mysql Db Reader with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
