legion-mcp
by TheRaLabs·★ 91·综合分 41
一个通过 Legion Query Runner 提供跨 PostgreSQL、MySQL、SQL Server 等数据库统一访问的 MCP 服务器。
概述
此 MCP 服务器使 AI 助手能够通过一致的接口与多种数据库类型交互。它支持 PostgreSQL、MySQL、SQL Server、BigQuery、Oracle 等数据库,将数据库操作作为 MCP 工具、资源和提示暴露出来。该服务器使用 Legion Query Runner 库进行数据库连接,并提供单数据库和多数据库配置选项,同时具备安全的凭证管理功能。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您需要对多种数据库类型进行统一访问,并希望将数据库操作集成到 AI 助手中,而不必学习不同的客户端库时,选择此 MCP 服务器。
什么时候不要选它
如果您需要对数据库进行写访问或需要高级查询优化功能,请避免使用它,因为它主要专注于读取操作。
此 server 暴露的工具
从 README 抽取出 10 个工具execute_queryExecute a SQL query and return results as a markdown table
execute_query_jsonExecute a SQL query and return results as JSON
get_table_columnsGet column names for a specific table
get_table_typesGet column types for a specific table
get_query_historyGet the recent query history
list_databasesList all available database connections
get_database_infoGet detailed information about a database including schema
find_tableFind which database contains a specific table
describe_tableGet detailed description of a table including column names and types
get_table_sampleGet a sample of data from a table
可对比工具
安装
安装
使用 UV(推荐)
uvx database-mcp在 Claude Desktop 中配置
{
"mcpServers": {
"database-mcp": {
"command": "uvx",
"args": [
"database-mcp"
],
"env": {
"DB_TYPE": "pg",
"DB_CONFIG": "{\"host\":\"localhost\",\"port\":5432,\"user\":\"user\",\"password\":\"pw\",\"dbname\":\"dbname\"}"
}
}
}
}使用 PIP
pip install database-mcpFAQ
- 支持哪些数据库?
- 该服务器支持 PostgreSQL、Redshift、CockroachDB、MySQL、RDS MySQL、Microsoft SQL Server、Big Query、Oracle DB 和 SQLite。
- 可以同时连接多个数据库吗?
- 是的,该服务器通过 DB_CONFIGS 环境变量或命令行参数支持多数据库配置。
legion-mcp 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。