Databases (read-only, switchable) MCP Server
by shibbirwebio.github.shibbirweb/mcp-db-read-onlyv1.1.0
Read-only SQL, MongoDB, Redis and Elasticsearch access, switchable mid-conversation.
context tax
queued
security
queued
cold start
queued
freshness
Active13d ago
Install Databases (read-only, switchable) MCP server
Install in Claude Code
claude mcp add db-read-only -e DB_PASSWORD='<db-password>' -e DB_PROFILES='<db-profiles>' -e MYSQL_PASSWORD='<mysql-password>' -- npx -y @shibbirweb/mcp-db-read-onlyInstall in Cursor
{
"mcpServers": {
"db-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-db-read-only"
],
"env": {
"DB_PASSWORD": "<db-password>",
"DB_PROFILES": "<db-profiles>",
"MYSQL_PASSWORD": "<mysql-password>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"db-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-db-read-only"
],
"env": {
"DB_PASSWORD": "<db-password>",
"DB_PROFILES": "<db-profiles>",
"MYSQL_PASSWORD": "<mysql-password>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"db-read-only": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-db-read-only"
],
"env": {
"DB_PASSWORD": "<db-password>",
"DB_PROFILES": "<db-profiles>",
"MYSQL_PASSWORD": "<mysql-password>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"db-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/mcp-db-read-only"
],
"env": {
"DB_PASSWORD": "<db-password>",
"DB_PROFILES": "<db-profiles>",
"MYSQL_PASSWORD": "<mysql-password>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| DB_URL | — | — | Connection URL to open at startup, e.g. postgres://user@host:5432/db, mongodb://user@host/db, redis://host:6379/0 or sqlite:///data/app.db |
| DB_PASSWORD | — | yes | Password for DB_URL, so it need not be percent-encoded inside the URL |
| DB_PROFILES | — | yes | JSON object of named connections to switch between, each a URL or {"url", "password"} |
| DB_DEFAULT_PROFILE | — | — | Which DB_PROFILES entry to start on |
| DB_CONNECT_TIMEOUT_MS | — | — | Connection timeout in milliseconds. Defaults to 10000 |
| DB_QUERY_TIMEOUT_MS | — | — | Server-side query timeout in milliseconds. Defaults to 30000 |
| DB_LOG | — | — | true logs every tool call, its statements and full output to stderr. Off by default |
| DB_LOG_FILE | — | — | Log every tool call to this file instead. Implies DB_LOG |
| DB_LOG_DIR | — | — | Save every tool call as its own JSON file in this folder, permanently. Implies logging |
| DB_LOG_FORMAT | — | — | pretty (default) or json, one object per line |
| DB_LOG_PORT | — | — | Serve a live log viewer in the browser on this port. Needs DB_LOG_DIR, DB_LOG or DB_LOG_FILE. No access control |
| DB_LOG_HISTORY | — | — | Entries the viewer keeps in memory when DB_LOG_DIR is not set. Defaults to 500 |
| MYSQL_HOST | — | — | Legacy MySQL-only form, kept for drop-in compatibility. Prefer DB_URL |
| MYSQL_USER | — | — | Legacy MySQL-only form. Prefer DB_URL |
| MYSQL_PASSWORD | — | yes | Legacy MySQL-only form. Prefer DB_URL with DB_PASSWORD |
| MYSQL_DATABASE | — | — | Legacy MySQL-only form. Prefer DB_URL |
Freshness
Active — last maintenance signal 13d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-27 · 13d ago · GitHub
Latest release
2026-09-24 · 16d ago · GitHub · v1.1.0
Package published
no data · npm/PyPI
Registry entry updated
2026-09-24 · 16d ago · official registry · v1.1.0
FAQ
›How do I install the Databases (read-only, switchable) MCP server in Claude Code?
Run: claude mcp add db-read-only -e DB_PASSWORD='<db-password>' -e DB_PROFILES='<db-profiles>' -e MYSQL_PASSWORD='<mysql-password>' -- npx -y @shibbirweb/mcp-db-read-only. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Databases (read-only, switchable) require an API key?
Yes. It expects DB_PASSWORD, DB_PROFILES, MYSQL_PASSWORD, of which 3 are secrets.
›Can I use Databases (read-only, switchable) as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Databases (read-only, switchable) in the official MCP registry?
Yes, as io.github.shibbirweb/mcp-db-read-only.
Alternatives to Databases (read-only, switchable)
Other database MCP servers.