DB MCP Server
io.github.stucchiPublished by GitHub account stucchiv1.2.1Updated Oct 24, 2026
Database MCP server for MySQL, PostgreSQL, MongoDB, and SQLite with SSH tunneling support.
Overview
Local MCP server that lets an assistant query and, in read-write mode, modify MySQL, PostgreSQL, MongoDB or SQLite databases, optionally through an SSH tunnel.
- What you can do
- Run read-only SQL queries and inspect results on MySQL, PostgreSQL and SQLite, or find documents in MongoDB collections and run aggregation pipelines with $out/$merge blocked in read-only mode. List tables or collections and describe table structures or collection stats. Show connection status and info. Execute write SQL such as INSERT, UPDATE and DELETE when read-write mode is enabled. Connect through an SSH bastion host for MySQL and PostgreSQL, or download a remote SQLite file over SFTP before querying.
- When to use it
- Useful when you want an assistant to explore a schema, answer questions from live data, or make controlled changes to a database without a separate client. Suited to local desktop setups, including databases reachable only through a bastion host.
- Requirements
- Runs locally as a Python package launched with uvx, so a Python/uv runtime is needed. One instance per database. Set DB_TYPE and DB_DATABASE, plus DB_HOST, DB_PORT and DB_USER as needed; MySQL and PostgreSQL need DB_PASSWORD, MongoDB needs DB_URL, SQLite needs DB_PATH. For SSH tunneling set SSH_HOST and provide SSH_KEY or SSH_PASSWORD. Network access to the database or bastion is required.
Installation
In SourceWeft
- Open DB MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
db-mcp-server
MCP server for MySQL, PostgreSQL, MongoDB, and SQLite databases. One instance per database, no Docker required.
Installation
Configuration
Configure via environment variables. Each instance connects to a single database.
MySQL
PostgreSQL
MongoDB
SQLite
SSH Tunnel (MySQL / PostgreSQL)
Optionally connect through an SSH bastion host. Set SSH_HOST to activate.
For SQLite over SSH, the remote .db file is downloaded via SFTP before querying. In read-write mode, changes are uploaded back on shutdown.
At least one of SSH_KEY or SSH_PASSWORD is required when SSH_HOST is set. SSH tunneling is not supported for MongoDB.
Usage in .mcp.json
SQLite (local)
SQLite over SSH
With SSH tunnel
For multiple databases, add multiple instances:
Tools
MySQL
- query — Execute read-only SQL (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH)
- execute — Execute write SQL (INSERT, UPDATE, DELETE) — requires
DB_MODE=read-write - describe — Describe table structure
- list_tables — List all tables
- status — Show connection info
PostgreSQL
- query — Execute read-only SQL (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH)
- execute — Execute write SQL (INSERT, UPDATE, DELETE) — requires
DB_MODE=read-write - describe — Describe table structure (column info from information_schema)
- list_tables — List all tables in the public schema
- status — Show connection info
SQLite
- query — Execute read-only SQL (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH)
- execute — Execute write SQL (INSERT, UPDATE, DELETE) — requires
DB_MODE=read-write - describe — Describe table structure (PRAGMA table_info)
- list_tables — List all tables
- status — Show connection info
MongoDB
- query — Find documents in a collection
- describe — Collection stats ($collStats)
- list_collections — List all collections
- aggregate — Execute aggregation pipelines ($out/$merge blocked on read-only)
- status — Show connection info
License
MIT
Source: README.md at commit c45f307
Tools
0Version history
1- v1.2.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts