MySQL (read-only, switchable) MCP Server
by shibbirwebio.github.shibbirweb/mcp-mysql-read-onlyv1.1.6
Read-only MySQL access, with the database and server switchable mid-conversation.
context tax
queued
security
queued
cold start
queued
freshness
Active16d ago
Install MySQL (read-only, switchable) MCP server
Install in Claude Code
claude mcp add mysql-read-only -e MYSQL_PASSWORD='<mysql-password>' -e MYSQL_PROFILES='<mysql-profiles>' -- npx -y @shibbirweb/mcp-mysql-read-onlyInstall in Cursor
{
"mcpServers": {
"mysql-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-mysql-read-only"
],
"env": {
"MYSQL_PASSWORD": "<mysql-password>",
"MYSQL_PROFILES": "<mysql-profiles>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"mysql-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-mysql-read-only"
],
"env": {
"MYSQL_PASSWORD": "<mysql-password>",
"MYSQL_PROFILES": "<mysql-profiles>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"mysql-read-only": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-mysql-read-only"
],
"env": {
"MYSQL_PASSWORD": "<mysql-password>",
"MYSQL_PROFILES": "<mysql-profiles>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"mysql-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-mysql-read-only"
],
"env": {
"MYSQL_PASSWORD": "<mysql-password>",
"MYSQL_PROFILES": "<mysql-profiles>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| MYSQL_HOST | — | — | Hostname of the MySQL server. Defaults to 127.0.0.1 |
| MYSQL_PORT | — | — | Port of the MySQL server. Defaults to 3306 |
| MYSQL_USER | — | — | MySQL user. Prefer an account holding only SELECT grants |
| MYSQL_PASSWORD | — | yes | Password for MYSQL_USER. Empty when the account has none |
| MYSQL_DATABASE | — | — | Database to open at startup. Can be changed later without restarting |
| MYSQL_PROFILES | — | yes | JSON object of named connections to switch between, keyed by profile name |
| MYSQL_DEFAULT_PROFILE | — | — | Which MYSQL_PROFILES entry to start on |
| MYSQL_CONNECT_TIMEOUT_MS | — | — | Connection timeout in milliseconds. Defaults to 10000 |
| MYSQL_QUERY_TIMEOUT_MS | — | — | Server-side query timeout in milliseconds. Defaults to 30000 |
Freshness
Active — last maintenance signal 16d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-24 · 16d ago · GitHub
Latest release
2026-09-24 · 16d ago · GitHub · v1.1.6
Package published
no data · npm/PyPI
Registry entry updated
2026-09-24 · 16d ago · official registry · v1.1.6
FAQ
›How do I install the MySQL (read-only, switchable) MCP server in Claude Code?
Run: claude mcp add mysql-read-only -e MYSQL_PASSWORD='<mysql-password>' -e MYSQL_PROFILES='<mysql-profiles>' -- npx -y @shibbirweb/mcp-mysql-read-only. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does MySQL (read-only, switchable) require an API key?
Yes. It expects MYSQL_PASSWORD, MYSQL_PROFILES, of which 2 are secrets.
›Can I use MySQL (read-only, switchable) as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is MySQL (read-only, switchable) in the official MCP registry?
Yes, as io.github.shibbirweb/mcp-mysql-read-only.
Alternatives to MySQL (read-only, switchable)
Other database MCP servers.