MCP Catalogs
首页

legion-mcp

by TheRaLabs·91·综合分 41

一个通过 Legion Query Runner 提供跨 PostgreSQL、MySQL、SQL Server 等数据库统一访问的 MCP 服务器。

databasedeveloper-toolsai-llm
26
Forks
8
活跃 Issue
12 个月前
最近提交
2 天前
收录于

概述

此 MCP 服务器使 AI 助手能够通过一致的接口与多种数据库类型交互。它支持 PostgreSQL、MySQL、SQL Server、BigQuery、Oracle 等数据库,将数据库操作作为 MCP 工具、资源和提示暴露出来。该服务器使用 Legion Query Runner 库进行数据库连接,并提供单数据库和多数据库配置选项,同时具备安全的凭证管理功能。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:使 AI 助手能够跨多个数据库系统查询和分析数据
:为使用异构数据库的开发人员提供统一接口
:允许非技术用户通过自然语言与数据库交互
:支持哪些数据库?
:可以同时连接多个数据库吗?

什么时候选它

当您需要对多种数据库类型进行统一访问,并希望将数据库操作集成到 AI 助手中,而不必学习不同的客户端库时,选择此 MCP 服务器。

什么时候不要选它

如果您需要对数据库进行写访问或需要高级查询优化功能,请避免使用它,因为它主要专注于读取操作。

此 server 暴露的工具

从 README 抽取出 10 个工具
  • execute_query

    Execute a SQL query and return results as a markdown table

  • execute_query_json

    Execute a SQL query and return results as JSON

  • get_table_columns

    Get column names for a specific table

  • get_table_types

    Get column types for a specific table

  • get_query_history

    Get the recent query history

  • list_databases

    List all available database connections

  • get_database_info

    Get detailed information about a database including schema

  • find_table

    Find which database contains a specific table

  • describe_table

    Get detailed description of a table including column names and types

  • get_table_sample

    Get a sample of data from a table

可对比工具

supabase-mcpneon-mcppostgres-mcpmysql-mcp

安装

安装

使用 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-mcp

FAQ

支持哪些数据库?
该服务器支持 PostgreSQL、Redshift、CockroachDB、MySQL、RDS MySQL、Microsoft SQL Server、Big Query、Oracle DB 和 SQLite。
可以同时连接多个数据库吗?
是的,该服务器通过 DB_CONFIGS 环境变量或命令行参数支持多数据库配置。

legion-mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。