SuperAPIAI Directory

mcp-sqlalchemy-server

github.com · AI coding

Generic database (DBMS) connectivity via SQLAlchemy using pyodbc.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose

mcp-sqlalchemy-server is a lightweight MCP (Model Context Protocol) server used to connect to general-purpose database management systems (DBMS) via ODBC. It is built on FastAPI, pyodbc, and SQLAlchemy, and is compatible with Virtuoso DBMS as well as other database backends that implement SQLAlchemy providers.

Main Capabilities

The server provides the following tool capabilities:

  • Get Schemas (podbc_get_schemas): Retrieves and returns a list of all schema names in the connected database.
  • Get Tables (podbc_get_tables): Retrieves and returns a list of information about tables in the specified schema; if no schema is provided, the connection's default schema is used.
  • Describe Table (podbc_describe_table): Generates a detailed description of a specific table's structure, including column names and data types, nullability, primary keys, and foreign keys.
  • Search Tables (podbc_filter_table_names): Filters and retrieves tables based on a name substring.
  • Execute Queries (podbc_query_database / podbc_query_database_md / podbc_query_database_jsonl): Executes standard SQL queries, with results returnable as JSON, Markdown tables, or JSON Lines (JSONL) format.
  • Execute Stored Procedures: In Virtuoso scenarios, stored procedures can be executed and results retrieved.
  • Virtuoso-specific Features: Including podbc_spasql_query (executes SPASQL hybrid queries), podbc_sparql_query (executes SPARQL queries), and podbc_virtuoso_support_ai (calls Virtuoso-specific AI assistant functions).

Usage

  1. Install uv:pip install uv, or use Homebrew:brew install uv.
  2. Check the unixODBC runtime environment: run odbcinst -j to view the installation configuration (key INI file locations), run odbcinst -q -s to list available data source names.
  3. Configure the ODBC DSN: configure the ODBC data source name for the target database in ~/.odbc.ini .
  4. Bind the SQLAlchemy URL: use the format virtuoso+pyodbc://user:password@VOS.
  5. Clone the repository, and override the default values via .env to match your preferences.
  6. Claude Desktop users: add the corresponding configuration to claude_desktop_config.json.

Each tool supports specifying the database username (user, default "demo"), password (password, default "demo"), and ODBC data source name (dsn, default "Local Virtuoso") via parameters.

Applicable Scenarios

Suitable for scenarios where an AI assistant or client needs to access general-purpose ODBC databases via the MCP protocol, especially in Virtuoso DBMS environments, and can be used for database structure exploration, SQL query execution, formatted result output, as well as Virtuoso-specific SPARQL/SPASQL queries and AI assistant calls.

Limitations

  • This server is primarily aimed at DBMS backends that implement SQLAlchemy providers, and compatibility depends on the corresponding driver.
  • SPASQL, SPARQL, and AI assistant features are Virtuoso-specific features and are not applicable to other databases.
  • Information such as the specific list of supported databases, pricing, and platform requirements is not currently provided.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools