RBDC MCP Server

by rbatis

Not rated
GitHub

About

An MCP-based database server with support for SQLite, MySQL, PostgreSQL, and MSSQL.

Details

Author
rbatis
Categories
Database

Setup

Install RBDC MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/rbatis/rbdc-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A database server based onModel Context Protocol (MCP), supporting SQLite, MySQL, PostgreSQL, MSSQL, DuckDB, and Turso databases.

πŸ‡¨πŸ‡³ δΈ­ζ–‡ζ–‡ζ‘£ / Chinese Documentation:readme_cn.md

- Multiple Database Support: Seamlessly work with SQLite, MySQL, PostgreSQL, MSSQL, DuckDB, and Turso using a unified interface
- AI Integration: Native integration with Claude AI through the Model Context Protocol
- Zero Configuration: Automatic management of database connections and resources
- Security: Controlled access to your database through AI-driven natural language queries
- Simplicity: Use natural language to query and modify your database without writing SQL

Choose the install command based on your needs:

# All drivers (default, ~10-15 minutes build) cargo install --git https://github.com/rbatis/rbdc-mcp.git # Minimal: SQLite only (fastest build, ~2-3 minutes) cargo install --git https://github.com/rbatis/rbdc-mcp.git --no-default-features --features sqlite # Single driver (e.g., MySQL): cargo install --git https://github.com/rbatis/rbdc-mcp.git --no-default-features --features mysql # Multiple drivers: cargo install --git https://github.com/rbatis/rbdc-mcp.git --no-default-features --features "mysql postgres"

πŸ’‘ Build speed tip:If you only need one database (e.g., SQLite), add--no-default-features --features sqliteto skip compiling unused drivers, cutting build time from ~15 minutes to ~2 minutes.

Download the latest release for your platform fromGitHub Releases:

After downloading, rename the file torbdc-mcp(orrbdc-mcp.exeon Windows) and add it to your system PATH.

Configure rbdc-mcp in your MCP-compatible client by adding it to the MCP server list.

- Windows:%APPDATA%\Claude\claude_desktop_config.json
- macOS:~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "rbdc-mcp": { "command": "rbdc-mcp", "args": [] } } }

Withargs: [], the server starts withno database pre-configured. The AI registers databases at runtime using theadd_databasetool (seeDynamic Multi-Databasebelow).

{ "mcpServers": { "rbdc-mcp": { "command": "rbdc-mcp", "args": ["--database-url", "sqlite://./database.db"] } } }

Single-Server Multi-Database Configuration

Onerbdc-mcpprocess can host many databases. The first--database-urlis registered as thedefaultalias; pair extra URLs with--aliasto declare a fixed set the AI can see immediately at startup vialist_databases(seeDynamic Multi-Database). The AI can also register more databases at runtime through theadd_databaseMCP tool.

Start a singledefaultdatabase (AI registers the rest at runtime):

{ "mcpServers": { "rbdc-mcp": { "command": "rbdc-mcp", "args": [ "--database-url", "sqlite://./database.db" ] } } }

Pre-declare several databases with explicit aliases (one process, multiple pools):

{ "mcpServers": { "rbdc-mcp": { "command": "rbdc-mcp", "args": [ "--database-url", "sqlite://./local.db", "--alias", "local", "--database-url", "mysql://user:password@db1:3306/orders", "--alias", "orders", "--database-url", "postgres://user:password@db2:5432/bi", "--alias", "bi", "--database-url", "duckdb://./warehouse.duckdb", "--alias", "warehouse" ] } } }

The first--aliasvalue is ignored (the first URL always becomesdefault). The aliases must be unique, non-empty, and not equal todefaultfor any URL after the first.

Legacy style β€” one process per database (still works, but no longer needed for multi-database access):

{ "mcpServers": { "rbdc-mcp-sqlite": { "command": "rbdc-mcp", "args": ["--database-url", "sqlite://./database.db"] }, "rbdc-mcp-mysql": { "command": "rbdc-mcp", "args": ["--database-url", "mysql://user:password@localhost:3306/database"] }, "rbdc-mcp-postgres": { "command": "rbdc-mcp", "args": ["--database-url", "postgres://user:password@localhost:5432/database"] }, "rbdc-mcp-mssql": { "command": "rbdc-mcp", "args": ["--database-url", "mssql://user:password@localhost:1433/database"] }, "rbdc-mcp-duckdb": { "command": "rbdc-mcp", "args": ["--database-url", "duckdb://path/to/database.duckdb"] }, "rbdc-mcp-turso": { "command": "rbdc-mcp", "args": ["--database-url", "turso://database-url?token=your-token"] } } }
{ "mcpServers": { "rbdc-mcp": { "command": "C:\\tools\\rbdc-mcp.exe", "args": ["--database-url", "sqlite://C:\\path\\to\\database.db"] } } }

Restart:After saving, restart Claude Desktop to load the MCP server.

- "Show me the database connection status"
- "What tables are in my database?"

- Global:~/.codex/mcp.toml
- Project-level:.codex/mcp.toml(place in your project root)

Basic Configuration (.codex/mcp.tomlor~/.codex/mcp.toml):

