Back to catalog
OpenLink Generic Java Database Connectivity MCP Server
A lightweight Java-based MCP server for JDBC that provides database connectivity and query execution capabilities, compatible with Virtuoso DBMS and any DBMS with a JDBC driver.
Get this MCP server
A lightweight Java-based MCP server for JDBC that provides database connectivity and query execution capabilities, compatible with Virtuoso DBMS and any DBMS with a JDBC driver.
Installation
From Source Code
git clone https://github.com/OpenLinkSoftware/mcp-jdbc-server.git
cd mcp-jdbc-server
MCP Inspector - Virtuoso
npm install -g @modelcontextprotocol/inspector
npx @modelcontextprotocol/inspector java -jar /path/to/mcp-jdbc-server/MCPServer-1.0.0-runner.jar
MCP Inspector - Additional Drivers
export CLASSPATH=$CLASSPATH:/path/to/driver1.jar:/path/to/driver2.jar:/path/to/driverN.jar
npx @modelcontextprotocol/inspector java -cp MCPServer-1.0.0-runner.jar:/path/to/driver1.jar:/path/to/driver2.jar:/path/to/driverN.jar io.quarkus.runner.GeneratedMain
Configuration
Claude Desktop - Virtuoso JDBC Driver
{
"mcpServers": {
"my_database": {
"command": "java",
"args": ["-jar", "/path/to/mcp-jdbc-server/MCPServer-1.0.0-runner.jar"],
"env": {
"jdbc.url": "jdbc:virtuoso://localhost:1111",
"jdbc.user": "username",
"jdbc.password": "password",
"jdbc.api_key": "sk-xxx"
}
}
}
}
Claude Desktop - Other JDBC Drivers
"jdbc": {
"command": "java",
"args": [
"-cp",
"/path/to/mcp-jdbc-server/MCPServer-1.0.0-runner.jar:/path/to/jdbc_driver1.jar:/path/to/jdbc_driverN.jar",
"io.quarkus.runner.GeneratedMain"
],
"env": {
"jdbc.url": "jdbc:virtuoso://localhost:1111",
"jdbc.user": "dba",
"jdbc.password": "dba"
}
}
Available Tools
| Tool | Description |
|---|---|
jdbc_get_schemas |
Get a list of database schemas available in the connected database management system (DBMS) |
jdbc_get_tables |
Get a list of tables associated with the selected database schema |
jdbc_describe_table |
Provide a detailed description of a table, including column names, data types, null handling, auto-increment... |
jdbc_filter_table_names |
Get a list of tables based on a substring pattern from the selected database schema |
jdbc_query_database |
Execute an SQL query and return results in JSONL format |
jdbc_execute_query |
Execute an SQL query and return results in JSONL format |
jdbc_execute_query_md |
Execute an SQL query and return results in Markdown table format |
jdbc_spasql_query |
Execute a SPASQL query and return results (Virtuoso-specific function) |
jdbc_sparql_query |
Execute a SPARQL query and return results (Virtuoso-specific function) |
jdbc_virtuoso_support_ai |
Interact with an LLM through Virtuoso Support Assistant/agent (Virtuoso-specific function) |
Features
- Schema Retrieval: Extract and list all schema names from the connected database
- Table Retrieval: Extract table information for specific schemas or all schemas
- Table Description: Generate detailed descriptions of table structures with column names, data types, nullable attributes, primary and foreign keys
- Table Search: Filter and retrieve tables based on name substrings
- Stored Procedure Execution: Execute stored procedures and retrieve results (Virtuoso-specific)
- Query Execution: Support for JSONL result format and Markdown table format
- SPARQL and SPASQL Query Execution (Virtuoso-specific)
- AI Assistant Integration through Virtuoso Support Assistant (Virtuoso-specific)
Environment Variables
Required
jdbc.url- JDBC connection URL stringjdbc.user- Database usernamejdbc.password- Database password
Optional
jdbc.api_key- API key for AI service functions
Notes
Requires Java 21 or higher. Built on the Quarkus framework. Supports any DBMS with a JDBC driver. Includes specialized features for Virtuoso DBMS, including SPARQL/SPASQL queries and AI assistant integration. For additional JDBC drivers, ensure that JAR files are registered in the JVM via $CLASSPATH.
