Back to catalog
OpenLink Generic SQLAlchemy Object-Relational Database Connectivity for PyODBC MCP Server
A lightweight MCP server that provides connectivity to ODBC databases through SQLAlchemy and pyodbc, compatible with Virtuoso DBMS and other database backends with SQLAlchemy providers.
Get this MCP server
A lightweight MCP server that provides connectivity to ODBC databases through SQLAlchemy and pyodbc, compatible with Virtuoso DBMS and other database backends with SQLAlchemy providers.
Installation
From Source
git clone https://github.com/OpenLinkSoftware/mcp-sqlalchemy-server.git
cd mcp-sqlalchemy-server
Prerequisites
pip install uv
# or
brew install uv
Configuration
Claude Desktop
{
"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"
}
}
}
}
Available Tools
| Tool | Description |
|---|---|
podbc_get_schemas |
Get a list of database schemas available for the connected database management system (DBMS) |
podbc_get_tables |
Get a list of tables associated with the selected database schema |
podbc_describe_table |
Provide a table description, including column names, data types, NULL handling, auto-increment... |
podbc_filter_table_names |
Get a list of tables matching a substring pattern associated with the selected database schema |
podbc_query_database |
Execute a SQL query and return results in JSONL format |
podbc_execute_query |
Execute a SQL query and return results in JSONL format |
podbc_execute_query_md |
Execute a SQL query and return results in Markdown table format |
podbc_spasql_query |
Execute a SPASQL query and return results |
podbc_sparql_query |
Execute a SPARQL query and return results |
podbc_virtuoso_support_ai |
Interact with Virtuoso support assistant/agent -- Virtuoso-specific interaction function... |
Features
- Schema retrieval: fetch and display all schema names from the connected database
- Table retrieval: extract table information for specific schemas or all schemas
- Table description: generate detailed descriptions of table structures with column names, data types, nullable attributes, primary and foreign keys
- Table search: filter and retrieve tables based on name substrings
- Stored procedure execution: in the case of Virtuoso, execute stored procedures and retrieve results
- Query execution: JSONL results format, optimized for structured responses
- Query execution: Markdown table format, ideal for reporting and visualization
- Multi-database system support: Virtuoso, PostgreSQL, MySQL, SQLite
- SPARQL and SPASQL query support for Virtuoso
- Integration with Virtuoso AI support assistant
Environment Variables
Required
ODBC_DSN- ODBC data source nameODBC_USER- database usernameODBC_PASSWORD- database password
Optional
API_KEY- API key for AI services
Notes
Requires ODBC DSN configuration in ~/.odbc.ini and unixODBC runtime environment. Supports multiple database connection formats, including virtuoso+pyodbc://user:password@ODBC_DSN, postgresql://, mysql+pymysql://, and sqlite:///. For troubleshooting, install MCP Inspector using the command 'npm install -g @modelcontextprotocol/inspector'.
