Loading...

MCP Alchemy connects Claude to SQL databases, enabling exploration, query execution, and data analysis, with configurable access and connection pooling.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
MCP Alchemy connects Claude to SQL databases, enabling exploration, query execution, and data analysis, with configurable access and connection pooling.
MCP Alchemy's safety depends on the user's SQL query practices. Read-only operations are relatively safe. However, executing arbitrary SQL queries can be risky if not properly sanitized, potentially leading to data breaches or modifications. Limit access and monitor query execution.
Performance depends on the complexity of the SQL queries and the size of the database. Connection pooling helps manage resources, but long-running queries can still impact performance.
Cost depends on the database infrastructure and the volume of queries executed. Consider optimizing queries to reduce resource consumption.
{
"mcpServers": {
"my_sqlite_db": {
"command": "uvx",
"args": ["--from", "mcp-alchemy==2025.8.15.91819",
"--refresh-package", "mcp-alchemy", "mcp-alchemy"],
"env": {
"DB_URL": "sqlite:////absolute/path/to/database.db"
}
}
}
}all_table_namesRetrieves all table names in the connected database.
Read-only operation; no data modification.
filter_table_namesFinds table names matching a specified substring.
Read-only operation; no data modification.
schema_definitionsGets detailed schema information for specified tables.
Read-only operation; no data modification.
execute_queryExecutes an arbitrary SQL query against the database.
Can modify, delete, or expose sensitive data based on the query.
Environment Variable
MCP Alchemy's safety depends on the user's SQL query practices. Read-only operations are relatively safe. However, executing arbitrary SQL queries can be risky if not properly sanitized, potentially leading to data breaches or modifications. Limit access and monitor query execution.
The level of autonomy depends on the queries executed. Ensure queries are safe and validated before execution.
Production Tip
Implement robust input validation and query sanitization to prevent SQL injection attacks.
PostgreSQL, MySQL, MariaDB, SQLite, Oracle, MS SQL Server, CrateDB, Vertica, and other SQLAlchemy-compatible databases.
Use the `--with` parameter in the `claude_desktop_config.json` file to specify the required drivers.
Set the `DB_URL` environment variable with the appropriate SQLAlchemy database URL.
It allows you to override the default SQLAlchemy engine options, such as connection pooling settings.
Configure `claude-local-files` by setting the `CLAUDE_LOCAL_FILES_PATH` environment variable.
Connection pooling maintains a set of database connections to improve performance and prevent timeout issues.
Always sanitize user inputs and use parameterized queries to prevent malicious code from being executed.