Database · Developer Tools

legion_mcp logo

legion_mcp

TheRaLabs/legion-mcp

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.

Install

uvx database-mcp

Client configuration

{
  "mcpServers": {
    "database-mcp": {
      "command": "uvx",
      "args": [
        "database-mcp"
      ],
      "env": {
        "DB_TYPE": "<DB_TYPE>",
        "DB_CONFIG": "<DB_CONFIG>"
      }
    }
  }
}

Environment variables

DB_TYPEDB_CONFIGDB_CONFIGS
GitHub stars
22
Category
Database, Developer Tools
Updated
Oct 6, 2026

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

Tools (10)

  • execute_query

    Execute a SQL query and return results as a markdown table

  • execute_query_json

    Execute a SQL query and return results as JSON

  • get_table_columns

    Get column names for a specific table

  • get_table_types

    Get column types for a specific table

  • get_query_history

    Get the recent query history

  • list_databases

    List all available database connections

  • get_database_info

    Get detailed information about a database including schema

  • find_table

    Find which database contains a specific table

  • describe_table

    Get detailed description of a table including column names and types

  • get_table_sample

    Get a sample of data from a table

Details on this page are taken from the project's README. Open README

Related MCP servers

More servers
Supabase MCP logo

Supabase MCP

supabase-community/supabase-mcp

1.3k

The Model Context Protocol (MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the full list of tools.

Database
Genai Toolbox logo

Genai Toolbox

googleapis/genai-toolbox

769

MCP Toolbox for Databases is an open source Model Context Protocol (MCP) server that connects your AI agents, IDEs, and applications directly to your enterprise databases.

Database
Supabase MCP Server logo

Supabase MCP Server

alexander-zuev/supabase-mcp-server

677

Query MCP is an open-source MCP server that lets your IDE safely run SQL, manage schema changes, call the Supabase Management API, and use Auth Admin SDK — all with built-in safety controls.

Database
Awesome MCP List logo

Awesome MCP List

MobinX/awesome-mcp-list

645

This is a continuously updated curated list of MCP servers, covering categories such as browser control, arts and culture, cloud platforms, command line, communication, customer data platforms, databases, developer tools, data science tools, file systems, finance and fintech, gaming, knowledge and memory, location services, marketing, monitoring, search and utilities. Each project includes a GitHub link and star count for quick reference and use.

Database
PostgreSQL Model Context Protocol (PG MCP) Server logo

PostgreSQL Model Context Protocol (PG MCP) Server

stuzero/pg-mcp-server

440

PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.

Database
dbhub logo

dbhub

bytebase/dbhub

332

[!NOTE] If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

Database