Trino MCP Server

by stinkgen

10 445 downloads Not rated yet MIT
GitHub

About

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).

Details

License
MIT

Explore

- ✅ Fixed Docker container API initialization issue! (reliable server initalization)
- ✅ Exposes Trino resources through MCP protocol
- ✅ Enables AI tools to query and analyze data in Trino
- ✅ Provides transport options (STDIO transport works reliably; SSE transport has issues)
- ✅ Fixed catalog handling for proper Trino query execution
- ✅ Both Docker container API and standalone Python API server options

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Trino MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


The test_bullshit_query.py script demonstrates end-to-end MCP interaction:
- Connects to the MCP server using STDIO transport
- Initializes the protocol following the MCP spec
- Runs a complex SQL query with WHERE, GROUP BY, HAVING, ORDER BY
- Processes and formats the results

bash

pip install -e ".[dev]"

python llm_trino_api.py
curl -X POST "http://localhost:8008/query" \
-H "Content-Type: application/json" \
-d '{"query": "SELECT 1 AS test"}'
```

api_url = "http://localhost:9097/api/query"

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "trino mcp server": {
            "trino_mcp": {
                "command": "python",
                "args": [
                    "llm_trino_api.py"
                ]
            }
        }
    }
}

McpServers

{
    "trino_mcp": {
        "command": "python",
        "args": [
            "llm_trino_api.py"
        ]
    }
}

Model Context Protocol server for Trino, providing AI models with structured access to Trino's distributed SQL query engine.

⚠️ BETA RELEASE (v0.1.2) ⚠️
This project is stabilizing with core features working and tested. Feel free to fork and contribute!

Features

- ✅ Fixed Docker container API initialization issue! (reliable server initalization)
- ✅ Exposes Trino resources through MCP protocol
- ✅ Enables AI tools to query and analyze data in Trino
- ✅ Provides transport options (STDIO transport works reliably; SSE transport has issues)
- ✅ Fixed catalog handling for proper Trino query execution
- ✅ Both Docker container API and standalone Python API server options

Quick Start

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.