Overview
What is rdb-mcp-server?
rdb-mcp-server is an experimental MCP server built on Spring AI that provides low-level SQL operations over JDBC. It uses stdio as the transport mechanism and supports MySQL, PostgreSQL, and SQLite databases. It is intended for developers who need to execute SQL queries through an MCP client.
How to use rdb-mcp-server?
Download the JAR from the GitHub releases page, set required environment variables (DB_URL, DB_USER, DB_PASSWORD), and run it with java -jar x.x.x.jar. Then configure your MCP client (Cline or Cursor) to launch the JAR with the appropriate environment variables.
Key features of rdb-mcp-server
- Executes read-only SQL queries via the
executeQuerytool (no authentication required) - Executes raw SQL statements via the
executeRawSqltool (requires password for writes) - Executes parameterized SQL using
PreparedStatementvia theexecutePreparedSqltool - Supports MySQL, PostgreSQL, and SQLite databases
- Configurable via environment variables (
DB_URL,DB_USER,DB_PASSWORD,API_PASSWORD,LOG_FILE) - Requires Java 17 or later
Use cases of rdb-mcp-server
- Running read-only SQL queries against a database from an MCP client
- Executing parameterized SQL statements safely with
PreparedStatement - Performing raw SQL operations (including writes) with password-protected access
- Integrating database access into AI-assisted coding workflows (Cline, Cursor)
FAQ from rdb-mcp-server
What databases does rdb-mcp-server support?
MySQL, PostgreSQL, and SQLite.
What are the runtime requirements?
Java 17 or later.
How do I configure the database connection?
Set the DB_URL, DB_USER, and DB_PASSWORD environment variables. The default URL is jdbc:sqlite:./sqlite.db.
Is authentication required to use the tools?
The executeQuery tool requires no authentication. The executeRawSql tool requires a password (set via API_PASSWORD) for non-read-only operations.
What transport mechanism does rdb-mcp-server use?
It uses stdio as the transport.