Server facts
MCP Alchemy
Project
- Author
- runekaagaard
- Repository
- github.com/runekaagaard/mcp-alchemy
- License
- MPL-2.0
- Category
- Databases
Tech
- Runtime / language
- pythonPython
- Transports
- stdio
- Remote available
- No
- Authentication
- Not specified
Activity
- GitHub stars
- 420
- Last commit
- Data as of
Tags
- Database Schema
- Parameterized Sql
- Python
- Query Results
- Sqlalchemy
Overview
MCP Alchemy separates the query response an assistant reads from the complete dataset a query may produce. Normal output has a configurable character ceiling, with a default of 4,000, and presents rows vertically with explicit NULL handling and ISO dates. For larger analysis, claude-local-files can provide full results outside the immediate response. Setting its directory variable activates that optional integration, supporting subsequent reporting, visualization, or export. It is a companion project rather than an automatic part of the basic server launch. Query calls also accept parameters, allowing values to be supplied separately from the SQL text.
Before executing SQL, an assistant can discover tables, narrow their names by substring, and inspect selected definitions. Definitions expose nullability, key relationships, types, and columns rather than just a list of names. Database connectivity comes through SQLAlchemy, covering SQLite as well as engines such as Vertica, CrateDB, Oracle, SQL Server, PostgreSQL, MariaDB, and MySQL. The README gives driver-specific uvx examples: SQLite relies on Python's built-in support, while other examples request an additional dependency. DB_URL identifies the connection, and JSON engine options can override defaults. Connection management includes checking before use, recycling older connections, and a small persistent pool with overflow capacity. Queries use autocommit by default, an important behavior when considering writes. The stated license is MPL-2.0, and the client setup is documented around Claude Desktop.
Install & configure
Requirements
- uv installation providing uvx
- A database reachable through the chosen SQLAlchemy URL
- Driver dependency matching the database if not using the SQLite example
uvx --from mcp-alchemy==2025.8.15.91819 --refresh-package mcp-alchemy mcp-alchemyThe version pin and argument sequence reproduce the SQLite README example. For another engine, use its documented --with dependency and matching DB_URL. The remaining environment entries are optional settings listed in the README; the full-result path is meaningful with claude-local-files configured.
Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"mcp-alchemy": {
"command": "uvx",
"args": [
"--from",
"mcp-alchemy==2025.8.15.91819",
"--refresh-package",
"mcp-alchemy",
"mcp-alchemy"
],
"env": {
"DB_URL": "<required SQLAlchemy connection URL; use SQLite for this driver-free example>",
"CLAUDE_LOCAL_FILES_PATH": "<optional directory used by the full-result companion integration>",
"EXECUTE_QUERY_MAX_CHARS": "<optional character ceiling for query responses>",
"DB_ENGINE_OPTIONS": "<optional engine overrides encoded as a JSON string>"
}
}
}
}Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"mcp-alchemy": {
"command": "uvx",
"args": [
"--from",
"mcp-alchemy==2025.8.15.91819",
"--refresh-package",
"mcp-alchemy",
"mcp-alchemy"
],
"env": {
"DB_URL": "<required SQLAlchemy connection URL; use SQLite for this driver-free example>",
"CLAUDE_LOCAL_FILES_PATH": "<optional directory used by the full-result companion integration>",
"EXECUTE_QUERY_MAX_CHARS": "<optional character ceiling for query responses>",
"DB_ENGINE_OPTIONS": "<optional engine overrides encoded as a JSON string>"
}
}
}
}Config file · Workspace: .vscode/mcp.json
For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.
{
"servers": {
"mcp-alchemy": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"mcp-alchemy==2025.8.15.91819",
"--refresh-package",
"mcp-alchemy",
"mcp-alchemy"
],
"env": {
"DB_URL": "<required SQLAlchemy connection URL; use SQLite for this driver-free example>",
"CLAUDE_LOCAL_FILES_PATH": "<optional directory used by the full-result companion integration>",
"EXECUTE_QUERY_MAX_CHARS": "<optional character ceiling for query responses>",
"DB_ENGINE_OPTIONS": "<optional engine overrides encoded as a JSON string>"
}
}
}
}Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"mcp-alchemy": {
"command": "uvx",
"args": [
"--from",
"mcp-alchemy==2025.8.15.91819",
"--refresh-package",
"mcp-alchemy",
"mcp-alchemy"
],
"env": {
"DB_URL": "<required SQLAlchemy connection URL; use SQLite for this driver-free example>",
"CLAUDE_LOCAL_FILES_PATH": "<optional directory used by the full-result companion integration>",
"EXECUTE_QUERY_MAX_CHARS": "<optional character ceiling for query responses>",
"DB_ENGINE_OPTIONS": "<optional engine overrides encoded as a JSON string>"
}
}
}
}Config file · Project scope: .mcp.json at the repository root
The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"mcp-alchemy": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"mcp-alchemy==2025.8.15.91819",
"--refresh-package",
"mcp-alchemy",
"mcp-alchemy"
],
"env": {
"DB_URL": "<required SQLAlchemy connection URL; use SQLite for this driver-free example>",
"CLAUDE_LOCAL_FILES_PATH": "<optional directory used by the full-result companion integration>",
"EXECUTE_QUERY_MAX_CHARS": "<optional character ceiling for query responses>",
"DB_ENGINE_OPTIONS": "<optional engine overrides encoded as a JSON string>"
}
}
}
}Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Tools
Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.
| Tool | What it does |
|---|---|
| schema_definitions | Inspect selected tables for column types, keys, relationships, and nullable fields. |
| filter_table_names | Narrow the table inventory to names containing the requested text. |
| all_table_names | Return the connected database's table inventory without a filter. |
| execute_query | Run SQL with optional parameter values and display rows in a vertical layout. |
Names, permissions, and defaults can change. Check the current upstream documentation before granting access.
Use cases
- Inspect selected table definitions and relationships before drafting a query.
- Narrow a large table inventory using a name substring.
- Execute parameterized SQL through a Claude Desktop conversation.
- Use the companion file integration for analysis that needs unabridged query results.
Strengths
- Builds database access on SQLAlchemy with multiple documented driver configurations.
- Connects table discovery to detailed schema inspection rather than query execution alone.
- Can preserve full datasets separately from shortened assistant-facing output.
- Exposes engine options for tuning connections and pooling behavior.
Limitations
- The database-specific examples generally need an additional driver beyond the SQLite setup.
- An ordinary query response is shortened once it reaches the configured character ceiling.
- Default autocommit means queries are committed automatically rather than awaiting a later commit.
Frequently asked questions
Independent listing, not an affiliation or security review. Grant the least access needed and verify the upstream instructions before running code.