JDBC Explorer
A server that enables LLMs to connect and interact with databases via JDBC, built using the Spring AI MCP framework.
JDBC Explorer
A Model Context Protocol server for connecting LLM to databases via JDBC. This server is implemented using the Spring AI MCP framework. The server exposes tools, a prompt and resources to interact with the connected database.
Tools 🛠
The server contains the following tools.
-
addBusinessInsight
- Adds business insights discovered during data analysis to the "Business Insights" resource. Usually executed as part of the prompt "data-explorer"
- Inputs:
insight(String): business insight discovered during data analysis
-
executeQuery
- Executes a SQL query against the connected database, returning the results
- Inputs:
query(string): the SQL query to be executed
-
getTableNames
- Gets the table names, including type, schema, and remarks
- Inputs: none
-
describeTable
- Describe a table in the database including column information, primary keys, foreign keys, and indexes.
- Inputs:
catalog(string, optional): Catalog Nameschema(string, optional): Schema NametableName(string): Name of the table to get description for
-
getDatabaseInfo
- Get information about the database including SQL dialect, keywords, database product name, etc.
- Inputs: none
Prompts 📄
The server contains 1 prompt.
- data-explorer
This prompt helps the user explore the data in their databases. It should present the user with a choice of dashboards that the LLM can create. The LLM will then execute the necessary queries and create the selected dashboard using an artifact.
The prompt result in Claude Desktop
Resources 🗂️
The server contains 1 resource.
-
Business Insights
- Contains the list of business insights that the LLM came up with during data analysis.
uri: "memo://insights"
Supported JDBC variants
This server currently supports the following databases.
| Database |
|---|
| sqlite |
| PostgreSQL |
| Oracle |
| h2 |
| MySQL |
Example Databases
Netflix Movies
Sample movie data based on Netflix catalog Netflix sample DB
Northwind
Classic Microsoft sample database with customers, orders, products etc.
Chinook
Sample music store data including artists, albums, tracks, invoices etc.
Usage with Claude Desktop
From jar
- Download the jar from the Releases
- Or clone the repo and build the jar with maven
mvn clean package
Add this to your claude_desktop_config.json:
Sqlite
{
"mcpServers": {
"jdbc-explorer": {
"command": "java",
"args": [
"-jar",
"C:\\\\mcp\\\\jdbc.explorer-0.4.0.jar",
"--db.url=jdbc:sqlite:C:\\\\mcp\\\\jdbc-explorer\\\\netflixdb.sqlite"
]
}
}
}
Database with username and password
{
"mcpServers": {
"jdbc-explorer": {
"command": "java",
"args": [
"-jar",
"C:\\\\mcp\\\\jdbc.explorer-0.4.0.jar",
"--db.url=jdbc:postgresql://localhost:5432/chinook",
"--db.username=dbuser",
"--db.password=dbpassword"
]
}
}
}
From Docker image
You can either build the image locally or pull it from GitHub Container Registry:
Option 1: Pull from GitHub Container Registry
docker pull ghcr.io/mikechao/jdbc-explorer:latest
Option 2: Build locally
- Clone the repo
- Build the docker image
docker build -t jdbc-explorer .
Add this to your claude_desktop_config.json:
Database with username and password
{
"mcpServers": {
"jdbc-explorer": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DB_URL=jdbc:postgresql://host.docker.internal:5432/chinook",
"-e",
"DB_USERNAME=dbuser",
"-e",
"DB_PASSWORD=dbpassword",
"ghcr.io/mikechao/jdbc-explorer"
]
}
}
}
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Related Servers
Power BI MCP Servers
Integrate with Power BI using a local server for offline .pbix file analysis and an Azure server for querying live datasets.
CData EnterpriseDB MCP Server
A read-only MCP server by CData that enables LLMs to query live data from EnterpriseDB databases.
Pipedrive MCP Server by CData
A read-only MCP server for Pipedrive, enabling LLMs to query live data using the CData JDBC Driver.
SSI Stock Data MCP
Query Vietnam stock intraday data using the SSI FastConnect API.
CData Reckon Accounts Hosted
A read-only MCP server by CData that enables LLMs to query live data from Reckon Accounts Hosted. Requires a separate CData JDBC Driver.
PostgreSQL Multi-Schema
Provides read-only access to PostgreSQL databases with multi-schema support, allowing LLMs to inspect schemas and execute queries across different namespaces.
kintone
An MCP server for accessing and managing data on the kintone low-code platform.
OpenCTI MCP Server
Integrates with the OpenCTI platform to query and retrieve threat intelligence data.
Snowflake
Snowflake database integration with read/write capabilities and insight tracking
MCP JDBC Server
A lightweight MCP server for any database with a JDBC driver. Built with Quarkus and requires Java 21+.