MCP server enabling read-only SQL queries on PostgreSQL, MySQL, Redshift, and SQL Server via secure SSH or AWS SSM tunnels.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Db Access MCP.
dialect_listLists the supported database dialects: name (the `type` value for connections), default port and the plan format `query_plan` produces.
connection_listLists configured connections: key, type, description, `read_only`, host/port/database, tunnel name, metadata. Credentials are **never** returned (allowlist-based sanitization; connection strings are parsed only for host/port/database).
connection_findFinds connections by `host`, `port`, `database`, `type`, `read_only` and/or `metadata` key-value pairs. All filters are combined with **AND**. `user`/`password` filters are ignored (and noted in the response).
connection_testEnd-to-end health check: secrets โ tunnel โ pool โ one-row server-info query. Returns `ok: true` with server version/user/database/latency, or `ok: false` with the failure code and hint (an unreachable DB is a valid result, not a tool error).
queryExecutes SQL on a connection. Accepts `connection`, `query`, optional `database` (see multi-database connections), `max_rows` and `timeout_ms` overrides. Results are truncated to the row cap with `truncated: true`.
query_to_fileExecutes a query and writes the result to a file (`csv`/`jsonl`, inferred from the extension) instead of the model context. `file_path` is relative to the export dir (default `/tmp/db-access-mcp/exports`, created on demand), or an absolute/`~` path **under** the export dir or a configured `allow_exโฆ
MCP (Model Context Protocol) stdio server that gives AI agents (Claude Code, Claude Desktop, any MCP client) access to configured databases:
with SSH / AWS SSM tunnels, pluggable secret providers (env vars, HashiCorp Vault, AWS Secrets Manager) and strict per-instance isolation โ many MCP instances can run concurrently on one machine without sharing connections or tunnels, and crashed instances never leave orphaned tunnel processes behind.
Tools: connection_list / connection_find / connection_test, query,
query_plan (EXPLAIN), query_to_file (streamed CSV/JSONL export that bypasses the
model context), up_tunnel / down_tunnel / tunnel_list, config_reload
(pick up new connections/tunnels without a restart).
Security-first design:
host_key_sha256 pin or known_hosts, failing closed on mismatch (MITM defence),
not blindly trusted.read_only seatbelt + single-statement-by-default, which also closes the
SET session read-only off; INSERT โฆ bypass.query_to_file writes only under the export dir or an
allow_export_paths root; it cannot clobber ~/.ssh, dotfiles or the config dir.user:password@host URIs.Tunnels & crash-safety: in-process SSH (dies with the process โ no orphaned ports) and AWS SSM under a watchdog (killed even on SIGKILL), with AWS SSO bootstrap. Every instance's pools and tunnels are isolated; a crashed instance's tunnels are reaped by the next start.
On first start the server creates the working directory ~/.db_acess_mcp
(intentional spelling โ it is the product contract) with an empty config.json, an
empty conf.d/ directory and a full config.example.json covering every dialect,
secret provider and tunnel type. The export directory (default
/tmp/db-access-mcp/exports) is not created up front โ query_to_file makes it
on demand on the first export. Edit ~/.db_acess_mcp/config.json, restart the MCP
server, done.
The server speaks MCP over stdio: any client that can spawn
npx -y @rheopyrin/db-access-mcp (or node <path>/dist/cli.js for a local build) can use it.
Every spawned instance is fully isolated โ its own pools, tunnels and idle timers โ
so it is safe to register it in several clients/sessions at once.
Check with /mcp inside a session (server status, reconnect). Server stderr logs
land in ~/Library/Caches/claude-cli-nodejs/<project-slug>/mcp-logs-db-access-mcp/
(macOS). After editing config.json, reconnect the server (/mcp) โ the config
is read at startup only.
Or declare it in the project's .mcp.json directly:
Add the same mcpServers block to the config file and restart the app:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonAny stdio-capable client works with the same shape โ command npx,
args ["-y", "@rheopyrin/db-access-mcp"] (Cursor: ~/.cursor/mcp.json, same mcpServers
format). Two things to know:
args, e.g.
["-y", "@rheopyrin/db-access-mcp", "--workdir", "/opt/mcp-db", "--log-level", "warn"].opens a web UI listing all tools with call forms and live stderr. A sensible
first-session sequence: dialect_list โ connection_list โ
connection_test on one connection โ query.
| Option | Env var | Default |
|---|---|---|
--workdir (or first positional) | DB_ACCESS_MCP_WORKDIR | ~/.db_acess_mcp |
--exportdir (or second positional) | DB_ACCESS_MCP_EXPORTDIR | /tmp/db-access-mcp/exports |
--config | DB_ACCESS_MCP_CONFIG | discovery: <workdir>/config.json + <workdir>/conf.d/*.json |
--env-file (repeatable) | โ | none |
--log-level (debug|info|warn|error|silent) | DB_ACCESS_MCP_LOG_LEVEL | info |
The workdir holds config.json, conf.d/, config.example.json and the
runtime instances/ and sso/ state (unchanged from earlier releases). The
exportdir is where query_to_file writes exports (created on demand, not at
startup); allow_export_paths adds extra writable roots.
All logs are JSON lines on stderr (stdout belongs to the MCP protocol). Values
of keys matching password, token, secret, privateKey etc. are redacted.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/rheopyrin-db-access-mcp)<a href="https://allmcps.com/mcp/rheopyrin-db-access-mcp"><img src="https://allmcps.com/api/badge/rheopyrin-db-access-mcp?style=directory" alt="Db Access MCP on AllMCPs" /></a>