Trino

v0.8.2
io.github.alaturqua/mcp-trino-python Checked 3 hours ago Published 5 days ago

Query Trino and inspect or maintain Iceberg tables: catalogs, schemas, SQL, snapshots.

Works with Claude Code, Claude Desktop, GitHub Copilot in VS Code, Cursor, and any other MCP client. You need uv and a Trino server (or docker run -d -p 8080:8080 trinodb/trino:484 for one with sample data). or install the plugin, which asks for the connection settings:

Summary extracted from the README.

MCP Trino Server

PyPI Docs Docker License MseeP.ai Security Assessment Badge

Let your AI assistant talk to Trino. Ask questions about your data in plain language; the assistant explores catalogs, writes and runs SQL, and inspects or maintains your Iceberg tables.

Works with Claude Code, Claude Desktop, GitHub Copilot in VS Code, Cursor, and any other MCP client.

📖 Documentation

Quick start

You need uv and a Trino server (or docker run -d -p 8080:8080 trinodb/trino:484 for one with sample data).

Claude Code

claude mcp add trino -e TRINO_HOST=localhost -e TRINO_USER=trino -- uvx mcp-trino-python

or install the plugin, which asks for the connection settings:

/plugin marketplace add alaturqua/mcp-trino-python
/plugin install trino@mcp-trino-python

Claude Desktop

Download mcp-trino-python.mcpb from the latest release and double-click it.

VS Code / GitHub Copilot, Cursor and others

Add this to your client's MCP config (.vscode/mcp.json uses "servers" instead of "mcpServers"):

{
  "mcpServers": {
    "trino": {
      "command": "uvx",
      "args": ["mcp-trino-python"],
      "env": { "TRINO_HOST": "localhost", "TRINO_PORT": "8080", "TRINO_USER": "trino" }
    }
  }
}

Then ask: "What catalogs are in Trino?"

More clients, Docker and troubleshooting: Connect your AI client.

What it can do

  • Explore: catalogs, schemas, tables, columns, DDL and statistics
  • Query: run SQL and get the rows back as JSON
  • Iceberg: snapshots, manifests, partitions, files, history, branches and tags
  • Maintain Iceberg tables: compact files and manifests, expire old snapshots
  • Read-only mode: TRINO_READ_ONLY=true blocks writes and hides maintenance tools

See the full tool list.

Configuration

Variable What it does Default
TRINO_HOST Trino server hostname localhost
TRINO_PORT Trino server port 8080
TRINO_USER User to run queries as trino
TRINO_PASSWORD Password; turns on basic auth (needs https) not set
TRINO_HTTP_SCHEME http or https http
TRINO_CATALOG Default catalog not set
TRINO_SCHEMA Default schema not set
TRINO_READ_ONLY true blocks writes and hides maintenance tools false

Running a shared server over HTTP or in Docker: see Remote and Docker deployment.

Contributing

uv sync
docker compose up -d --wait trino
uv run pytest

See Development for linting, docs and releases.

License

Apache 2.0. See LICENSE.