Multi-Database MCP Server (by Legion AI)
@TheRaLabs
Multi-Database MCP Server (by Legion AI) について
A server that helps people access and query data in databases using the Legion Query Runner with Model Context Protocol (MCP) in Python.
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"legion_mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/legion-mcp",
"run",
"mcp_server.py"
],
"env": {
"DB_TYPE": "pg",
"DB_CONFIG": "{\"host\":\"localhost\",\"port\":5432,\"user\":\"username\",\"password\":\"password\",\"dbname\":\"database_name\"}"
},
"disabled": false,
"autoApprove": []
}
}
}ツール
10Execute a SQL query and return results as a markdown table
Execute a SQL query and return results as JSON
Get column names for a specific table
Get column types for a specific table
Get the recent query history
List all available database connections
Get detailed information about a database including schema
Find which database contains a specific table
Get detailed description of a table including column names and types
Get a sample of data from a table
概要
What is Multi-Database MCP Server (by Legion AI)?
Multi-Database MCP Server (by Legion AI) is 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. It provides a unified, multi-database interface for AI assistants, enabling natural language database operations across PostgreSQL, MySQL, Microsoft SQL Server, and other databases.
How to use Multi-Database MCP Server (by Legion AI)?
Install using uvx (recommended) or via pip install database-mcp. Configure single or multiple databases via environment variables (DB_TYPE/DB_CONFIG for single, DB_CONFIGS for multiple) or command-line arguments. Run the server with python mcp_server.py or uv run src/database_mcp/mcp_server.py. Tools like execute_query, list_databases, and find_table accept a db_id parameter to target a specific database.
Key features of Multi-Database MCP Server (by Legion AI)
- Multi-database support – connect to multiple databases simultaneously.
- AI-ready integration through the Model Context Protocol.
- Zero-configuration automatic schema discovery.
- Database-agnostic tools for queries and schema exploration.
- Secure credential management separate from application code.
- Simple deployment with popular AI development environments.
Use cases of Multi-Database MCP Server (by Legion AI)
- AI agents that need to query and analyze data across multiple database types.
- Providing a unified, natural-language interface to heterogeneous databases.
- Simplifying database access for teams building AI-powered analytics tools.
- Enabling stateful interactions between AI assistants and database systems.
FAQ from Multi-Database MCP Server (by Legion AI)
Which databases are supported?
PostgreSQL (pg), Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite. See the README for the full list of DB_TYPE codes.
How do I configure multiple databases at once?
Set the DB_CONFIGS environment variable to a JSON array, each element containing db_type, configuration, and an optional id and description. The system generates a unique ID if none is provided.
How do I specify which database to use when executing a query?
All database-specific tools (e.g., execute_query, get_table_columns) require a db_id parameter. Use the list_databases tool to see available IDs, then pass the desired db_id.
What tools does the server expose to AI assistants?
Tools include execute_query, execute_query_json, get_table_columns, get_table_types, get_query_history, list_databases, get_database_info, find_table, describe_table, and get_table_sample.
How do I run the server in production?
Run python mcp_server.py with the appropriate environment variables or command-line arguments set. Alternatively, use uv run src/database_mcp/mcp_server.py with your configuration.
「データベース」の他のコンテンツ
MongoDB MCP Server
mongodb-jsA Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.

Redis
modelcontextprotocolModel Context Protocol Servers
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
コメント