dbgate-dashboard
Enables browsing MongoDB collections and querying documents through DbGate, including Mongo-style filters and sorting; collection metadata exposes document counts and unique keys.
Enables querying and managing MySQL databases through a DbGate dashboard: lists databases and tables, describes schema details, runs read queries with row limits, and executes arbitrary SQL including writes and DDL.
Enables querying and managing PostgreSQL databases through a DbGate dashboard: lists databases and tables, describes schema details, runs read queries with row limits, and executes arbitrary SQL including writes and DDL.
Enables browsing the Redis keyspace level by level, inspecting key type, TTL, and value, and running arbitrary Redis commands including writes through DbGate.
Enables querying and managing SQLite databases through a DbGate dashboard: lists databases and tables, describes schema details, runs read queries with row limits, and executes arbitrary SQL including writes and DDL.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dbgate-dashboard-mcp
An MCP server that gives an agent access to databases through a running DbGate dashboard. No database drivers are needed: DbGate itself holds the connections, engine plugins and pool, and the server talks to it over HTTP.
Engines: MySQL, PostgreSQL, SQLite (SQL tools), MongoDB and Redis (dedicated tools below).
Installation
// .mcp.json
{
"mcpServers": {
"dbgate-dashboard": {
"command": "uvx",
"args": ["dbgate-dashboard-mcp@latest"],
"env": {
"DBGATE_URL": "http://localhost:3000"
}
}
}
}A remote dashboard through an SSH tunnel — DBGATE_URL then means the address on the remote side:
"env": {
"DBGATE_URL": "http://localhost:3000",
"SSH_PROXY_TO": "user@remote-host"
}An HTTPS dashboard behind a reverse proxy works the same way — the port comes from the scheme (443), while Host and SNI stay canonical, so certificate verification is not disabled:
"env": {
"DBGATE_URL": "https://dbgate.example.com",
"SSH_PROXY_TO": "user@remote-host"
}The tunnel only changes the connect address: DBGATE_URL is not rewritten, otherwise the proxy would receive Host: 127.0.0.1:<port> and answer with a redirect, and TLS would not match the certificate.
Tunnel loss
If ssh dies mid-session, the next call does not fail: the tunnel is reopened and the request is retried once. A second drop in a row is returned as an error, so an unreachable remote host does not send every tool into endless retries.
A reconnect is invisible by itself — a retried call looks like an ordinary one — so the tool result gets a notices field:
{
"connections": [ /* ... */ ],
"notices": [
"ssh tunnel dropped (ConnectError) and was reopened on 127.0.0.1:49173; the call was retried and this result is from the new connection"
]
}The field appears only when there is something to report, and exactly once: the queue is drained when delivered.
Related MCP server: AI Data MCP
Environment variables
Variable | Default | Purpose |
|
| dashboard address (with a tunnel — the remote side) |
| — | login, if authentication is enabled in DbGate |
| — | its password |
| — |
|
| auto | fixed local port for the tunnel |
Tools
Tool | What it does |
| dashboard connections: |
| databases on a connection |
| tables, views and matviews (no columns) |
| columns, PK, FKs and indexes of one object |
| a read query; appends |
| any SQL, including writes and DDL, unmodified |
| documents of a Mongo collection with filter and sort |
| browse the Redis keyspace level by level |
| type, TTL and value of one key |
| any Redis command, including writes |
conid is required by every tool — take it from list_connections. database can be omitted: the connection's default database is used.
query limits the output twice: it appends LIMIT n if the SQL has no limit of its own, and in any case cuts the response to n rows (truncated: true when cut). The DbGate API has no limit parameter, so the bound has to be held on both sides.
LIMIT is appended only to statements that accept it (SELECT, WITH, VALUES, TABLE). SHOW, PRAGMA, DESCRIBE, EXPLAIN go to the engine as is — with a LIMIT glued on they would be a syntax error; cutting to n rows still applies to them.
execute passes SQL through unchanged and without a safety net — including INSERT/UPDATE/DELETE and DDL. Restrict permissions on the connection itself in DbGate.
MongoDB and Redis
find_documents takes a regular Mongo filter — {"artistId": {"$gt": 5}}, {"title": {"$regex": "Rock"}}, $in, $and/$or. It is translated into a DbGate condition, because the dashboard API does not accept a raw Mongo filter. An unsupported operator ($exists, $elemMatch) returns an explicit error. $regex becomes a LIKE wrapped in %…%, so % and _ inside the pattern act as wildcards.
Collections show up in the common list_tables with type: "collection"; describe_table for a collection returns the document count and the unique key — DbGate's Mongo structure has no columns.
Redis navigation has two levels: redis_keys without root shows prefixes (album, track, …), with root — the keys under it. redis_get reads a value as one page no longer than limit (truncated: true if the value continues); for the full data of a large key use redis_command, which runs an arbitrary command. For a missing key redis_get returns the error key '…' not found.
The command name in redis_command is case-insensitive — it is lowercased, because DbGate calls the method of the same name on its Redis client, and all those methods are lowercase.
A Redis connection has no default database, so database can be omitted: the server takes the first one in the list (db0). A freshly opened DbGate connection returns an empty database list while it starts up, so an empty answer is asked again — without that, database resolution sometimes failed with has no default database.
Development
uv sync # venv + runtime + dev group
uv run pytest # full suite; addopts enforces --cov-fail-under=100
uv run pytest tests/test_server.py --no-cov # partial run — only with --no-cov
python -m dbgate_dashboard_mcp # run over stdioTests need neither network nor a running DbGate: httpx and subprocess are faked.
Manual check on the test stand
The repository ships a docker-compose.yml with DbGate and five databases (Chinook in MySQL, PostgreSQL, SQLite, MongoDB, Redis). Seeds live in init/: Chinook (MIT, © Luis Rocha), adapted for each engine.
docker compose up -d
TOKEN=$(curl -s -X POST http://localhost:3000/auth/login \
-H 'Content-Type: application/json' -d '{"amoid":"none"}' \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["accessToken"])')
curl -s -X POST http://localhost:3000/connections/list \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{}'Then connect the server in an MCP client with DBGATE_URL=http://localhost:3000 and call list_connections.
How the DbGate API works
Useful when extending the server: DbGate is RPC over HTTP, not REST. Controller methods are mounted as kebab-case paths (queryData → /database-connections/query-data), almost all of them POST with a single JSON object of arguments. POST /auth/login {"amoid":"none"} issues a token that lives 24 h. SQL errors arrive with HTTP 200 and an errorMessage field, so success is decided by the response body, not the status code.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Agents query live Postgres and MySQL read-only, and reach your MCP servers and APIs. No passwords.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Secure tunneling, reverse proxy and remote access for local applications.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceRun SQL against 31 database engines from an agent: list and test saved datasources, execute statements, and page through large result sets. Credentials are stored encrypted and never returned to the caller.3-
- AlicenseAqualityCmaintenanceLets AI agents and developers inspect and query local MySQL, Redis, and MongoDB instances over STDIO or authenticated loopback HTTP, with read-only defaults and allowlisted non-production writes that require explicit opt-in. Production connections always reject writes, and database-enforced read-only accounts are recommended.18Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI agents to discover and query data federated across MySQL/MariaDB, PostgreSQL, ClickHouse, S3 and Kafka with SQL, exposing tools to list databases, schemas, tables and connections, describe columns, search objects, inspect table statistics, run EXPLAIN, and execute arbitrary statements. It runs locally over stdio against a PostgreSQL-wire endpoint and returns structured results or SQLSTATE-coded errors.8Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to explore schemas, trace lineage and procedure call graphs, run bounded SQL and PostgreSQL diagnostics, and manage cryptographically governed changes across PostgreSQL, MySQL, and SQLite over stdio or HTTP.Apache 2.0