mcp-alchemy  by runekaagaard

LLM database integration server

created 7 months ago
279 stars

Top 94.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an MCP (Model Context Protocol) server that enables LLMs, specifically Claude Desktop, to interact with relational databases. It allows users to explore database schemas, write and validate SQL queries, analyze data, and generate reports, acting as a database expert for the LLM.

How It Works

MCP Alchemy leverages SQLAlchemy for broad database compatibility, supporting PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, Vertica, and others. It integrates with Claude Desktop via a configuration file, launching the server using uvx and specifying the necessary database driver. The server exposes API tools for common database operations like listing tables, retrieving schema definitions, and executing SQL queries, with options for handling large datasets via claude-local-files.

Quick Start & Requirements

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Configure claude_desktop_config.json with the appropriate DB_URL and database driver (e.g., psycopg2-binary for PostgreSQL).
  • Official documentation and examples are available within the README.

Highlighted Details

  • Supports a wide range of SQL databases through SQLAlchemy.
  • Integrates with claude-local-files for handling large datasets beyond context window limits.
  • Provides API tools for schema exploration, query execution, and table filtering.
  • Features connection pooling optimized for long-running MCP servers with configurable parameters.
  • Offers smart truncation, clean NULL display, and ISO-formatted dates for query results.

Maintenance & Community

The project is actively maintained, with recent updates including PyPI packaging and usage instructions. Contributions are welcomed via issues and pull requests. The project is listed in several MCP directory sites, indicating community adoption.

Licensing & Compatibility

Licensed under the Mozilla Public License Version 2.0 (MPL 2.0). This license is generally permissive and allows for use in commercial and closed-source applications, provided modifications to the licensed code are shared under the same license.

Limitations & Caveats

The README mentions a potential temporary versioning error with uv after new releases, which can be resolved by restarting the MCP client. Some database drivers might require specific versions or additional setup.

Health Check
Last commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
102 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.