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 directly with databases through Java Database Connectivity (JDBC). It allows models to inspect, query, create, and modify database content with simple commands. This connector supports a wide range of databases including PostgreSQL, Oracle, MariaDB, SQLite, and many others, making it a versatile tool for database operations through natural language.
The JDBC Database Connector is a Model Context Protocol (MCP) server that enables LLMs to interact with databases through JDBC connections. This powerful tool allows models to perform database operations including querying data, modifying tables, and exploring database schemas through natural language.
Add the following configuration to your MCP client's configuration file (e.g., claude_desktop_config.json
or server_config.json
):
{
"mcpServers": {
"jdbc": {
"command": "jbang",
"args": [
"jdbc@quarkiverse/quarkus-mcp-servers",
"jdbc:h2:mem:testdb"
]
}
}
}
You can replace jdbc:h2:mem:testdb
with your own JDBC connection URL to connect to different databases.
jbang jdbc@quarkiverse/quarkus-mcp-servers
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:postgresql://localhost:5432/mydb -u username -p password
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:oracle:thin:@localhost:1521:orcl
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:sqlite:path/to/database.sqlite
The connector can download and use sample databases directly from the web using the %{url}
syntax:
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:sqlite:%{https://github.com/lerocha/chinook-database/raw/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite}
jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:sqlite:%{https://github.com/jpwhite3/northwind-SQLite3/raw/refs/heads/main/dist/northwind.db}
The connector supports many popular database systems including:
If you encounter issues:
JBang not found: Ensure JBang is installed and in your PATH, or use the full path to the JBang executable.
Enable detailed 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
Database connection issues: Verify your JDBC URL, username, and password are correct.
Missing JDBC driver: The connector automatically downloads the appropriate JDBC driver for your database type.