# mcp-trino

Connects Trino to AI coding assistants for running distributed SQL queries and inspecting catalogs. Helpful when exploring data schemas or debugging queries directly in your editor.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 122
- Author: tuannvm
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tuannvm/mcp-trino
- Updated: 2026-07-01
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-trino

## What it does

Written in Go, this server connects your assistant to a Trino cluster. It provides tools to execute SQL statements, analyze query plans, and inspect database schemas. The binary can also launch as an interactive command-line shell with table or JSON formatting.

Communication runs over STDIO or HTTP endpoints. Built-in OAuth 2.1 integration handles tokens from providers like Okta or Azure AD. Queries automatically carry identity tags, or can impersonate the active account using Trino headers.

Local execution requires `TRINO_HOST` and `TRINO_USER` environment variables. Without a reachable Trino instance, any query execution exits with code 1.

## Requirements
- Needs: a prebuilt binary from the repository releases
- Environment variables: `TRINO_HOST`, `TRINO_PORT`, `TRINO_USER`, `TRINO_PASSWORD` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- Query distributed datasets directly through Trino
- Inspect catalogs, schemas, and table definitions from the chat
- Retrieve query execution plans for performance tuning
- Propagate user identities into Trino headers for auditing

## Example prompts
- Show the available catalogs and schemas in Trino
- Explain the execution plan for `SELECT COUNT(*) FROM my_table`
- Fetch the schema for `my_catalog.my_schema.orders` and run a sample query

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
