A database server based on Model Context Protocol (MCP), supporting SQLite, MySQL, PostgreSQL, and MSSQL databases.
🇨🇳 中文文档 / Chinese Documentation: README_cn.md
- Multiple Database Support: Seamlessly work with SQLite, MySQL, PostgreSQL, and MSSQL 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
First, you need to install Rust and Cargo:
Windows:
- Visit https://rustup.rs/
- Download and run
rustup-init.exe
- Restart your terminal to refresh environment variables
macOS/Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
cargo install --git https://github.com/rbatis/rbdc-mcp.git
git clone https://github.com/rbatis/rbdc-mcp.git
cd rbdc-mcp
cargo build --release
# Executable located at target/release/rbdc-mcp
Step 1: Configure the Claude Desktop settings
Step 2: Use database commands in Claude
# SQLite
rbdc-mcp --database-url "sqlite://./database.db"
# MySQL
rbdc-mcp --database-url "mysql://user:password@localhost:3306/database"
# PostgreSQL
rbdc-mcp --database-url "postgres://user:password@localhost:5432/database"
# MSSQL
rbdc-mcp --database-url "mssql://user:password@localhost:1433/database"
Edit the configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"rbdc-mcp": {
"command": "rbdc-mcp",
"args": [
"--database-url", "sqlite://./database.db"
]
}
}
}
Windows Full Path Example:
{
"mcpServers": {
"rbdc-mcp": {
"command": "C:\\Users\\YourName\\.cargo\\bin\\rbdc-mcp.exe",
"args": [
"--database-url", "sqlite://C:\\path\\to\\database.db"
]
}
}
}
After configuration, you can use the following features in Claude Desktop:
- Query Data: "Help me query all users in the database"
- Modify Data: "Add a new user to the database"
- Get Status: "Show database connection status"
--database-url, -d
: Database connection URL (required)--max-connections
: Maximum number of connections (default: 10)--timeout
: Connection timeout in seconds (default: 30)--log-level
: Log level (default: info)
- SQLite:
sqlite://path/to/database.db
- MySQL:
mysql://user:password@host:port/database
- PostgreSQL:
postgres://user:password@host:port/database
- MSSQL:
mssql://user:password@host:port/database
- sql_query: Execute SQL queries (SELECT statements)
- sql_exec: Execute SQL modifications (INSERT/UPDATE/DELETE)
- db_status: Get database connection pool status
Apache-2.0