Read-only SQL, MongoDB, Redis and Elasticsearch access, switchable mid-conversation.
Connect Runs on your machine
claude mcp add mcp-db-read-only -e DB_URL=<DB_URL> -e DB_PASSWORD=<DB_PASSWORD> -e DB_PROFILES=<DB_PROFILES> -e DB_DEFAULT_PROFILE=<DB_DEFAULT_PROFILE> -e DB_CONNECT_TIMEOUT_MS=<DB_CONNECT_TIMEOUT_MS> -e DB_QUERY_TIMEOUT_MS=<DB_QUERY_TIMEOUT_MS> -e DB_LOG=<DB_LOG> -e DB_LOG_FILE=<DB_LOG_FILE> -e DB_LOG_DIR=<DB_LOG_DIR> -e DB_LOG_FORMAT=<DB_LOG_FORMAT> -e DB_LOG_PORT=<DB_LOG_PORT> -e DB_LOG_HISTORY=<DB_LOG_HISTORY> -e MYSQL_HOST=<MYSQL_HOST> -e MYSQL_USER=<MYSQL_USER> -e MYSQL_PASSWORD=<MYSQL_PASSWORD> -e MYSQL_DATABASE=<MYSQL_DATABASE> -- npx -y @shibbirweb/[email protected]
{
"mcpServers": {
"mcp-db-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/[email protected]"
],
"env": {
"DB_URL": "<DB_URL>",
"DB_PASSWORD": "<DB_PASSWORD>",
"DB_PROFILES": "<DB_PROFILES>",
"DB_DEFAULT_PROFILE": "<DB_DEFAULT_PROFILE>",
"DB_CONNECT_TIMEOUT_MS": "<DB_CONNECT_TIMEOUT_MS>",
"DB_QUERY_TIMEOUT_MS": "<DB_QUERY_TIMEOUT_MS>",
"DB_LOG": "<DB_LOG>",
"DB_LOG_FILE": "<DB_LOG_FILE>",
"DB_LOG_DIR": "<DB_LOG_DIR>",
"DB_LOG_FORMAT": "<DB_LOG_FORMAT>",
"DB_LOG_PORT": "<DB_LOG_PORT>",
"DB_LOG_HISTORY": "<DB_LOG_HISTORY>",
"MYSQL_HOST": "<MYSQL_HOST>",
"MYSQL_USER": "<MYSQL_USER>",
"MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<MYSQL_DATABASE>"
}
}
}
}
{
"mcpServers": {
"mcp-db-read-only": {
"command": "npx",
"args": [
"-y",
"@shibbirweb/[email protected]"
],
"env": {
"DB_URL": "<DB_URL>",
"DB_PASSWORD": "<DB_PASSWORD>",
"DB_PROFILES": "<DB_PROFILES>",
"DB_DEFAULT_PROFILE": "<DB_DEFAULT_PROFILE>",
"DB_CONNECT_TIMEOUT_MS": "<DB_CONNECT_TIMEOUT_MS>",
"DB_QUERY_TIMEOUT_MS": "<DB_QUERY_TIMEOUT_MS>",
"DB_LOG": "<DB_LOG>",
"DB_LOG_FILE": "<DB_LOG_FILE>",
"DB_LOG_DIR": "<DB_LOG_DIR>",
"DB_LOG_FORMAT": "<DB_LOG_FORMAT>",
"DB_LOG_PORT": "<DB_LOG_PORT>",
"DB_LOG_HISTORY": "<DB_LOG_HISTORY>",
"MYSQL_HOST": "<MYSQL_HOST>",
"MYSQL_USER": "<MYSQL_USER>",
"MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<MYSQL_DATABASE>"
}
}
}
}
{
"servers": {
"mcp-db-read-only": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@shibbirweb/[email protected]"
],
"env": {
"DB_URL": "<DB_URL>",
"DB_PASSWORD": "<DB_PASSWORD>",
"DB_PROFILES": "<DB_PROFILES>",
"DB_DEFAULT_PROFILE": "<DB_DEFAULT_PROFILE>",
"DB_CONNECT_TIMEOUT_MS": "<DB_CONNECT_TIMEOUT_MS>",
"DB_QUERY_TIMEOUT_MS": "<DB_QUERY_TIMEOUT_MS>",
"DB_LOG": "<DB_LOG>",
"DB_LOG_FILE": "<DB_LOG_FILE>",
"DB_LOG_DIR": "<DB_LOG_DIR>",
"DB_LOG_FORMAT": "<DB_LOG_FORMAT>",
"DB_LOG_PORT": "<DB_LOG_PORT>",
"DB_LOG_HISTORY": "<DB_LOG_HISTORY>",
"MYSQL_HOST": "<MYSQL_HOST>",
"MYSQL_USER": "<MYSQL_USER>",
"MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<MYSQL_DATABASE>"
}
}
}
}
Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.
Tools
This server runs locally, so its tools are listed by your MCP client once it starts.
Environment variables
| Name | Description |
|---|---|
DB_URLOptional | 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_PASSWORDOptional, secret | Password for DB_URL, so it need not be percent-encoded inside the URL |
DB_PROFILESOptional, secret | JSON object of named connections to switch between, each a URL or {"url", "password"} |
DB_DEFAULT_PROFILEOptional | Which DB_PROFILES entry to start on |
DB_CONNECT_TIMEOUT_MSOptional | Connection timeout in milliseconds. Defaults to 10000 |
DB_QUERY_TIMEOUT_MSOptional | Server-side query timeout in milliseconds. Defaults to 30000 |
DB_LOGOptional | true logs every tool call, its statements and full output to stderr. Off by default |
DB_LOG_FILEOptional | Log every tool call to this file instead. Implies DB_LOG |
DB_LOG_DIROptional | Save every tool call as its own JSON file in this folder, permanently. Implies logging |
DB_LOG_FORMATOptional | pretty (default) or json, one object per line |
DB_LOG_PORTOptional | 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_HISTORYOptional | Entries the viewer keeps in memory when DB_LOG_DIR is not set. Defaults to 500 |
MYSQL_HOSTOptional | Legacy MySQL-only form, kept for drop-in compatibility. Prefer DB_URL |
MYSQL_USEROptional | Legacy MySQL-only form. Prefer DB_URL |
MYSQL_PASSWORDOptional, secret | Legacy MySQL-only form. Prefer DB_URL with DB_PASSWORD |
MYSQL_DATABASEOptional | Legacy MySQL-only form. Prefer DB_URL |
Details
| Package | @shibbirweb/[email protected] (NPM, stdio) |
| Package | docker.io/shibbirweb/mcp-db-read-only:1.1.0 (OCI, stdio) |
| First published | 24 Sep 2026 |
| Last updated | 24 Sep 2026 |
| Registry name | io.github.shibbirweb/mcp-db-read-only |
More databases servers See all
Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.
