mcp-alchemy
A MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
claude mcp add --transport stdio runekaagaard-mcp-alchemy uvx --from mcp-alchemy==2025.8.15.91819 --refresh-package mcp-alchemy mcp-alchemy
How to use
MCP Alchemy is a Python-based MCP server that connects Claude Desktop to your databases, enabling you to explore database structures, validate and compose SQL queries, and analyze large datasets. The server exposes a set of API tools such as all_table_names, filter_table_names, schema_definitions, and execute_query, which you can call from Claude Desktop or via the claude-local-files integration for large result sets. To use it, configure Claude Desktop to point at your mcp-alchemy package via uvx, providing the appropriate database driver in the --with parameter depending on your database (e.g., psycopg2-binary for PostgreSQL, pymysql for MySQL). You can also adjust connection pooling and engine options with DB_ENGINE_OPTIONS to optimize performance for long-running queries. When CLAUDE_LOCAL_FILES_PATH is set, you gain access to complete result sets and deeper analysis through claude-local-files.
How to install
Prerequisites:
- Python runtime installed and uvx available (via uv).
- Access to install Python packages (PyPI package mcp-alchemy).
Installation steps:
- Install uv if you haven't already: curl -LsSf https://astral.sh/uv/install.sh | sh
- Install the MCP Alchemy package from PyPI (via uvx): uvx install mcp-alchemy
- Start the MCP Alchemy server (example using uvx to run the package): uvx --from mcp-alchemy==2025.8.15.91819 --refresh-package mcp-alchemy mcp-alchemy
- Configure Claude Desktop to connect using claude_desktop_config.json, referencing the server and the appropriate DB driver in the --with argument for your database.
Note: If you update to a new version, you may experience a short cache warm-up period. Restarting the MCP client can resolve versioning errors during that window.
Additional notes
- The DB_URL environment variable is required for most database connections. It should be a SQLAlchemy database URL (see SQLAlchemy docs).
- You can tune connection pooling via DB_ENGINE_OPTIONS, for example: { "DB_ENGINE_OPTIONS": "{"pool_size": 5, "max_overflow": 10, "pool_recycle": 1800}" }.
- CLAUDE_LOCAL_FILES_PATH enables export and deeper analysis via claude-local-files; ensure the path is accessible to the MCP Alchemy process.
- If you encounter a cache/versioning error after a new release, restart the MCP client to re-cache the package.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP