
mcp-sqlalchemy-server
MCP server giving AI clients SQL, schema and SPARQL access to ODBC and SQLAlchemy
mcp-sqlalchemy-server is an open-source MCP server for databases. It is available on CLI, API, Self-hosted, Linux, macOS and Windows.
- Pricing
- Open source
- Platforms
- CLI, API, Self-hosted
- What it can do
- Can change data (2 tools)
- GitHub stars
- 25
- Last commit
Similar MCP servers
About mcp-sqlalchemy-server
This server lets an MCP-compatible AI client inspect and query relational databases reached through ODBC and SQLAlchemy. It is built on FastAPI, pyodbc and SQLAlchemy, and is aimed at Virtuoso but also documents connection URLs for PostgreSQL, MySQL and SQLite.
Once a data source name is configured under unixODBC, the server exposes tools to list schemas and tables, describe columns with types, nullability and keys, search table names by substring, and run SQL queries with results returned as JSON Lines or Markdown tables. Virtuoso-specific tools add SPARQL and SPASQL queries, stored procedure calls and access to the Virtuoso support assistant.
It suits developers and data teams who want an assistant to explore a database schema and run queries from a chat client such as Claude Desktop, with credentials supplied through environment variables.
Tools this server provides (10)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 2 of 10 tools change data; 2 names don't say.
From the server's own tool labels and tool names; not verified by us.
- podbc_get_schemasName suggests: reads
- List database schemas accessible to the connected DBMS.
- podbc_get_tablesName suggests: reads
- List tables associated with a selected database schema.
- podbc_describe_tableName suggests: reads
- Describe columns, data types, nulls, autoincrement, primary and foreign keys of a table.
- podbc_filter_table_names
- List tables whose names contain a given substring.
- podbc_query_databaseName suggests: reads
- Execute a SQL query and return results in JSONL format.
- podbc_execute_queryName suggests: changes
- Execute a SQL query and return results in JSONL format.
- podbc_execute_query_mdName suggests: changes
- Execute a SQL query and return results as a Markdown table.
- podbc_spasql_queryName suggests: reads
- Execute a SPASQL query and return results.
- podbc_sparql_queryName suggests: reads
- Execute a SPARQL query and return results.
- podbc_virtuoso_support_ai
- Interact with the Virtuoso Support Assistant.
What it does
- Schema and table discovery
- Lists schemas and tables, and filters table names by a substring.
- Table structure description
- Reports column names, data types, nullability, primary keys and foreign keys.
- SQL query execution
- Runs SQL and returns rows as JSON Lines or as a Markdown table.
- Virtuoso SPARQL and SPASQL
- Runs SPARQL and hybrid SPASQL queries against Virtuoso with row limits and timeouts.
- Stored procedure calls
- Executes stored procedures on Virtuoso and returns their results.
- Environment-based credentials
- Takes DSN, user and password from environment variables or per-call parameters.
Good for
- Letting an AI assistant explore an unfamiliar database schema before writing queries
- Generating Markdown tables of query results for reports
- Querying a Virtuoso instance with SPARQL from a chat client
- Debugging a database connection through the MCP Inspector
Pricing
Open source
Free and open source under the MIT license.
mcp-sqlalchemy-server FAQ
Which databases does mcp-sqlalchemy-server support?
Virtuoso is the primary target. The documentation also gives tested connection URL formats for PostgreSQL, MySQL and SQLite.
How is mcp-sqlalchemy-server configured?
Set up an ODBC data source name, then provide ODBC_DSN, ODBC_USER and ODBC_PASSWORD through environment variables or the MCP client configuration.
What output formats do query tools return?
Query results can be returned as JSON Lines or as a Markdown table.
Is mcp-sqlalchemy-server free?
Yes. mcp-sqlalchemy-server is open source, so you can use and self-host it for free.
What are the best alternatives to mcp-sqlalchemy-server?
The closest alternatives to mcp-sqlalchemy-server are mcp-odbc-server, mcp-jdbc-server, mcp-alchemy, sql-query-mcp and mysql_mcp_server.
Where this comes from
- Description: written from the project's README.

