Skip to content
MCP server

mcp-alchemy

MCP server giving Claude read access to SQL databases for schema exploration and queries

Actively maintained

The repository was last updated 49 days ago and is published under MPL-2.0.

mcp-alchemy 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 (1 tool)
GitHub stars
420
Last commit

Similar MCP servers

About mcp-alchemy

Alchemy plugs an AI assistant into a relational database so it can inspect tables, follow foreign keys and run SQL on the user's behalf. It is built on SQLAlchemy, so any dialect that SQLAlchemy supports can be reached by changing a single connection URL. Results come back in a vertical, row-by-row layout with NULLs and dates rendered cleanly, and long outputs are truncated to a configurable size.

When the optional claude-local-files integration is configured, complete result sets can be written to a local directory, which lets the assistant work through datasets far larger than its context window. The server runs over stdio by default and can also be served over HTTP or SSE. Connection pooling defaults are tuned for a single long-running process and can be overridden through engine options.

The server suits analysts and developers who want to ask questions of their own data in plain language from Claude Desktop or another MCP client, while keeping the database connection on their own machine or network.

Tools this server provides (4)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 4 tools changes data; 3 names don't say.

From the server's own tool labels and tool names; not verified by us.

all_table_names
Return all table names in the database
filter_table_names
Find tables matching a substring
schema_definitions
Get detailed schema for specified tables
execute_queryName suggests: changes
Execute SQL query with vertical output format

What it does

Schema exploration
Lists tables, filters them by name and returns column types, primary keys, nullable flags and foreign key relationships.
SQL query execution
Runs parameterised SQL and returns results in a compact vertical format with clean NULL and ISO date display.
Multi-database support
Connects to PostgreSQL, MySQL, MariaDB, SQLite, Oracle, SQL Server, CrateDB, Vertica and other SQLAlchemy dialects via a URL.
Large result handling
Truncates long output by default and can write full result sets to a local directory for further analysis.
Configurable connection pooling
Ships with pool settings suited to long-running servers and lets users override pool size, overflow and recycle time.
Multiple transports
Serves over stdio by default, with optional streamable HTTP or legacy SSE transports.

Good for

  • Exploring an unfamiliar database schema before writing queries
  • Drafting and validating SQL queries against a live database from a chat interface
  • Analysing large tables and producing reports with the assistant
  • Mapping table relationships to understand how data connects
  • Connecting an internal PostgreSQL or SQL Server instance to Claude Desktop without exporting data

Pricing

Open source

Free open-source server under MPL-2.0

mcp-alchemy FAQ

Which databases does mcp-alchemy support?

It names PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB and Vertica, and works with other SQLAlchemy-compatible databases.

How is mcp-alchemy configured?

Add an entry to the MCP client config that runs the server with uvx, passes the matching database driver via --with, and sets the DB_URL environment variable.

Can mcp-alchemy handle results larger than the context window?

When CLAUDE_LOCAL_FILES_PATH is set and the claude-local-files integration is used, full result sets are written to local files for analysis.

Is mcp-alchemy free?

It is released under the Mozilla Public License 2.0 and installed from PyPI or a Docker image.

What are the best alternatives to mcp-alchemy?

The closest alternatives to mcp-alchemy are mysql_mcp_server, mcp-server-mysql, postgres_mcp, sql-query-mcp and Db Access MCP.

Where this comes from

  • Description: written from the project's README.

How AIPoweredBot checks servers