Databases (read-only, switchable)
Read-only SQL, MongoDB, Redis and Elasticsearch access, switchable mid-conversation.
- Pricing
- Open source
- Runs
- Locally
- Version
- 1.1.0
- Listing updated
- 4 days ago
About Databases (read-only, switchable)
Databases (read-only, switchable) is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.
Install
Run in a terminal
claude mcp add mcp-db-read-only --env DB_PASSWORD='<DB_PASSWORD>' --env DB_PROFILES='<DB_PROFILES>' --env MYSQL_PASSWORD='<MYSQL_PASSWORD>' -- npx -y @shibbirweb/mcp-db-read-onlyAdd to claude_desktop_config.json
{
"mcpServers": {
"mcp-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
{
"mcpServers": {
"mcp-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 .vscode/mcp.json
{
"servers": {
"mcp-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 ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-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 your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-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>"
}
}
}
}Configuration
DB_URLConnection URL to open at startup, e.g. postgres://user@host:5432/db, mongodb://user@host/db, redis://host:6379/0 or sqlite:///data/app.dbDB_PASSWORDPassword for DB_URL, so it need not be percent-encoded inside the URLDB_PROFILESJSON object of named connections to switch between, each a URL or {"url", "password"}DB_DEFAULT_PROFILEWhich DB_PROFILES entry to start onDB_CONNECT_TIMEOUT_MSConnection timeout in milliseconds. Defaults to 10000DB_QUERY_TIMEOUT_MSServer-side query timeout in milliseconds. Defaults to 30000DB_LOGtrue logs every tool call, its statements and full output to stderr. Off by defaultDB_LOG_FILELog every tool call to this file instead. Implies DB_LOGDB_LOG_DIRSave every tool call as its own JSON file in this folder, permanently. Implies loggingDB_LOG_FORMATpretty (default) or json, one object per lineDB_LOG_PORTServe a live log viewer in the browser on this port. Needs DB_LOG_DIR, DB_LOG or DB_LOG_FILE. No access controlDB_LOG_HISTORYEntries the viewer keeps in memory when DB_LOG_DIR is not set. Defaults to 500MYSQL_HOSTLegacy MySQL-only form, kept for drop-in compatibility. Prefer DB_URLMYSQL_USERLegacy MySQL-only form. Prefer DB_URLMYSQL_PASSWORDLegacy MySQL-only form. Prefer DB_URL with DB_PASSWORDMYSQL_DATABASELegacy MySQL-only form. Prefer DB_URLDB_URLConnection 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. Use host.docker.internal to reach the hostDB_PASSWORDPassword for DB_URL, so it need not be percent-encoded inside the URLDB_PROFILESJSON object of named connections to switch between, each a URL or {"url", "password"}DB_DEFAULT_PROFILEWhich DB_PROFILES entry to start onDB_CONNECT_TIMEOUT_MSConnection timeout in milliseconds. Defaults to 10000DB_QUERY_TIMEOUT_MSServer-side query timeout in milliseconds. Defaults to 30000DB_LOGtrue logs every tool call, its statements and full output to stderr. Off by defaultDB_LOG_FILELog every tool call to this file instead, on a mounted volume. Implies DB_LOGDB_LOG_DIRSave every tool call as its own JSON file in this folder, on a mounted volume. Implies loggingDB_LOG_FORMATpretty (default) or json, one object per lineDB_LOG_PORTServe a live log viewer on this port (publish it with -p). Needs DB_LOG_DIR, DB_LOG or DB_LOG_FILE. No access controlDB_LOG_HISTORYEntries the viewer keeps in memory when DB_LOG_DIR is not set. Defaults to 500MYSQL_HOSTLegacy MySQL-only form, kept for drop-in compatibility. Prefer DB_URLMYSQL_USERLegacy MySQL-only form. Prefer DB_URLMYSQL_PASSWORDLegacy MySQL-only form. Prefer DB_URL with DB_PASSWORDMYSQL_DATABASELegacy MySQL-only form. Prefer DB_URL
Pricing
Open source
Databases (read-only, switchable) FAQ
Is Databases (read-only, switchable) free?
Yes. Databases (read-only, switchable) is open source, so you can use and self-host it for free.
How do I add Databases (read-only, switchable) to Claude Code?
Run this command in your terminal: claude mcp add mcp-db-read-only --env DB_PASSWORD='<DB_PASSWORD>' --env DB_PROFILES='<DB_PROFILES>' --env MYSQL_PASSWORD='<MYSQL_PASSWORD>' -- npx -y @shibbirweb/mcp-db-read-only
What are the best alternatives to Databases (read-only, switchable)?
The closest alternatives to Databases (read-only, switchable) are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.
Alternatives to Databases (read-only, switchable)

Midplane
MCP serverPostgres gateway for AI agents with table grants, column masking and approval for writes
Runs locally- Open source
- 5 GitHub stars
- Databases

PlatypusDB
MCP serverGives MCP clients access to your PlatypusDB database connections, scoped per agent
Runs locally- Open source
- Databases

Lorebase
MCP serverLets agents read and change a governed, versioned Postgres knowledge graph
Runs locally- Open source
- Knowledge and memory
Sovaria
MCP serverManage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant
Not checked yet- 4 tools
- Remote
- Freemium
- Databases

model2data studio
MCP serverGenerate realistic connected test data, dbt projects and dashboards from a schema
- Remote
- Freemium
- Databases

semlayer
MCP serverInfers a semantic layer from your data warehouse and serves it to agents
Runs locally- Free
- Databases