MCP Sqlalchemy Server MCP Server

A lightweight MCP (Model Context Protocol) server for ODBC built with **FastAPI**, **pyodbc**, and **SQLAlchemy**. This server is compatible with

Local serverstdio

What is the MCP Sqlalchemy Server MCP Server?

A lightweight MCP (Model Context Protocol) server for ODBC built with FastAPI, pyodbc, and SQLAlchemy. This server is compatible with Virtuoso DBMS and

What it actually does

  • 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

Configuration

  1. Install uv: Or use Homebrew: 2. unixODBC Runtime Environment Checks: 1. Check installation configuration (i.e., location of key INI files) by running: odbcinst -j 2. List available data source names by running: odbcinst -q -s 3. ODBC DSN Setup: Configure your ODBC Data Source Name (~/.odbc.ini) for the target database. Example for Virtuoso DBMS: 3. SQLAlchemy URL Binding

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
podbc_get_schemasList database schemas accessible to connected database management system (DBMS).
userstring, optional): Database username. Defaults to "demo".
passwordstring, optional): Database password. Defaults to "demo".
dsnstring, optional): ODBC data source name. Defaults to "Local Virtuoso".
podbc_get_tablesList tables associated with a selected database schema.
schemastring, required): The database schema name containing the table.
podbc_filter_table_namesList tables, based on a substring pattern from the q input field, associated with a selected database schema.
podbc_describe_tableProvide the description of a table associated with a designated database schema. This includes information about column names, data types, nulls handling, autoi
tablestring, required): The name of the table to describe.
podbc_query_databaseExecute a SQL query and return results in JSONL format.
querystring, required): The SPARQL query string.
podbc_query_database_mdExecute a standard SQL query and return the results formatted as a Markdown table.
podbc_query_database_jsonlExecute a standard SQL query and return the results in JSON Lines (JSONL) format (one JSON object per line).
podbc_spasql_queryExecute a SPASQL query and return results.
max_rowsnumber, optional): Maximum number of rows to return. Defaults to 20.
timeoutnumber, optional): Query timeout in milliseconds. Defaults to 30000.
podbc_sparql_queryExecute a SPARQL query and return results.
formatstring, optional): Desired result format. Defaults to 'json'.
podbc_virtuoso_support_aiInteract with the Virtuoso Support Assistant/Agent -- a Virtuoso-specific feature for interacting with LLMs
promptstring, required): The prompt text for the AI function.
api_keystring, optional): API key for the AI service. Defaults to "none".
podbc_execute_queryExecute a SQL query and return results in JSONL format.
podbc_execute_query_mdExecute a SQL query and return results in Markdown table format.

How to install the MCP Sqlalchemy Server MCP Server

{
  "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": "YOUR_ODBC_PASSWORD",
        "API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  1. Install uv: Or use Homebrew: 2. unixODBC Runtime Environment Checks: 1. Check installation configuration (i.e., location of key INI files) by running: odbcinst -j 2. List available data source names by running: odbcinst -q -s 3. ODBC DSN Setup: Configure your ODBC Data Source Name (~/.odbc.ini) for the target database. Example for Virtuoso DBMS: 3. SQLAlchemy URL Binding
VariableDescriptionRequired
ODBC_DSNDeclared in the maintainer’s client configuration.Check documentation
ODBC_USERDeclared in the maintainer’s client configuration.Check documentation
ODBC_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
API_KEYDeclared in the maintainer’s client configuration.Optional

Example prompts to try

  • “Use MCP Sqlalchemy Server to Overview.”

Frequently asked questions

A lightweight MCP (Model Context Protocol) server for ODBC built with **FastAPI**, **pyodbc**, and **SQLAlchemy**. This server is compatible with Virtuoso DBMS and Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.