- Legion_mcp
Legion_mcp
What is Legion MCP?
Legion MCP (Model Context Protocol) Server is a server designed to facilitate access and querying of data in databases using the Legion Query Runner, integrated with the Model Context Protocol (MCP) Python SDK.
How to use Legion MCP?
To use Legion MCP, set up the server by installing dependencies, configuring your database connection, and running the server in either development or production mode. You can execute SQL queries and manage database operations through the MCP interface.
Key features of Legion MCP?
- Database access via Legion Query Runner
- Support for Model Context Protocol (MCP) for AI assistants
- Exposes database operations as MCP resources, tools, and prompts
- Multiple deployment options including standalone and FastAPI integration
- Flexible configuration through environment variables and command-line arguments
Use cases of Legion MCP?
- Enabling AI assistants to perform database operations seamlessly.
- Providing a structured way to manage and query database schemas and metadata.
- Facilitating stateful interactions with databases for applications.
FAQ from Legion MCP?
- What is the Model Context Protocol (MCP)?
MCP is a specification for maintaining context in AI applications, allowing for better interaction with databases.
- How do I install Legion MCP?
You can install it using the
uvdependency manager and follow the setup instructions provided in the documentation.
- Can I run Legion MCP in production?
Yes, Legion MCP can be run in production mode with appropriate configurations.
Server Config
{
"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": []
}
}
}