Overview
What is Trino MCP Server?
A Model Context Protocol server for Trino, providing AI models with structured access to Trino's distributed SQL query engine. It is currently a beta release (v0.1.2).
How to use Trino MCP Server?
Start the server with docker-compose up -d. Verify the API at http://localhost:9097/api/query. For a non-containerized version, run python llm_trino_api.py on port 8008. Use STDIO transport (recommended) inside the container; client scripts run on the local machine and connect via docker exec.
Key features of Trino MCP Server
- Exposes Trino resources through the MCP protocol
- Enables AI tools to query and analyze Trino data
- Provides STDIO transport (reliable) and SSE transport (not recommended)
- Offers both Docker container API and standalone Python API
- Includes demo scripts for generating and querying test data
- Fixed catalog handling and Docker container initialization issues
Use cases of Trino MCP Server
- Let LLMs query Trino databases via natural language prompts
- Run complex analytical SQL queries through AI assistants
- Get database schema information programmatically
- Analyze data and present results with visualizations (e.g., Mermaid charts)
FAQ from Trino MCP Server
Which transport should I use?
STDIO transport works reliably. SSE transport has critical issues with MCP 1.3.0 and causes server crashes on client disconnection; avoid its use until a newer MCP version is integrated.
What are the runtime requirements?
Docker and docker-compose for the containerized version; Python for the standalone API. All scripts can run on the local machine and communicate with Docker containers via docker exec.
Where does the demo data live?
The demo data is generated by tools/create_bullshit_data.py and loaded into Trino's memory catalog using load_bullshit_data.py. The default catalog is memory.
How do I run tests?
Use python test_mcp_stdio.py for STDIO transport testing, or ./run_tests.sh for automated tests. The test_bullshit_query.py script demonstrates complex queries through MCP.
Are there known limitations?
Yes. The SSE transport is broken in MCP 1.3.0. The Docker container API previously had a 503 initialization issue (now fixed). The project is in beta (v0.1.2) and may have other edge cases.