[mcp_servers.rbdc-mcp] command = "rbdc-mcp" args = ["--database-url", "sqlite://./database.db"] type = "stdio" enabled = true

Database Examples (single process, multiple databases):

# Pre-declare several databases with explicit aliases [mcp_servers.rbdc-mcp] command = "rbdc-mcp" args = [ "--database-url", "sqlite://./local.db", "--alias", "local", "--database-url", "mysql://user:password@db1:3306/orders", "--alias", "orders", "--database-url", "postgres://user:password@db2:5432/bi", "--alias", "bi", "--database-url", "duckdb://./warehouse.duckdb", "--alias", "warehouse", ] type = "stdio" enabled = true

The first URL becomes thedefaultalias (its--alias, if any, is ignored). Additional URLs must be paired with--aliasin declaration order. The AI can see every registered alias at startup through thelist_databasesMCP tool, and can also register more databases at runtime throughadd_database.

Restart:After saving the config file, restart Codex to load the MCP server. If Codex is already running, runcodex reconnectto force a reload.

- "Show me the database connection status"
- "What tables are in my database?"

- Query Data: "Show me all users in the database"
- Modify Data: "Add a new user named John with emailjohn@example.com"
- Get Status: "What's the database connection status?"
- Schema Info: "What tables exist in my database?"
- Multi-Database: "Connect to my MySQL orders database and compare its row counts with the local SQLite cache"

- sql_query: Execute a single read-only SQL statement. Pass optionalaliasto target a non-default database; defaults todefault.
- sql_exec: Execute INSERT/UPDATE/DELETE operations when the server is not in read-only mode. Pass optionalaliasto target a non-default database.
- db_status: Inspect connection pool state for a database. Pass optionalalias.
- test_connection: Ping a registered database. Pass optionalalias.
- list_databases: List all registered database aliases along with their URL and detected type.
- add_database: Register a new database connection under analiasand start a pool at runtime. Supported URL schemes:sqlite://,mysql://,pg:///postgres://,mssql:///sqlserver://,duckdb://,turso:///libsql://.
- remove_database: Unregister a previously-added alias. The reserveddefaultalias cannot be removed.

rbdc-mcpis amulti-database server from a single process. You can start it withno database URL at all(args: []in your MCP client config) and let the AI register databases on the fly through MCP tools. When a URL is provided via--database-url, it becomes thedefaultalias; the AI can then register more databases at runtime and route queries to any of them byalias.

When the server starts with no--database-url, thelist_databasestool returns an empty list and any operation targeting thedefaultalias will suggest usingadd_databasefirst. The AI can register the first (or any) database under any alias it chooses:
- add_database(alias="inventory", url="sqlite://./inventory.db")β€” register a database.
- list_databasesβ€” confirm it is now registered.
- sql_query({ alias: "inventory", sql: "SELECT FROM products" })β€” query it.

Tip: You can also register a database withalias="default"if you prefer to omitaliasfrom subsequent queries.
- list_databasesβ€” see all currently registered aliases.
- add_database(alias="orders_mysql", url="mysql://user:pass@host/orders")β€” register a new database and start a pool for it.
- sql_query({ alias: "orders_mysql", sql: "SELECT COUNT(
) FROM orders" })β€” route a query to that database. Omitaliasto use thedefaultone.
- remove_database(alias="orders_mysql")β€” tear down the pool and unregister the alias when finished.

Both paths write into the same in-memoryalias β†’ poolregistry, so the result is identical from the AI's point of view:list_databasesreturns every alias regardless of where it was registered.

- One MCP server process, many databases β€” no need to spawnrbdc-mcp-mysql,rbdc-mcp-postgres, etc. for each database.
- All aliases are discoverable vialist_databases, so the AI can dynamically pick the right target per query.
- When a--database-urlis provided, thedefaultalias is reserved for it and cannot be removed.
- Each alias has its own independent connection pool β€” concurrent queries against different aliases do not block each other.

"Connect to my MySQL orders database atmysql://root:pwd@10.0.0.5/ordersand tell me the total revenue by month."

The AI will calladd_database(...), thensql_query(...)against that alias without restarting the MCP server β€” works the same whether you provided a--database-urlat startup or not.

--read-onlydisables thesql_exectool, preventing any data modifications. Additionally,sql_queryvalidates submitted SQL and rejects statements containing write keywords (INSERT, UPDATE, DELETE, etc.) or multi-statement input.

- Multi-Database in One Server: The AI can register additional database connections at runtime via theadd_databasetool and route queries to any registered database by itsaliasβ€” no need to spawn extra MCP server processes |--database-url, -d| Database connection URL. Omit to start empty (databases added at runtime viaadd_database). Repeat to pre-register multiple databases at startup. |None(optional) |

Official Airtable MCP server and skills for working with bases, records, workflows, and business operations from AI agents.

MCP Server For Apache Doris, an MPP-based real-time data warehouse.

Official MCP Server from Atlan which enables you to bring the power of metadata to your AI tools

Query Onchain data, like ERC20 tokens, transaction history, smart contract state.

Read and write access to your Baserow tables.

Introspect and query your apps deployed to Convex.

Interact with the data stored in Couchbase clusters using natural language.

Maritime intelligence for tracking vessels, analysing ports, and exploring ship data.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.