MCP Server ODBC via SQLAlchemy
About
An MCP server for connecting to any ODBC-compliant database via SQLAlchemy, supporting various DBMS backends.
Details
- License
- MIT
Explore
- 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: In the case of Virtuoso, execute stored procedures and retrieve results.
- Execute Queries:
- JSONL result format: Optimized for structured responses.
- Markdown table format: Ideal for reporting and visualization.
---
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Server ODBC via SQLAlchemyCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
1. Install uv:
pip install uv
Or use Homebrew:
brew install uv
2. unixODBC Runtime Environment Checks:
1. Check installation configuration (i.e., location of key INI files) by running: odbcinst -j
2. List available data source names by running: odbcinst -q -s
3. ODBC DSN Setup: Configure your ODBC Data Source Name (~/.odbc.ini) for the target database. Example for Virtuoso DBMS:
[VOS]
Description = OpenLink Virtuoso
Driver = /path/to/virtodbcu_r.so
Database = Demo
Address = localhost:1111
WideAsUTF16 = Yes
3. SQLAlchemy URL Binding: Use the format:
virtuoso+pyodbc://user:password@VOS
---
Update your .envby overriding the defaults to match your preferences
ODBC_DSN=VOS
ODBC_USER=dba
ODBC_PASSWORD=dba
API_KEY=xxx
---
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp server odbc via sqlalchemy": {
"my_database": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-sqlalchemy-server",
"run",
"mcp-sqlalchemy-server"
],
"env": {
"DB_URL": "virtuoso+pyodbc://user:password@VOS"
}
}
}
}
}
McpServers
{
"my_database": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-sqlalchemy-server",
"run",
"mcp-sqlalchemy-server"
],
"env": {
"DB_URL": "virtuoso+pyodbc://user:password@VOS"
}
}
}
A lightweight MCP (Model Context Protocol) server for ODBC built with FastAPI, pyodbc, and SQLAlchemy. This server is compatible with Virtuoso DBMS and other DBMS backends that implement a SQLAlchemy provider.

---
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: In the case of Virtuoso, execute stored procedures and retrieve results.
- Execute Queries:
- JSONL result format: Optimized for structured responses.
- Markdown table format: Ideal for reporting and visualization.
---
Prerequisites
1. Install uv:
pip install uv
Or use Homebrew:
brew install uv
2. unixODBC Runtime Environment Checks:
1. Check installation configuration (i.e., location of key INI files) by running: odbcinst -j
2. List available data source names by running: odbcinst -q -s
3. ODBC DSN Setup: Configure your ODBC Data Source Name (~/.odbc.ini) for the target database. Example for Virtuoso DBMS:
[VOS]
Description = OpenLink Virtuoso
Driver = /path/to/virtodbcu_r.so
Database = Demo
Address = localhost:1111
WideAsUTF16 = Yes
3. SQLAlchemy URL Binding: Use the format:
virtuoso+pyodbc://user:password@VOS
---
Installation
Clone this repository:
git clone https://github.com/OpenLinkSoftware/mcp-sqlalchemy-server.git
cd mcp-sqlalchemy-server
Environment Variables
Update your
.envby overriding the defaults to match your preferencesODBC_DSN=VOS
ODBC_USER=dba
ODBC_PASSWORD=dba
API_KEY=xxx
---
Configuration
For Claude Desktop users:
Add the following to claude_desktop_config.json:
{
"mcpServers": {
"my_database": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-sqlalchemy-server", "run", "mcp-sqlalchemy-server"],
"env": {
"ODBC_DSN": "dsn_name",
"ODBC_USER": "username",
"ODBC_PASSWORD": "password",
"API_KEY": "sk-xxx"
}
}
}
}
---
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



