Execute a SELECT query on the database
Execute an INSERT, UPDATE, or DELETE query on the database
Create a new table in the database
List all tables in the database
Get detailed information about a specific table's structure
The JDBC Database Connector enables Large Language Models to interact with a wide range of databases through Java Database Connectivity (JDBC). It supports inspecting database schemas, executing queries, creating tables, and modifying data across multiple database systems including PostgreSQL, Oracle, MariaDB, SQLite, and many others. This connector provides a unified interface for AI assistants to work with structured data regardless of the underlying database technology.
The JDBC Database Connector provides a powerful interface for AI assistants to work with databases through standard JDBC connections. This connector enables models to inspect database schemas, execute SQL queries, create tables, and manipulate data across a wide variety of database systems.
To use the JDBC Database Connector, you'll need to:
JBang is a tool that makes it easy to run Java applications without complex setup. Visit jbang.dev/download and follow the installation instructions for your operating system.
Add the following configuration to your MCP client's configuration file:
For Claude Desktop, add this to your claude_desktop_config.json
:
{
"mcpServers": {
"jdbc": {
"command": "jbang",
"args": [
"jdbc@quarkiverse/quarkus-mcp-servers",
"jdbc:h2:mem:testdb"
]
}
}
}
For other MCP clients like mcp-cli, add similar configuration to your server_config.json
.
The connector supports various connection methods:
For testing or simple use cases, you can use an in-memory H2 database:
jbang jdbc@quarkiverse/quarkus-mcp-servers
Connect to any JDBC-compatible database by specifying the JDBC URL:
jbang jdbc@quarkiverse/quarkus-mcp-servers [jdbc_url]
Examples:
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:oracle:thin:@localhost:1521:orcl
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:postgresql://localhost:5432/sakila -u sakila -p p_ssW0rd
The connector can download and use sample databases directly:
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:sqlite:%{https://github.com/lerocha/chinook-database/raw/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite}
Other sample databases:
jdbc:sqlite:%{https://github.com/jpwhite3/northwind-SQLite3/raw/refs/heads/main/dist/northwind.db}
jdbc:sqlite:%{https://github.com/lerocha/netflixdb/releases/download/v1.0.0/netflixdb.sqlite}
The connector supports many database systems including:
The appropriate JDBC driver is automatically downloaded and configured.
If you encounter issues:
-Dquarkus.log.file.enable=true -Dquarkus.log.file.path=${user.home}/mcp-jdbc.log
Example with logging:
jbang -Dquarkus.log.file.enable=true -Dquarkus.log.file.path=${user.home}/mcp-jdbc.log jdbc@quarkiverse/quarkus-mcp-servers jdbc:h2:mem:testdb