Back to MCP Catalog

JDBC Database Connector MCP Server

DatabasesJava
Connect to and manipulate databases through JDBC connections
Available Tools

read_query

Execute a SELECT query on the database

write_query

Execute an INSERT, UPDATE, or DELETE query on the database

create_table

Create a new table in the database

list_tables

List all tables in the database

describe_table

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.

Overview

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.

Installation

To use the JDBC Database Connector, you'll need to:

  1. Install JBang on your system
  2. Configure your MCP client to run the server

Installing JBang

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.

Client Configuration

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.

Usage

Connecting to Databases

The connector supports various connection methods:

In-memory Database (H2)

For testing or simple use cases, you can use an in-memory H2 database:

jbang jdbc@quarkiverse/quarkus-mcp-servers

Live Database Connection

Connect to any JDBC-compatible database by specifying the JDBC URL:

jbang jdbc@quarkiverse/quarkus-mcp-servers [jdbc_url]

Examples:

  • Oracle: jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:oracle:thin:@localhost:1521:orcl
  • PostgreSQL: jbang jdbc@quarkiverse/quarkus-mcp-servers jdbc:postgresql://localhost:5432/sakila -u sakila -p p_ssW0rd

Sample Databases

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:

  • Northwind: jdbc:sqlite:%{https://github.com/jpwhite3/northwind-SQLite3/raw/refs/heads/main/dist/northwind.db}
  • Netflix Movies: jdbc:sqlite:%{https://github.com/lerocha/netflixdb/releases/download/v1.0.0/netflixdb.sqlite}

Supported Databases

The connector supports many database systems including:

  • MariaDB
  • MySQL
  • PostgreSQL
  • Oracle
  • SQL Server
  • SAP DB
  • Informix
  • Firebird
  • HSQLDB
  • H2
  • Apache Derby
  • SQLite

The appropriate JDBC driver is automatically downloaded and configured.

Troubleshooting

If you encounter issues:

  1. Ensure JBang is properly installed and available in your PATH
  2. For more detailed logging, add these parameters:
    -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

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.