---
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
OpenLink MCP Server for JDBC
A lightweight Java-based MCP (Model Context Protocol) server for JDBC built with **Quakrus**.
This server is compatible with Virtuoso DBMS and any other DBMS backend that has a JDBC driver.
---
Features
- **Get Schemas**: Fetch and list all schema names from the connected database.
- **Get Tables**: Retrieve table information for specific schemas or all schemas.
- **Describe Table**: Generate a detailed description of table structures, including:
- Column names and data types
- Nullable attributes
- Primary and foreign keys
- **Search Tables**: Filter and retrieve tables based on name substrings.
- **Execute Stored Procedures**: _A Virtuoso-specific feature!_ Execute stored procedures and retrieve results.
- **Execute Queries**:
- JSONL result format: Optimized for structured responses.
- Markdown table format: Ideal for reporting and visualization.
---
Prerequisites
MCP server requires Java 21 or above.
---
Installation
Clone this repository:
Environment Variables
Update your .env by overriding these defaults to match your preferences:
---
Configuration
For **Claude Desktop** users using Virtuoso and its JDBC driver:
Add the following to claude_desktop_config.json:
For **Claude Desktop** users using another JDBC driver or a combination of drivers:
Add the following, edited to suit your local environment, to claude_desktop_config.json:
---
Use
Tools Provided
After successful installation, the following tools will be available to MCP client applications.
Overview
| name | description |
|:--- |:---|
|jdbc_get_schemas | List database schemas accessible to connected database management system (DBMS). |
|jdbc_get_tables | List tables associated with a selected database schema. |
|jdbc_describe_table | Provide the description of a table associated with a designated database schema. This includes information about column names, data types, nulls handling, autoincrement, primary key, and foreign keys. |
|jdbc_filter_table_names | List tables, based on a substring pattern from the q input field, associated with a selected database schema. |
|jdbc_query_database | Execute a SQL query and return results in JSONL format. |
|jdbc_execute_query | Execute a SQL query and return results in JSONL format. |
|jdbc_execute_query_md | Execute a SQL query and return results in Markdown table format. |
|jdbc_spasql_query | _A Virtuoso-specific feature!_ Execute a SPASQL query and return results. |
|jdbc_sparql_query | _A Virtuoso-specific feature!_ Execute a SPARQL query and return results. |
|jdbc_virtuoso_support_ai| _A Virtuoso-specific feature!_ Interact with LLMs through the Virtuoso Support Assistant/Agent. |
Detailed Description
- **jdbc_get_schemas**
- Retrieve and return a list of all schema names from the connected database.
- Input parameters:
- user (string, optional): Database username. Defaults to "demo".
- password (string, optional): Database password. Defaults to "demo".
- url (string, optional): JDBC URL connection string.
- Returns a JSON string array of schema names.
- **jdbc_get_tables**
- Retrieve and return a list containing information about tables in a specified schema. If no schema is provided, uses the connection's default schema.
- Input parameters:
- schema (string, optional): Database schema to filter tables. Defaults to connection default.
- user (string, optional): Database username. Defaults to "demo".
- password (string, optional): Database password. Defaults to "demo".
- url (string, optional): JDBC URL connection string.
- Returns a JSON string containing table information (e.g., TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE).
- **jdbc_filter_table_names**
- Filters and returns information about tables whose names contain a specific substring.