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.
@TheRaLabs
Basic information
A server that helps people access and query data in databases using the Legion Query Runner with Model Context Protocol (MCP) in Python.
Add this server to your MCP-compatible client using the configuration below.
{
"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": []
}
}
}Execute 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
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.
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.
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.
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.
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`.
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`.
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.

Oracle MCP server with no run-sql tool: It generates tools for each of the PL/SQL procedures, tables and approved SQL you choose. The server doesn't expose a SQL prompt, and can't reveal how it's connected to Oracle.
The Xata MCP server lets AI assistants and agents interact with your Xata organizations, projects, and Postgres database branches.

Model Context Protocol Servers

Local database MCP server: your agent sees a migration's impact before it runs, for PostgreSQL, MySQL, SQL Server and SQLite, with no database credentials.
An official Qdrant Model Context Protocol (MCP) server implementation
Comments