MCP Server ODBC via SQLAlchemy
A simple MCP ODBC server using FastAPI, ODBC and SQLAlchemy.
Overview
The mcp-server-odbc is a simple ODBC server built using FastAPI, ODBC, and SQLAlchemy, designed to work with SQLAlchemy-compatible databases, particularly tested with Virtuoso DBMS.
To use mcp-server-odbc, clone the repository from GitHub, set up your ODBC Data Source Name (DSN), and configure it in your application. You can then run the server and execute SQL queries through it.
- Retrieve schema names from the connected database. - Get detailed information about tables and their definitions. - Execute SQL queries and return results in JSONL or Markdown table format. - Filter table names based on a substring.
- Connecting to various SQL databases using ODBC.
- Executing complex SQL queries and retrieving results programmatically.
- Integrating with applications that require database access through a RESTful API.
Add to your AI client
Use these steps to connect MCP Server ODBC via SQLAlchemy in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-server-odbc-openlinksoftware": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-server-odbc-openlinksoftware": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-server-odbc-openlinksoftware": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-server-odbc-openlinksoftware": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-server-odbc-openlinksoftware": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-server-odbc-openlinksoftware": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-odbc-openlinksoftware"
]
}
}
}FAQ
What databases can mcp-server-odbc connect to?
It can connect to any SQLAlchemy-compatible database, including Virtuoso, PostgreSQL, MySQL, and SQLite.
Is there a specific ODBC driver required?
Yes, you need to use the OpenLink Virtuoso ODBC driver or any other compatible driver for your database.
How do I install mcp-server-odbc?
You can install it by cloning the repository from GitHub and following the setup instructions provided in the documentation.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3844,"uuid":"9a9b8636-8bee-415f-ba13-630606a1c90b","name":"mcp-server-odbc","title":"MCP Server ODBC via SQLAlchemy","description":"A simple MCP ODBC server using FastAPI, ODBC and SQLAlchemy.","avatar_url":"https://avatars.githubusercontent.com/u/30477123?v=4","created_at":"2025-03-22T02:34:03.752Z","updated_at":"2025-03-22T02:45:37.030Z","status":"created","author_name":"OpenLinkSoftware","author_avatar_url":"https://avatars.githubusercontent.com/u/30477123?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/OpenLinkSoftware/mcp-server-odbc","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"2\",\"license\":\"Apache-2.0 license\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-23 23:54:01\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]