mcp-alchemy

MCP Alchemy connects Claude Desktop to databases, enabling it to explore database structure, write SQL queries, display relationships, and analyze large datasets using SQLAlchemy-compatible databases. MCP Alchemy connects Claude Desktop

234
11

MCP Alchemy

Status: Works great and is in daily use without any known bugs.

MCP Alchemy connects Claude Desktop to databases, enabling it to act as a database expert. It facilitates database exploration, SQL query writing and validation, relationship visualization, and large dataset analysis. It leverages claude-local-files for handling large datasets.

It supports PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, and other SQLAlchemy-compatible databases.

API

Tools

Provides tools like all_table_names, filter_table_names, schema_definitions, and execute_query for database interaction. The execute_query tool returns results in a vertical format with features like smart truncation, NULL value display, and ISO formatted dates.

Usage with Claude Desktop

Configuration involves adding a database entry to claude_desktop_config.json with connection details and environment variables like DB_URL (required) and CLAUDE_LOCAL_FILES_PATH (optional).

Installation

Requires cloning the repository, ensuring uv is installed, and configuring the database in claude_desktop_config.json.

Database Drivers

Includes drivers for SQLite, MySQL/MariaDB (via pymysql), and PostgreSQL (via psycopg2-binary). Additional drivers for other databases can be installed using uv pip install.

Claude Local Files

Integration with claude-local-files enables access to complete result sets, report generation, and deep analysis of large datasets when CLAUDE_LOCAL_FILES_PATH is set.

Contributing

Contributions are welcome through bug reports, feature requests, documentation improvements, and code contributions.

Repository

RU
runekaagaard

runekaagaard/mcp-alchemy

Created

December 26, 2024

Updated

March 28, 2025

Language

Python

Category

Database