JDBC MCP Server for MySQL, PostgreSQL, Oracle
Connect any JDBC database with the MCP server to query, insert, update, delete and manage MySQL, PostgreSQL, Oracle, SQL Server, SQLite.
Overview
The JDBC MCP Server provides a bridge between the Model Context Protocol (MCP) and any JDBC-compatible relational database. It exposes a set of standardized tools that let MCP-enabled clients (for example LLM-based assistants or orchestration systems) run queries, perform mutations, introspect schemas, and manage transactions on databases such as MySQL, PostgreSQL, Oracle, SQL Server, and SQLite.
This server is useful when you want to safely allow programmatic or AI-driven access to relational data without building custom endpoints for each action. By reusing the JDBC driver ecosystem, the server works with most commercial and open-source databases while delegating authentication, connection pooling, and driver-specific behavior to the established JDBC stack.
Features
- Connect to any JDBC-compatible database (MySQL, PostgreSQL, Oracle, SQL Server, SQLite, etc.)
- Execute read queries (SELECT) and write statements (INSERT, UPDATE, DELETE)
- Schema introspection: list catalogs, schemas, tables, columns, indexes
- Transaction support (begin/commit/rollback) to enable safe multi-step operations
- Explain/plan support (where supported by the database)
- Support for vendor JDBC drivers and connection pooling via Quarkus Datasources
- Configurable access controls and timeouts (via Quarkus configuration)
- Logs and audit-friendly execution metadata
Installation / Configuration
Note: the repository contains the JDBC MCP Server module at https://github.com/quarkiverse/quarkus-mcp-servers/tree/main/jdbc. Use the coordinates listed in that repo or build the module locally. The examples below show typical Quarkus project configuration patterns.
- Add the JDBC MCP extension and your JDBC driver to your build.
Maven (replace group/artifact/version with the artifact coordinates from the repo):
io.quarkiverse.quarkus-mcp-servers
quarkus-mcp-servers-jdbc
REPLACE_WITH_VERSION
<!-- Example: MySQL driver -->
mysql
mysql-connector-java
8.0.x
Gradle (Groovy DSL):
implementation 'io.quarkiverse.quarkus-mcp-servers:quarkus-mcp-servers-jdbc:REPLACE_WITH_VERSION'
implementation 'org.postgresql:postgresql:42.5.0' // example driver
- Configure the datasource and MCP server in application.properties (or application.yml).
Example application.properties for MySQL:
# Quarkus datasource (adjust db-kind and URL for your DB)
# MCP server configuration (example entries; confirm exact keys in the module README)
Notes:
- For Oracle or SQL Server you must include the vendor driver jar (often not available from Maven Central or requiring licenses).
- For SQLite add the sqlite-jdbc driver and a file or in-memory URL (jdbc:sqlite:/path/to/file).
- Verify the exact configuration keys from the module README or javadoc in the repository — keys above are illustrative and follow typical Quarkus patterns.
- Run the Quarkus application:
# or build and run
Available Tools / Resources
The JDBC MCP Server typically exposes the following tools through MCP:
- Query Tool: run SELECT statements and return tabular results (rows, columns, types).
- Execute Tool: run DML (INSERT/UPDATE/DELETE) and return affected row counts and generated keys.
- Introspection Tool: list catalogs, schemas, tables, columns and basic metadata (types, nullability, PK/FK).
- Transaction Tool: begin, commit and rollback multi-statement operations.
- Explain Tool: request query plans or execution explanations (where supported).
- Schema Tool: run DDL operations and optionally apply or reverse migrations (subject to permissions).
Resources:
- Source and examples: https://github.com/quarkiverse/quarkus-mcp-servers/tree/main/jdbc
- Include appropriate JDBC drivers (MySQL, PostgreSQL, Oracle, SQL Server, SQLite) in your runtime classpath.
Use Cases
- Ad-hoc analytics via an LLM assistant
- Scenario: a data analyst asks an MCP-enabled assistant for the top 10 products by revenue.
- Action: assistant uses Query Tool with: SELECT product_id, SUM(amount) as revenue FROM sales GROUP BY product_id ORDER BY revenue DESC LIMIT 10;
- Safe data updates with transactional safety
- Scenario: an automated workflow needs to move or transform rows and must rollback on error.
- Action: use Transaction Tool to begin a transaction, Execute Tool for UPDATE/INSERT, and commit or rollback depending on validation.
- Schema discovery for integration
- Scenario: a third-party integration requires