MCP Alchemy
๐ ๐ - Universal SQLAlchemy-based database integration supporting PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server and many more databases. Features schema and relationship inspection, and large dataset analysis capabilities.
What is MCP Alchemy?
MCP Alchemy is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐ ๐ - universal sqlalchemy-based database integration supporting postgresql, mysql, mariadb, sqlite, oracle, ms sql server and many more databases. features schema and relationship inspection, and l...
๐ ๐ - Universal SQLAlchemy-based database integration supporting PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server and many more databases. Features schema and relationship inspection, and large dataset analysis capabilities.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- ๐ ๐ - Universal SQLAlchemy-based database integration suppor
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-alchemyConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Alchemy
MCP Alchemy is a universal database MCP server built on SQLAlchemy that lets AI assistants connect to and query PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, Vertica, and any other SQLAlchemy-compatible database. It exposes tools for listing tables, filtering table names, inspecting schema definitions with columns and relationships, and executing SQL queries with smart result truncation and optional full-dataset access via file export. Data analysts, backend developers, and DBAs use MCP Alchemy to query databases in natural language, explore schemas, and analyze large datasets without leaving their AI client.
Prerequisites
- Python and the uv package manager installed (curl -LsSf https://astral.sh/uv/install.sh | sh)
- A running database instance (PostgreSQL, MySQL, SQLite, or other SQLAlchemy-compatible DB)
- The appropriate database driver package (e.g., psycopg2 for PostgreSQL, mysqlclient for MySQL)
- Claude Desktop or another MCP-compatible AI client
Install uv if not already available
MCP Alchemy uses uv for dependency management. Install it with the official installer script. uv is used in the MCP server command to pull the correct database drivers on demand.
curl -LsSf https://astral.sh/uv/install.sh | shIdentify your database connection string
MCP Alchemy uses a SQLAlchemy DB_URL connection string. Construct the appropriate URL for your database type.
# PostgreSQL
postgresql://user:password@localhost:5432/mydb
# MySQL
mysql://user:password@localhost:3306/mydb
# SQLite (local file)
sqlite:////absolute/path/to/database.db
# MS SQL Server
mssql+pyodbc://user:password@server/db?driver=ODBC+Driver+17+for+SQL+ServerConfigure Claude Desktop with the MCP Alchemy server
Add MCP Alchemy to your Claude Desktop config. Use the --with flag to include the required database driver package for your database type. DB_URL is the only required environment variable.
{
"mcpServers": {
"mcp-alchemy": {
"command": "uvx",
"args": ["--with", "psycopg2-binary", "mcp-alchemy"],
"env": {
"DB_URL": "postgresql://user:password@localhost:5432/mydb"
}
}
}
}Enable large dataset export (optional)
Set CLAUDE_LOCAL_FILES_PATH to a directory path to allow MCP Alchemy to write full query result sets as files when results exceed the character limit. This enables analysis of large datasets that would otherwise be truncated.
"CLAUDE_LOCAL_FILES_PATH": "/Users/yourname/claude-exports"Restart Claude Desktop and explore your database
Restart Claude Desktop after saving the config. Claude can now list all tables, inspect schema definitions, and run SQL queries against your database using the four exposed tools.
MCP Alchemy Examples
Client configuration
Configure Claude Desktop with MCP Alchemy for a PostgreSQL database, including the psycopg2 driver and large dataset export.
{
"mcpServers": {
"mcp-alchemy": {
"command": "uvx",
"args": ["--with", "psycopg2-binary", "mcp-alchemy"],
"env": {
"DB_URL": "postgresql://myuser:mypassword@localhost:5432/mydb",
"CLAUDE_LOCAL_FILES_PATH": "/Users/yourname/Downloads/db-exports",
"EXECUTE_QUERY_MAX_CHARS": "8000"
}
}
}
}Prompts to try
With MCP Alchemy connected to your database, try these prompts to explore schemas and query data.
- "List all tables in the database and describe what each one likely contains"
- "Show me the schema for the orders table including all columns, types, and foreign keys"
- "Find the top 10 customers by total order value in the last 90 days"
- "Are there any tables related to 'user' or 'account'? Show their schemas."
- "Run a query to find duplicate email addresses in the users table"Troubleshooting MCP Alchemy
Connection error: database driver not installed (e.g., ModuleNotFoundError: psycopg2)
Add the correct driver package to the --with argument in your uvx command. For PostgreSQL use `psycopg2-binary`, for MySQL use `mysqlclient` or `PyMySQL`, for MS SQL Server use `pyodbc`. Example: `"args": ["--with", "psycopg2-binary", "mcp-alchemy"]`.
Query results are truncated and the full dataset is not accessible
Set CLAUDE_LOCAL_FILES_PATH to an existing writable directory in your env config. MCP Alchemy will write the full result set to a file in that directory when results exceed EXECUTE_QUERY_MAX_CHARS (default 4000). Increase EXECUTE_QUERY_MAX_CHARS to show more inline if preferred.
DB_URL connection string is rejected or connection times out
Test the connection string directly with a SQLAlchemy Python script: `from sqlalchemy import create_engine; create_engine('YOUR_DB_URL').connect()`. Verify the host is reachable from the machine running Claude Desktop, check credentials, and ensure the database port is not blocked by a firewall.
Frequently Asked Questions about MCP Alchemy
What is MCP Alchemy?
MCP Alchemy is a Model Context Protocol (MCP) server that ๐ ๐ - universal sqlalchemy-based database integration supporting postgresql, mysql, mariadb, sqlite, oracle, ms sql server and many more databases. features schema and relationship inspection, and large dataset analysis capabilities. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Alchemy?
Follow the installation instructions on the MCP Alchemy GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Alchemy?
MCP Alchemy works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Alchemy free to use?
Yes, MCP Alchemy is open source and available under the Mozilla Public License 2.0 license. You can use it freely in both personal and commercial projects.
MCP Alchemy Alternatives โ Similar Databases Servers
Looking for alternatives to MCP Alchemy? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
โ 20.6kGo language library for reading and writing Microsoft Excelโข (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
โ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
โ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
โ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
โ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
โ 1.7k๐๏ธ ๐ โ๏ธ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Alchemy in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Alchemy?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.