sql alchemy.com
sql alchemy.com logo

SQL Alchemy

Integrates Claude Desktop with SQL databases using SQLAlchemy to enable direct querying, analysis, and exploration of da...

Created byApr 22, 2025

MCP Alchemy

Status: Works great and is in daily use without any known bugs.
Status2: I just added the package to PyPI and updated the usage instructions. Please report any issues :)
Let Claude be your database expert! MCP Alchemy connects Claude Desktop directly to your databases, allowing it to:
  • Help you explore and understand your database structure
  • Assist in writing and validating SQL queries
  • Displays relationships between tables
  • Analyze large datasets and create reports
  • Claude Desktop Can analyse and create artifacts for very large datasets using claude-local-files.
Works with PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, and a host of other SQLAlchemy-compatible databases.
MCP Alchemy in action

Installation

Ensure you have uv installed:

Usage with Claude Desktop

Add to your claude_desktop_config.json. You need to add the appropriate database driver in the --with parameter.
Note: After a new version release there might be a period of up to 600 seconds while the cache clears locally cached causing uv to raise a versioning error. Restarting the MCP client once again solves the error.

SQLite (built into Python)

PostgreSQL

MySQL/MariaDB

Microsoft SQL Server

Oracle

CrateDB

For connecting to CrateDB Cloud, use a URL like crate://user:password@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true.

Environment Variables

  • CLAUDE_LOCAL_FILES_PATH: Directory for full result sets (optional)
  • EXECUTE_QUERY_MAX_CHARS: Maximum output length (optional, default 4000)

API

Tools

  • all_table_names
  • filter_table_names
  • schema_definitions
  • execute_query

Claude Local Files

When claude-local-files is configured:
  • Access complete result sets beyond Claude's context window
  • Generate detailed reports and visualizations
  • Perform deep analysis on large datasets
  • Export results for further processing
The integration automatically activates when CLAUDE_LOCAL_FILES_PATH is set.

Developing

First clone the github repository, install the dependencies and your database driver(s) of choice:
Then set this in claude_desktop_config.json:

Contributing

Contributions are warmly welcomed! Whether it's bug reports, feature requests, documentation improvements, or code contributions - all input is valuable. Feel free to:
  • Open an issue to report bugs or suggest features
  • Submit pull requests with improvements
  • Enhance documentation or share your usage examples
  • Ask questions and share your experiences
The goal is to make database interaction with Claude even better, and your insights and contributions help achieve that.

License

Mozilla Public License Version 2.0

My Other LLM Projects

  • [MCP Redmine](https://github.com/runekaagaard/mcp-redmine) - Let Claude Desktop manage your Redmine projects and issues.
  • [MCP Notmuch Sendmail](https://github.com/runekaagaard/mcp-notmuch-sendmail) - Email assistant for Claude Desktop using notmuch.
  • [Diffpilot](https://github.com/runekaagaard/diffpilot) - Multi-column git diff viewer with file grouping and tagging.
  • [Claude Local Files](https://github.com/runekaagaard/claude-local-files) - Access local files in Claude Desktop artifacts.

MCP Alchemy

Status: Works great and is in daily use without any known bugs.
Status2: I just added the package to PyPI and updated the usage instructions. Please report any issues :)
Let Claude be your database expert! MCP Alchemy connects Claude Desktop directly to your databases, allowing it to:
  • Help you explore and understand your database structure
  • Assist in writing and validating SQL queries
  • Displays relationships between tables
  • Analyze large datasets and create reports
  • Claude Desktop Can analyse and create artifacts for very large datasets using claude-local-files.
Works with PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, and a host of other SQLAlchemy-compatible databases.
MCP Alchemy in action

Installation

Ensure you have uv installed:

Usage with Claude Desktop

Add to your claude_desktop_config.json. You need to add the appropriate database driver in the --with parameter.
Note: After a new version release there might be a period of up to 600 seconds while the cache clears locally cached causing uv to raise a versioning error. Restarting the MCP client once again solves the error.

SQLite (built into Python)

PostgreSQL

MySQL/MariaDB

Microsoft SQL Server

Oracle

CrateDB

For connecting to CrateDB Cloud, use a URL like crate://user:password@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true.

Environment Variables

  • CLAUDE_LOCAL_FILES_PATH: Directory for full result sets (optional)
  • EXECUTE_QUERY_MAX_CHARS: Maximum output length (optional, default 4000)

API

Tools

  • all_table_names
  • filter_table_names
  • schema_definitions
  • execute_query

Claude Local Files

When claude-local-files is configured:
  • Access complete result sets beyond Claude's context window
  • Generate detailed reports and visualizations
  • Perform deep analysis on large datasets
  • Export results for further processing
The integration automatically activates when CLAUDE_LOCAL_FILES_PATH is set.

Developing

First clone the github repository, install the dependencies and your database driver(s) of choice:
Then set this in claude_desktop_config.json:

Contributing

Contributions are warmly welcomed! Whether it's bug reports, feature requests, documentation improvements, or code contributions - all input is valuable. Feel free to:
  • Open an issue to report bugs or suggest features
  • Submit pull requests with improvements
  • Enhance documentation or share your usage examples
  • Ask questions and share your experiences
The goal is to make database interaction with Claude even better, and your insights and contributions help achieve that.

License

Mozilla Public License Version 2.0

My Other LLM Projects

  • [MCP Redmine](https://github.com/runekaagaard/mcp-redmine) - Let Claude Desktop manage your Redmine projects and issues.
  • [MCP Notmuch Sendmail](https://github.com/runekaagaard/mcp-notmuch-sendmail) - Email assistant for Claude Desktop using notmuch.
  • [Diffpilot](https://github.com/runekaagaard/diffpilot) - Multi-column git diff viewer with file grouping and tagging.
  • [Claude Local Files](https://github.com/runekaagaard/claude-local-files) - Access local files in Claude Desktop artifacts.