runekaagaard/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.

What it solves

MCP Alchemy allows Claude Desktop to act as a database expert by providing a direct connection to various SQL databases. It eliminates the need to manually export data or write queries in a separate tool, enabling the AI to explore schemas, write and validate SQL, and analyze datasets directly within the chat interface.

How it works

It functions as a Model Context Protocol (MCP) server that uses SQLAlchemy to connect to a wide range of databases. It provides a set of tools that the LLM can call to interact with the database:

  • Schema Exploration: Tools to list all table names, filter for specific tables, and retrieve detailed schema definitions (including columns, types, and foreign key relationships).
  • Query Execution: A tool to execute SQL queries and return results in a clean, vertical format optimized for LLM consumption.
  • Large Dataset Handling: Through integration with claude-local-files, it can save full result sets to local files, bypassing Claude's context window limits for deep analysis and reporting.
  • Connection Management: It uses optimized connection pooling (with pre-pinging and recycling) to ensure stable connections for long-running sessions.

Who it’s for

Developers, data analysts, and database administrators who use Claude Desktop and want to integrate their local or remote SQL databases into their AI workflow.

Highlights

  • Broad Database Support: Compatible with any SQLAlchemy-compatible database, including PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, and Vertica.
  • SQLAlchemy Integration: Leverages SQLAlchemy for universal database connectivity.
  • Vertical Output Format: Returns query results in a row-by-row vertical format for better readability and AI processing.
  • Local File Export: Integrates with claude-local-files to handle very large datasets that would otherwise exceed the context window.
  • Robust Connection Pooling: Built-in settings to handle database timeouts and network issues automatically.

Related

  • Project
  • Project
  • Project
  • Project
  • Project