Get the FREE Ultimate OpenClaw Setup Guide →

mcp-trino

A high-performance Model Context Protocol (MCP) server for Trino implemented in Go.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tuannvm-mcp-trino docker run -i ghcr.io/tuannvm/mcp-trino:latest \
  --env TRINO_HOST="Hostname or IP of the Trino cluster" \
  --env TRINO_USER="Username for Trino access" \
  --env TRINO_SCHEME="TRINO scheme (e.g. http or https)" \
  --env MCP_TRANSPORT=" transports like http or stdio" \
  --env OAUTH_PROVIDER="OAuth provider (optional)"

How to use

This MCP server exposes a Go-based Trino integration that allows AI assistants and MCP-compatible clients to run SQL queries against a Trino cluster via standardized MCP tools. The server supports both HTTP and STDIO transports, enabling environments ranging from browser-based agents to local CLI integrations. Tools available include execute_query, list_catalogs, list_schemas, list_tables, get_table_schema, and explain_query. When using OAuth, the server can operate in native or proxy modes to obtain and refresh tokens, and it can attribute queries to authenticated users via headers like X-Trino-Client-Tags, X-Trino-Client-Info, and optional impersonation headers. To start, ensure your environment variables point to a reachable Trino host and that any required OAuth configuration is in place. Clients can connect via HTTP endpoints or use STDIO transport for interactive sessions.

How to install

Prerequisites:

  • Docker installed on your machine (recommended for quick start)
  • Optional: Go and environment for building from source if you prefer compiling locally

Installation steps (Docker):

  1. Pull and run the MCP-Trino container: docker run -d --name mcp-trino -p 8080:8080 ghcr.io/tuannvm/mcp-trino:latest

  2. Configure environment variables (example): export TRINO_HOST=localhost export TRINO_USER=trino export TRINO_SCHEME=http export MCP_TRANSPORT=http export OAUTH_PROVIDER=okta # if OAuth is desired

  3. Verify the server is running by curling the MCP HTTP endpoint or using your MCP client: curl http://localhost:8080/mcp/health

Alternative: Build from source (Go) and run locally (if you prefer to run the Go binary directly):

  1. git clone https://github.com/tuannvm/mcp-trino.git
  2. cd mcp-trino
  3. go build -o mcp-trino ./...
  4. export TRINO_HOST=localhost TRINO_USER=trino
  5. ./mcp-trino

Additional notes

Tips and considerations:

  • If you enable OAuth, choose native mode for zero server-side secrets or proxy mode for centralized credential management. Ensure OIDC issuer and audience are correctly configured in your environment.
  • For performance, you can limit Trino schemas via TRINO_ALLOWED_SCHEMAS to reduce search space and improve responsiveness.
  • Impersonation is supported by setting TRINO_ENABLE_IMPERSONATION and TRINO_IMPERSONATION_FIELD (options: username, email, subject).
  • The MCP server is compatible with multiple clients (Claude Desktop, Claude Code, Cursor, Windsurf, ChatWise). Ensure clients are updated to use the Tools API as documented in docs/integrations.md and docs/tools.md.
  • If you deploy behind a reverse proxy, verify JWT token handling and headers like X-Trino-Client-Tags and X-Trino-Client-Info are preserved end-to-end.
  • When using Docker, consider mapping configuration files or secrets as volumes if you store credentials outside environment variables.

Related MCP Servers

Sponsor this space

Reach thousands of developers