TL

theralabs/legion-mcp

数据库管理

本页由 AI 翻译,技术细节请以原文为准。 查看原文

95 stars 28 forks 质量 64 趋势 15GPL-3.0

theralabs/legion-mcp 是从 https://github.com/theralabs/legion-mcp. 导入的 MCP 服务器候选。

概览

theralabs/legion-mcp 是从 https://github.com/theralabs/legion-mcp. 导入的 MCP 服务器候选。

概述(AI 翻译)

一台服务器,帮助人们使用Legion Query Runner并集成了模型上下文协议(MCP)Python SDK访问和查询数据库中的数据。

从这里开始一代

该工具由Legion AI提供。如需使用这个功能齐全且全面的AI数据分析工具,请访问该网站。如果您有任何数据库需要支持,请发送邮件给我们。

终结一代

为什么选择数据库MCP

数据库MCP在多个令人信服的方面区别于其他数据库访问解决方案:

  • 统一多数据库接口:通过单一一致的API连接PostgreSQL、MySQL、SQL Server及其他数据库——无需为每种数据库类型学习不同的客户端库。
  • AI 就绪集成:专为通过模型上下文协议(MCP)实现 AI 助手交互而构建,支持自然语言数据库操作。
  • 零配置模式发现:自动发现并暴露数据库模式,无需手动配置或映射。
  • 数据库无关工具:查找表、探索模式,并使用相同工具执行查询,无论底层数据库技术如何。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Multi-Database MCP Server (by Legion AI)

A server that helps people access and query data in databases using the Legion Query Runner with integration of the Model Context Protocol (MCP) Python SDK.

Start Generation Here

This tool is provided by Legion AI. To use the full-fledged and fully powered AI data analytics tool, please visit the site. Email us if there is one database you want us to support.

End Generation Here

Why Choose Database MCP

Database MCP stands out from other database access solutions for several compelling reasons:

  • Unified Multi-Database Interface: Connect to PostgreSQL, MySQL, SQL Server, and other databases through a single consistent API - no need to learn different client libraries for each database type.
  • AI-Ready Integration: Built specifically for AI assistant interactions through the Model Context Protocol (MCP), enabling natural language database operations.
  • Zero-Configuration Schema Discovery: Automatically discovers and exposes database schemas without manual configuration or mapping.
  • Database-Agnostic Tools: Find tables, explore schemas, and execute queries with the same set of tools regardless of the underlying database technology.
  • Secure Credential Management: Handles database authentication details securely, separating credentials from application code.
  • Simple Deployment: Works with modern AI development environments like LangChain, FastAPI, and others with minimal setup.
  • Extensible Design: Easily add custom tools and prompts to enhance functionality for specific use cases.

Whether you’re building AI agents that need database access or simply want a unified interface to multiple databases, Database MCP provides a streamlined solution that dramatically reduces development time and complexity.

Features

  • Multi-database support - connect to multiple databases simultaneously
  • Database access via Legion Query Runner
  • Model Context Protocol (MCP) support for AI assistants
  • Expose database operations as MCP resources, tools, and prompts
  • Multiple deployment options (standalone MCP server, FastAPI integration)
  • Query execution and result handling
  • Flexible configuration via environment variables, command-line arguments, or MCP settings JSON
  • User-driven database selection for multi-database setups

Supported Databases

Database DB_TYPE code
PostgreSQL pg
Redshift redshift
CockroachDB cockroach
MySQL mysql
RDS MySQL rds_mysql
Microsoft SQL Server mssql
Big Query bigquery
Oracle DB oracle
SQLite sqlite

We use Legion Query Runner library as connectors. You can find more info on their api doc.

What is MCP?

在 GitHub 查看完整 README

安装

uvx database-mcp
新手?先看 mcpskill.org 教程 →

配置

REPLACE DB_TYPE and DB_CONFIG with your connection info. { "mcpServers": { "database-mcp": { "command": "uvx", "args": [ "database-mcp" ], "env": { "DB_TYPE": "pg", "DB_CONFIG": "{\"host\":\"localhost\",\"port\":5432,\"user\":\"user\",\"password\":\"pw\",\"dbname\":\"dbname\"}" }, "disabled": true, "autoApprove": [] } } }