- Home
- MCP servers
- OpenLink MCP Server for ODBC
OpenLink MCP Server for ODBC
- typescript
10
GitHub Stars
typescript
Language
4 months ago
First Indexed
3 weeks 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-odbc-server": {
"command": "/path/to/.nvm/versions/node/v21.1.0/bin/node",
"args": [
"/path/to/mcp-odbc-server/node_modules/.bin/tsx",
"/path/to/mcp-odbc-server/src/main.ts"
],
"env": {
"PATH": "~/.nvm/versions/node/v21.1.0/bin:${PATH}",
"API_KEY": "none",
"ODBCINI": "/Library/ODBC/odbc.ini",
"ODBC_DSN": "Local Virtuoso",
"ODBC_USER": "dba",
"NODE_VERSION": "v21.1.0",
"ODBC_PASSWORD": "dba"
}
}
}
}You can expose ODBC-connected data sources to large language models through this MCP server. It acts as a lightweight TypeScript layer on top of the local ODBC driver manager, enabling your MCP-enabled clients to discover schemas, list tables, describe structures, and run SQL or SPARQL-like queries with results returned in JSON, JSONL, or Markdown formats.
How to use
Use with MCP clients to perform common data-access tasks against any ODBC data source you have configured. You can discover available schemas, inspect tables, filter table names by a substring, and run queries that return results in JSON, JSONL, or Markdown formats. Virtuoso SPASQL and SPARQL features are supported for applicable data sources. When you need AI-assisted queries or data retrieval, you can leverage the Virtuoso AI features for interactive prompts.
Typical usage patterns include: setting up a DSN for your database, starting the MCP server process, and using an MCP client to call tools such as get_schemas, get_tables, describe_table, and query_database. You can also route SPASQL/SPARQL queries through the corresponding tools when supported by your data source. Ensure your environment variables define the DSN, user, and password to establish secure connections.
How to install
# Prerequisites
# Ensure you have nvm and Node.js 21.1.0 or newer
nvm install v21.1.0
nvm alias default 21.1.0
# Install MCP components
npm install @modelcontextprotocol/sdk zod tsx odbc dotenv
# Clone the MCP ODBC server project
git clone https://github.com/OpenLinkSoftware/mcp-odbc-server.git
cd mcp-odbc-server
# Initialize and install dependencies
npm init -y
npm install @modelcontextprotocol/sdk zod tsx odbc dotenv
# Check unixODBC runtime details (optional)
odbcinst -j
odbcinst -q -s
# Prepare environment variables in a .env file
# Put in the same directory as the MCP server
API_KEY=sk-xxx
ODBC_DSN=Local Virtuoso
ODBC_USER=dba
ODBC_PASSWORD=dba
ODBCINI=/Library/ODBC/odbc.ini
# Start the MCP server (example runtime shown in configuration snippets below)
# This depends on your chosen startup method. See configuration examples for stdio vs http usage.
Additional sections
Configuration and runtime details are described in the configuration examples that accompany this server. The server is a TypeScript layer built atop node-odbc, using the local ODBC Driver Manager to communicate with your DSNs. It exposes a set of tools that mirror common database operations so your MCP clients can interact with your data sources. Security best practices include securing the DSN, user credentials, and any API keys, and using environment variables or a secrets manager to avoid hard-coding credentials.
Troubleshooting tips include ensuring you are running a compatible Node.js version (21.1.0 or newer), verifying that unixODBC is ARM64-compatible on Apple Silicon if you are on that platform, and confirming that the DSN, user, and password are correctly set in your environment. If you encounter architecture-related errors, verify process architecture via node -p "process.arch" and confirm the odbc.node binary matches your system architecture. Rebuild the ODBC module from source if needed, and confirm the correct unixODBC installation was used.
Notes on usage include that the server supports a comprehensive set of tools for schema discovery, table listing, table description, and various query formats. When you configure your MCP client, prefer the http method for remote servers if a URL is provided, or use the local stdio approach when running the server directly on your machine. The environment variables you typically configure include ODBC_DSN, ODBC_USER, ODBC_PASSWORD, ODBCINI, and optionally API_KEY for AI-assisted features.
MCP server configuration and environment
{
"mcpServers": {
"odbc_mcp": {
"type": "stdio",
"name": "odbc_mcp",
"command": "/path/to/.nvm/versions/node/v21.1.0/bin/node",
"args": [
"/path/to/mcp-odbc-server/node_modules/.bin/tsx",
"/path/to/mcp-odbc-server/src/main.ts"
],
"env": {
"ODBCINI": "/Library/ODBC/odbc.ini",
"NODE_VERSION": "v21.1.0",
"PATH": "~/.nvm/versions/node/v21.1.0/bin:${PATH}"
},
"disabled": false,
"autoApprove": []
}
}
}
# Environment variable examples used by the server
ODBCINI=/Library/ODBC/odbc.ini
ODBC_DSN=Local Virtuoso
ODBC_USER=dba
ODBC_PASSWORD=dba
API_KEY=your-api-key-if-used
Tools and capabilities
The MCP server provides a set of tools you can call from your MCP client: get_schemas, get_tables, describe_table, filter_table_names, query_database, query_database_md, query_database_jsonl, spasql_query, sparql_query, and virtuoso_support_ai. Each tool returns data in a structured form suitable for downstream processing or direct display.
Available tools
get_schemas
List all accessible database schemas from the connected DBMS.
get_tables
List tables within a specified or default schema, with basic table metadata.
describe_table
Provide detailed information about a table's columns, including data types and constraints.
filter_table_names
Return tables whose names contain a given substring within a schema.
query_database
Execute a SQL query and return results in JSON format.
query_database_md
Execute a SQL query and return results formatted as Markdown.
query_database_jsonl
Execute a SQL query and return results in JSON Lines (JSONL) format.
spasql_query
Execute a SPASQL query (Virtuoso-specific) and return results.
sparql_query
Execute a SPARQL query and return results in the requested format.
virtuoso_support_ai
Invoke Virtuoso-specific AI Assistant to process prompts with an optional API key.