- Home
- MCP servers
- OpenLink MCP JDBC Server
OpenLink MCP JDBC Server
- java
11
GitHub Stars
java
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"openlinksoftware-mcp-jdbc-server": {
"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.api_key": "sk-xxx",
"jdbc.password": "password"
}
}
}
}You can run an MCP server for JDBC to securely access and query relational databases from MCP clients. This server connects via JDBC to backends such as Virtuoso and other JDBC-enabled DBMSs, exposing a set of MCP endpoints to discover schemas, list tables, describe structures, run queries, and even execute Virtuoso-specific SPARQL/SPASQL operations.
How to use
Use an MCP client to connect to the JDBC MCP server and call the exposed tools to explore your database and run queries. The server supports common actions like listing schemas and tables, describing a table’s columns, filtering tables by name, and executing SQL queries in JSONL or Markdown formats. Virtuoso-specific features such as SPASQL and SPARQL queries, as well as the Virtuoso AI assistant, are also available.
How to install
Prerequisites: Ensure you have Java 21 or higher installed on your system.
Clone the repository and navigate into the project directory.
Run the Java MCP server using the provided runner JAR. You will typically start the server with a command like this:
java -jar /path/to/mcp-jdbc-server/MCPServer-1.0.0-runner.jar
Additional configuration and runtime notes
The server reads JDBC connection details from environment variables. The following variables are used in examples and should be set when starting the server or provided to MCP client configurations.
{
"jdbc.url": "jdbc:virtuoso://localhost:1111",
"jdbc.user": "username",
"jdbc.password": "password",
"jdbc.api_key": "sk-xxx"
}
Claude Desktop specific configuration for Virtuoso JDBC
If you are using Claude Desktop with Virtuoso and its JDBC driver, add the following configuration to your Claude Desktop setup so the MCP server runs as a local Java process.
{
"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 with additional JDBC drivers
If you use Claude Desktop with another JDBC driver or multiple drivers, add an extended classpath configuration so all required drivers are available to the MCP server.
{
"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"
}
}
}
Troubleshooting with MCP Inspector
You can verify and troubleshoot MCP server interactions using the MCP Inspector. Install the inspector, then start it with the Java runner to inspect communications between the MCP client and the server.
npm install -g @modelcontextprotocol/inspector
Run the inspector against the MCP server
To connect the inspector to the local MCP server, start the inspector with the Java classpath including the MCP runner JAR and any JDBC driver JARs you need.
npx @modelcontextprotocol/inspector java -cp MCPServer-1.0.0-runner.jar:/path/to/driver1.jar:/path/to/driverN.jar io.quarkus.runner.GeneratedMain
Use example for querying
After the inspector starts, access the URL it returns and use the available MCP operations to run queries such as listing schemas, fetching tables, describing a table, or executing SQL queries in JSONL or Markdown formats.
Available tools
jdbc_get_schemas
Retrieve and return a list of all schema names from the connected database.
jdbc_get_tables
Retrieve and return a list of tables for a specified schema or the default schema.
jdbc_filter_table_names
Filter and return information about tables whose names contain a substring.
jdbc_describe_table
Return detailed information about the columns of a specific table.
jdbc_query_database
Execute a standard SQL query and return results in JSON format.
jdbc_query_database_md
Execute a standard SQL query and return results formatted as a Markdown table.
jdbc_query_database_jsonl
Execute a standard SQL query and return results in JSONL format.
jdbc_spasql_query
Execute a SPASQL query and return results (Virtuoso-specific).
jdbc_sparql_query
Execute a SPARQL query and return results (Virtuoso-specific).
jdbc_virtuoso_support_ai
Interact with Virtuoso Support AI to run prompt-based queries.