SuperAPI AI Directory

mcp-odbc-server

Generic database (DBMS) connectivity via ODBC.

Open website

About this tool

mcp-odbc-server is a TypeScript-based Model Context Protocol (MCP) server developed by OpenLinkSoftware, designed to provide large language models (LLMs) with transparent access to ODBC-accessible data sources. It connects to databases configured with a specific ODBC connector (i.e., ODBC driver) through a Data Source Name (DSN). The server is built on top of node-odbc, which is a small TypeScript layer that routes calls to the host system's native ODBC driver manager through node.js (running TypeScript with npx).

Main Capabilities The server provides a set of tools for use by MCP client applications, including:

  • get_schemas: Get a list of all schema names in the connected database.
  • get_tables: Get a list of information about tables in the specified schema.
  • filter_table_names: Filter and return table information based on a substring in the table name.
  • describe_table: Get detailed column information for a specific table.
  • query_database: Execute a standard SQL query and return results in JSON format.
  • query_database_md: Execute a SQL query and return results in Markdown table format.
  • query_database_jsonl: Execute a SQL query and return results in JSON Lines (JSONL) format.
  • spasql_query: Execute a SPASQL (SQL/SPARQL hybrid) query (Virtuoso-specific).
  • sparql_query: Execute a SPARQL query (Virtuoso-specific).
  • virtuoso_support_ai: Use Virtuoso-specific AI assistant functionality, passing a prompt and an optional API key (Virtuoso-specific).

Usage The runtime environment must be set up before use. First check the node.js version; if it is lower than 21.1.0, it must be upgraded or installed:nvm install v21.1.0. Then install the MCP component:npm install @modelcontextprotocol/sdk zod tsx odbc dotenv. Set the default nvm version:nvm alias default 21.1.0. Clone the repository:git clone https://github.com/OpenLinkSoftware/mcp-odbc-server.git, enter the directory:cd mcp-odbc-server, run npm init -y, then install dependencies again:npm install @modelcontextprotocol/sdk zod tsx odbc dotenv.

For a unixODBC runtime environment, check the installation configuration:odbcinst -j, list the available data source names:odbcinst -q -s.

Environment variables should be set in a .env file in the same directory as mcp-server, including ODBC_DSN, ODBC_USER, ODBC_PWD, ODBCINI, and an optional API_KEY (for using OpenLink AI Layer (OPAL) through ODBC).

Applicable Scenarios It is suitable for scenarios where large language models need to access ODBC data sources through the MCP protocol, for example, integrating database query capabilities into AI applications. The examples are mainly aimed at the Virtuoso ODBC connector, but the guide is also applicable to other ODBC connectors. The project encourages contributions of code and demonstrations for other database management systems.

Limitations The documentation does not provide specific compatibility notes for other database management systems, so users must verify this themselves. In addition, the SPASQL, SPARQL, and virtuoso_support_ai tools are Virtuoso-specific features and may not be available on other databases. Detailed installation testing and troubleshooting for the project can refer to the MCP Inspector tool, but the documentation does not provide complete step-by-step instructions.