MCP Alchemy

v1.0.0โ€ขDatabasesโ€ขstable

๐Ÿ ๐Ÿ  - 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.

mcp-alchemymcpai-integration
Share:
403
Stars
0
Downloads
0
Weekly
0/5

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

Query and analyze databases including PostgreSQL, MySQL, SQLite, Oracle, and more.
Inspect database schemas and relationships with large dataset analysis.
runekaagaard

Maintainer

LicenseMozilla Public License 2.0
Languagepython
Versionv1.0.0
UpdatedMay 14, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-alchemy

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 | sh
2

Identify 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+Server
3

Configure 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"
      }
    }
  }
}
4

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"
5

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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-alchemy": { "command": "npx", "args": ["-y", "mcp-alchemy"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides