Skip to content
MCP server

db-mcp-server

Go server giving AI assistants SQL access to MySQL, PostgreSQL, SQLite and Oracle via MCP

Actively maintained

The repository was last updated 4 days ago and is published under MIT.

db-mcp-server is an open-source MCP server for databases. It is available on CLI, API, Linux, macOS, Windows and Self-hosted.

Pricing
Open source
Platforms
CLI, API, Linux
GitHub stars
488
Last commit
Language
Go
License
MIT

Similar MCP servers

About db-mcp-server

Rather than wiring one database connector per engine, this server lets an assistant reach several databases at once through a single MCP endpoint. Each configured connection gets its own set of query, execute, transaction, schema and performance tools, so an agent can compare or join across systems in one session.

Safety controls are a major part of the design. Operators can mark a database read-only, cap result sizes, mask columns by name or detect PII by content shape, set per-query timeouts, and cap planner cost on PostgreSQL and MySQL. An audit log records each statement, and authenticated HTTP deployments support scoped API keys and OIDC. The read-only check is documented as best-effort, so the README recommends a least-privilege database account for a hard guarantee.

The server suits developers and data teams who want an assistant to inspect schemas, run analysis queries or tune slow SQL against their own databases. Stdio is the recommended local transport, and a unified mode reduces tool count when many databases are connected.

What it does

Multi-database connections
Connects to several MySQL, PostgreSQL, SQLite, Oracle and TimescaleDB instances concurrently from one configuration file.
Generated per-database tools
Creates query, execute, transaction, schema and performance tools for each configured connection automatically.
Read-only and result limits
Supports a read-only flag, row truncation with notices, and per-query timeouts to bound what an agent can run.
PII and column masking
Redacts emails, phone numbers, card numbers and similar values, and masks result columns by name before they leave the server.
Audit logging and access control
Writes a JSONL record per statement and supports scoped API keys, per-agent keys and OIDC bearer tokens on HTTP transports.
Unified tool mode
Registers a consolidated set of tools with a database parameter, keeping tool count flat as more databases are added.

Good for

  • Letting an assistant explore table structures and relationships in an unfamiliar database
  • Running analytical SQL across MySQL and PostgreSQL databases in one conversation
  • Reviewing slow queries and suggesting indexes with plan checks
  • Giving an agent read-only access to production-like data with masking applied
  • Managing small transactional changes through staged begin, execute and commit steps

Pricing

Open source

Free and open source under the MIT license.

db-mcp-server FAQ

Which databases are supported?

The README lists MySQL, PostgreSQL (v9.6-17), SQLite, Oracle (10g-23c) and TimescaleDB as fully supported engines.

What is the license?

The repository is released under the MIT license.

Can the server protect against accidental writes?

A read-only flag per database applies a best-effort textual check, and the docs state it is not a security boundary. A least-privilege database user is recommended for a hard guarantee.

Which transport should I use locally?

The README recommends stdio for personal local use. Legacy SSE has no built-in authentication and is disabled by default, and Streamable HTTP is marked experimental.

Is db-mcp-server free?

Yes. db-mcp-server is open source, so you can use and self-host it for free.

What are the best alternatives to db-mcp-server?

The closest alternatives to db-mcp-server are mcp-multi-db, thinair-data, DB MCP, sql-query-mcp and Custom MCP Database.

Where this comes from

  • Description: written from the project's README.

How AIPoweredBot checks servers