Enterprise DNA
M MCP Servers Developer low

TheRaLabs/legion-mcp

by Various

A server that helps people access and query data in databases using the Legion Query Runner with Model Context Protocol (MCP) in Python.

T

MCP

TheRaLabs/legion-mcp

Added 1 June 2026

#database #legion-ai #mcp #mcp-server #query-builder

Overview

A Python server that connects the Legion Query Runner to MCP clients, enabling natural language queries against databases. It translates requests into SQL and returns results through the Model Context Protocol.

Best for

Best for
Developers who want to query databases from MCP-enabled AI assistants without writing raw SQL.

Use cases

  • Query databases via natural language from MCP-compatible assistants
  • Integrate Legion Query Runner with AI coding tools for data exploration
  • Automate database lookups in development workflows

How to use

Install

npx @modelcontextprotocol/inspector uv run src/database_mcp/mcp_server.py

Tools exposed

  • execute_query
  • execute_query_json
  • get_table_columns
  • get_table_types
  • get_query_history
  • list_databases
  • get_database_info
  • find_table
  • describe_table
  • get_table_sample
  • sql_query
  • explain_query
  • optimize_query
  • select_database

Example client config

{\n    "mcpServers": {\n      "database-mcp": {\n        "command": "uvx",\n        "args": [\n          "database-mcp"\n        ],\n        "env": {\n          "DB_TYPE": "pg",\n          "DB_CONFIG": "{\"host\":\"localhost\",\"port\":5432,\"user\":\"user\",\"password\":\"pw\",\"dbname\":\"dbname\"}"\n        },\n        "disabled": true,\n        "autoApprove": []\n      }\n    }\n}

Notes

A Python server that connects the Legion Query Runner to MCP clients, enabling natural language queries against databases. It translates requests into SQL and returns results through the Model Context Protocol.

92 stars on GitHub. Last updated 2025-05-11. Licensed GPL-3.0.

Use cases

  • Query databases via natural language from MCP-compatible assistants
  • Integrate Legion Query Runner with AI coding tools for data exploration
  • Automate database lookups in development workflows

Pros

  • Simplifies database access for non-SQL users through MCP
  • Lightweight Python implementation with clear protocol boundaries
  • Open source with 92 stars and active community potential

Cons

  • Limited to Legion Query Runner supported databases
  • Requires MCP client setup and Python environment
  • Small user base may mean fewer examples and slower issue resolution

Indexed from awesome-mcp-servers-punkpeye and enriched against its public facts.

Pros

  • Simplifies database access for non-SQL users through MCP
  • Lightweight Python implementation with clear protocol boundaries
  • Open source with 92 stars and active community potential

Cons

  • Limited to Legion Query Runner supported databases
  • Requires MCP client setup and Python environment
  • Small user base may mean fewer examples and slower issue resolution

Pairs with

Other entries in the index that connect to this one. Click through to see the chain.

Free 27-page guide

Get the free Developer’s Field Guide

A 27-page field guide to the AI coding workflow with Claude. Claude Code, MCP servers, the prompt patterns that work, and what to delegate. Free.

Enter your work email. We send it straight over, plus a few short notes worth knowing. Unsubscribe any time.

No spam. Unsubscribe any time.

Running a business, not writing the code? See the MCP servers picked for operators, and get your first one wired up with us.

Operator picks