DB MCP
Enables querying and modifying MySQL data using native SQL, with configurable read-only, read-write, and DDL access modes, schema inspection, explain plans, and transaction-based batches.
Enables querying and modifying PostgreSQL data using native SQL, including schema inspection, explain plans, transactional batches, and configurable read-only, read-write, or DDL permissions.
Enables querying and modifying SQLite databases using SQL, with schema inspection, explain plans, transaction-based batches, and configurable read-only, read-write, or DDL access modes.
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.
DB MCP
An MCP server in Rust for querying and modifying data in Oracle, PostgreSQL, MySQL and SQLite, and for querying Microsoft SQL Server. Each connection has a TOML file with its description, credentials and permissions. The agent selects a database by ID and executes SQL in its native dialect.
Download and run
Download a package from Releases. Rust and Oracle Instant Client are not required. Packages include the executable, a SQLite demo and configuration examples.
MCPB-compatible clients can install a .mcpb asset from the same release. Choose
the bundle matching your system and processor, then select your existing global
TOML file when the client asks. Connections and access modes use that configuration.
System | x64 (Intel/AMD) | ARM64 (Apple Silicon/ARM) |
macOS | ||
Linux | ||
Windows |
For example, on a Mac with Apple Silicon:
curl -fLO https://github.com/arthurhoch/db-mcp/releases/latest/download/db-mcp-macos-arm64.tar.gz
tar -xzf db-mcp-macos-arm64.tar.gz
cd db-mcp-macos-arm64
./db-mcp --version
./db-mcp --config demo/config/global.toml --check-configOn Windows, extract the ZIP and use db-mcp.exe. Configuration validation opens
no database. To query the demo, connect your MCP client to this executable with
--config pointing to the demo's global TOML, then ask it to list pending orders
in demo-ro.
Each release includes SHA256SUMS and GitHub build provenance. See
releases and verification for verification and publishing.
Related MCP server: 多数据库 MCP Server
Build and test
Install Rust through rustup. The toolchain version is pinned in rust-toolchain.toml.
cargo build --release --locked
cargo fmt --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --all-targets --lockedThe executable is built at target/release/db-mcp or target\release\db-mcp.exe.
Oracle uses oracledb, a Rust driver
that connects directly without installing Instant Client or Oracle libraries.
Try it with SQLite
cargo run --locked --example create_demo
target/release/db-mcp --config .runtime/demo/config/global.toml --check-config
target/release/db-mcp --config .runtime/demo/config/global.toml --test-connection demo-roDownloaded packages already include the demo. The Rust example creates sample
orders and three connections: demo-ro, demo-rw
and demo-ddl. It refuses to overwrite an existing directory. To use a different
destination, pass its path after --example create_demo --.
Connect to an agent
GitHub Copilot in VS Code
Follow the Copilot setup guide for a .vscode/mcp.json
example, server startup and a demo query. VS Code manages the executable as a
STDIO subprocess; no separate daemon is required.
Codex
Example for a client using the Codex TOML configuration format:
[mcp_servers.db_mcp]
command = "/absolute/path/db-mcp-macos-arm64/db-mcp"
args = ["--config", "/absolute/path/db-mcp-macos-arm64/demo/config/global.toml"]Adjust the executable and configuration paths for your download or source build. The transport is STDIO. The process uses the catalog from the global configuration file, with no separate MCP login. Credential environment variables must be available to the process. Other MCP clients have their own configuration formats.
Example request: “In demo-ro, list the pending orders.” The agent uses
list_databases to find the connection, describe_database to inspect tables,
columns, indexes or constraints, and execute_sql to run SQL. explain_query
returns an estimated plan without running the query.
Connection mode | Operations |
| Read queries. |
| Read queries, INSERT, UPDATE and DELETE. |
| Also supported CREATE, ALTER and DROP statements. |
SQL Server supports read_only with verified TLS. See the
SQL Server configuration example.
Batches use one transaction per call. DDL statements run individually. The server reports truncated results and unknown effects; it does not retry SQL automatically.
For RLS/VPD, put context setup and dependent queries in the same statements batch.
Oracle supports packaged CALL; PostgreSQL supports SET LOCAL and custom
set_config(..., true). Statements run in order on the same connection. Oracle
packages that commit internally prevent a guaranteed rollback of the whole batch.
Configuration · MCP contract · Databases · Architecture · Testing · Skills · Privacy policy
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
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Executes SQL in a real ephemeral database: rows, typed errors with suggestions, plans, diffs.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Governed SQL access to your databases: redaction, query review and an audit log.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure interaction with multiple SQL database engines (MySQL, PostgreSQL, SQLite, SQL Server) through a standardized interface. Supports schema inspection, safe query execution, and controlled write operations with built-in security restrictions.5MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to securely query databases, list tables, inspect table schemas, and test connections across Oracle, SQL Server, MySQL, PostgreSQL, and SQLite using read-only SQL tools.4MIT
- 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-
- AlicenseNot gradedqualityCmaintenanceEnables running single, validated SELECT statements against PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, and Oracle through read-only sessions with schema/table inspection, query plans, row limits, timeouts, and an audit log. Keeps the assistant strictly read-only by combining a read-only database user, SQL validation, and automatic rollback.MIT