Query and inspect multiple database systems through one MCP interface with SQL, schema discovery, and database selection tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Legion MCP.
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
TheRaLabs/legion-mcp MCP server provides a common MCP interface for querying and inspecting several database systems. Supported connection types include PostgreSQL, Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite. Database access is provided through Legion Query Runner connectors rather than separate database-specific MCP tools.
The server supports both single-database and multi-database configurations. In a multi-database setup, each connection can have an ID and description. Agents can inspect the available connections, identify the database containing a table, review schema details, and then run queries against the selected database.
TheRaLabs/legion-mcp MCP server uses the MCP Python SDK to expose database operations as tools. It also provides database schema and metadata as MCP resources and includes prompts intended to guide database operations. The select_database prompt helps with choosing a connection when several databases are configured.
For a single connection, set DB_TYPE to a supported database code and provide its connection settings in DB_CONFIG as JSON. For multiple connections, use DB_CONFIGS, a JSON array containing each connection's type, configuration, and optional descriptive information. Tools that operate on a selected connection can receive its db_id.
The server can be configured through environment variables, command-line arguments, or MCP client settings JSON. The README documents uvx and pip-based setup, as well as running the server from the repository with Python.
The documented direct runner is uvx database-mcp. An MCP client configuration passes database settings through the env object. A single-database setup uses DB_TYPE and DB_CONFIG; a multi-database setup uses DB_CONFIGS instead. The JSON format inside these variables depends on the selected database connector, so connection fields must follow the configuration expected by Legion Query Runner.
Database IDs may be supplied explicitly in a multi-database configuration. If an ID is omitted, the server generates one from the database type and description. The README also shows command-line options named --db-type, --db-config, and --db-configs for starting the server without those environment variables.
TheRaLabs/legion-mcp MCP server exposes tools for:
execute_query.execute_query_json.In multi-database deployments, list_databases, get_database_info, and find_table support connection discovery before query execution. Database-specific credentials are kept in the connection configuration rather than embedded in SQL or application logic.
The server does not provide one universal connection format for every database. Each supported type has its own configuration requirements, which are documented by the Legion Query Runner connectors. Multi-database queries require the caller to identify the target connection, commonly by supplying db_id.
The available material documents database querying, metadata inspection, resources, and prompts. It does not describe write restrictions, query timeouts, result-size limits, role-based access controls, or transaction behavior. Review the connector-specific documentation and deployment environment before granting an agent access to production data.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/theralabs-legion-mcp)<a href="https://allmcps.com/mcp/theralabs-legion-mcp"><img src="https://allmcps.com/api/badge/theralabs-legion-mcp?style=directory" alt="Legion MCP on AllMCPs" /></a>