MCP Server ODBC via SQLAlchemy logo

MCP Server ODBC via SQLAlchemy

by OpenLinkSoftware

A lightweight MCP 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.

View on GitHub

Last updated: N/A

What is MCP Server ODBC via SQLAlchemy?

This is a lightweight MCP (Model Context Protocol) server designed to interact with ODBC-compliant databases using SQLAlchemy. It provides a standardized way to access and manipulate data across various database systems.

How to use MCP Server ODBC via SQLAlchemy?

To use this server, you need to configure your ODBC Data Source Name (DSN), install the necessary dependencies (uv), set up environment variables for database credentials, and then run the server. You can then interact with the server's API endpoints to fetch schemas, tables, execute queries, and more.

Key features of MCP Server ODBC via SQLAlchemy

  • 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.

  • Search Tables: Filter and retrieve tables based on name substrings.

  • Execute Stored Procedures: Execute stored procedures and retrieve results (Virtuoso).

  • Execute Queries: Execute SQL queries and retrieve results in JSONL or Markdown table format.

Use cases of MCP Server ODBC via SQLAlchemy

  • Integrating database access into applications using the Model Context Protocol.

  • Providing a standardized interface for interacting with different database systems.

  • Generating reports and visualizations from database data.

  • Executing stored procedures and queries against a database.

  • Interacting with Virtuoso's AI support features.

FAQ from MCP Server ODBC via SQLAlchemy

What databases are supported?

The server supports any database with a SQLAlchemy provider and ODBC driver, including Virtuoso, PostgreSQL, MySQL, and SQLite.

How do I configure the database connection?

You need to configure an ODBC DSN and set the ODBC_DSN, ODBC_USER, and ODBC_PASSWORD environment variables.

What is the purpose of the API_KEY environment variable?

The API_KEY is used for authentication and authorization to access the server's API endpoints.

What result formats are supported for queries?

The server supports JSONL (JSON Lines) and Markdown table formats for query results.

How do I troubleshoot issues with the server?

You can use the MCP Inspector tool to troubleshoot server interactions and debug any problems.