# DB MCP

> DB MCP is an open-source MCP server for databases. Rust MCP server letting AI agents query and modify Oracle, PostgreSQL, MySQL, SQLite. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows, VS Code, Self-hosted
- **Repository:** https://github.com/arthurhoch/db-mcp
- **MCP Registry name:** io.github.arthurhoch/db-mcp
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-21

## About

Rather than giving an assistant a single database login, this server keeps each connection in its own TOML file with a description, credentials and an access mode. The agent picks a database by ID and writes SQL in that engine's native dialect, so Oracle, PostgreSQL, MySQL, SQLite and SQL Server queries all run through one interface.

Access is controlled per connection: read-only, read-write, or read-write with DDL. Tools cover listing databases, inspecting tables, columns, indexes and constraints, running SQL, and returning an estimated query plan without executing it. Batches run in one transaction per call, and statements can set up row-level security context before dependent queries.

It suits developers and data teams who want an AI client to explore schemas and run queries against existing databases under explicit permissions. Packages for macOS, Linux and Windows ship as standalone executables with a SQLite demo, and the server is used over STDIO from clients such as VS Code Copilot and Codex.

## Features

- **Per-connection access modes:** Each database connection is set to read-only, read-write, or read-write with DDL, limiting what the agent can change.
- **Multi-engine SQL execution:** Runs SQL in the native dialect of Oracle, PostgreSQL, MySQL, SQLite or SQL Server, selected by connection ID.
- **Schema inspection tools:** Describes tables, columns, indexes and constraints so the agent can understand a database before querying it.
- **Query plan explanation:** Returns an estimated execution plan for a query without running it.
- **Transactional batches:** Groups statements into one transaction per call, with row-level security context kept on the same connection.
- **No separate driver install:** Oracle connects through a Rust driver, so Instant Client and Oracle libraries are not needed.

## Good for

- Letting an AI assistant list pending orders or other records in a production-like database under read-only access
- Inspecting unfamiliar schemas, indexes and constraints before writing queries
- Comparing estimated query plans before running expensive SQL
- Running controlled data corrections through read-write connections
- Testing SQL across Oracle, PostgreSQL, MySQL and SQLite from one MCP client

## Install

### Claude Desktop (Claude Desktop → Settings → Extensions)

```text
https://github.com/arthurhoch/db-mcp/releases/download/v0.2.6/db-mcp-linux-x64.mcpb
```

Download the bundle and open it with Claude Desktop, or drag it onto Settings → Extensions and click Install. This server is only published as a Claude Desktop bundle.

## Tools

From the tool list in its README, going by the names, 1 of 4 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `list_databases` (name suggests: reads): Finds the configured database connection.
- `describe_database` (name suggests: reads): Inspects tables, columns, indexes or constraints.
- `execute_sql` (name suggests: changes): Runs SQL against a selected connection.
- `explain_query` (name suggests: reads): Returns an estimated query plan without running the query.

## FAQ

### Which databases are supported?

Oracle, PostgreSQL, MySQL and SQLite support reads and writes, while Microsoft SQL Server is supported for querying.

### How is access restricted?

Each connection's TOML file sets its mode: read_only, read_write, or read_write_ddl.

### Do I need to install Rust or Oracle Instant Client?

No. Downloaded packages include the executable, and Oracle connects without Instant Client.

### How does the server run with a client?

It runs as a STDIO subprocess started by the MCP client, such as VS Code Copilot or Codex.

### Is DB MCP free?

Yes. DB MCP is open source, so you can use and self-host it for free.

### What are the best alternatives to DB MCP?

The closest alternatives to DB MCP are Custom MCP Database, MCP Sql Rust, JDBC MCP Server, SQL Server MCP and Mysql.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Custom MCP Database](https://ai-powered.com/mcp/custom-mcp-database): Custom MCP Database is an open-source MCP server for databases.
- [MCP Sql Rust](https://ai-powered.com/mcp/mcp-sql-rust): MCP Sql Rust is an open-source MCP server for databases.
- [JDBC MCP Server](https://ai-powered.com/mcp/jdbc-mcp-server): JDBC MCP Server is an open-source MCP server for databases.
- [SQL Server MCP](https://ai-powered.com/mcp/sql-server-mcp): SQL Server MCP is an open-source MCP server for databases.
- [Mysql](https://ai-powered.com/mcp/mysql): Mysql is an open-source MCP server for databases.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.
- [AdoMcp](https://ai-powered.com/mcp/adomcp): AdoMcp is an open-source MCP server for databases.
- [DataLink](https://ai-powered.com/mcp/datalink): DataLink is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/db-mcp
