MCP Server ODBC via SQLAlchemy
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
Install uv:
pip install uvOr use Homebrew:
brew install uvunixODBC Runtime Environment Checks:
Check installation configuration (i.e., location of key INI files) by running:
odbcinst -jList available data source names by running:
odbcinst -q -sODBC 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 = YesSQLAlchemy URL Binding: Use the format:
virtuoso+pyodbc://user:password@VOS






