Basic information
About Legion Database MCP Server
Legion Database: natural-language SQL for multi-database querying. Explore PostgreSQL, MySQL, SQL Server & BigQuery with an intuitive SQL query generator.
Legion Database is a MCP server in the Databases category listed in the AddMCP.net directory, published by theralabs. Supported transport: stdio. Runtime: Python. License: GPL-3.0. The repository has 94 GitHub stars. Source code is hosted on github.com. Related topics: ai-assistant, ai-ml, community, database-access, databases.
Connection details
https://mcp.legion-api.com/mcp
Setup
claude mcp add legion-mcp --transport http https://mcp.legion-api.com/mcp
[mcp_servers.legion-mcp] url = "https://mcp.legion-api.com/mcp"
{
"mcpServers": {
"legion-mcp": {
"url": "https://mcp.legion-api.com/mcp"
}
}
}
{
"servers": {
"legion-mcp": {
"type": "http",
"url": "https://mcp.legion-api.com/mcp"
}
}
}
Legion Database MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"database-mcp": {
"command": "uvx",
"args": [
"database-mcp"
],
"env": {
"DB_TYPE": "pg",
"DB_CONFIG": "{\"host\":\"localhost\",\"port\":5432,\"user\":\"user\",\"password\":\"pw\",\"dbname\":\"dbname\"}"
}
}
}
}
Legion Database MCP Server tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Legion Database?
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 Legion Database?
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 Legion Database
- 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 Legion Database
- 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.
Frequently asked questions
1 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.
2 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.
3 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.
4 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.
5 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.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In