MCP Directory

How to add Trino MCP Server to Cursor

High-performance Go MCP server that lets AI assistants run SQL queries and explore data across a Trino cluster. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 109 · stdio · oauth

Cursor config for Trino MCP Server

brew install tuannvm/mcp/mcp-trino
{
  "mcpServers": {
    "trino-mcp-server": {
      "command": "mcp-trino",
      "args": [],
      "env": {
        "TRINO_HOST": "<HOST>",
        "TRINO_PORT": "<PORT>",
        "TRINO_USER": "<USERNAME>",
        "TRINO_PASSWORD": "<PASSWORD>"
      }
    }
  }
}

Setup steps

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the Trino MCP Server config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of Trino MCP Server's tools to confirm it's connected.

Before you start

  • A reachable Trino (or PrestoSQL) cluster with host, port, and user credentials
  • The mcp-trino binary (installed via Homebrew or the install.sh script) or Docker to run ghcr.io/tuannvm/mcp-trino
  • For production HTTP/OAuth deployments: an OIDC provider (Okta, Google, or Azure AD) and TLS certificates

What Trino MCP Server can do in Cursor

execute_query

Execute a SQL query against Trino with full SQL support for complex analytical queries; returns columns and row data.

list_catalogs

List all catalogs available in the Trino server, providing a comprehensive view of the data ecosystem.

list_schemas

List all schemas in a given catalog to help navigate the data hierarchy.

list_tables

List all tables in a given catalog and schema, exposing the available datasets.

get_table_schema

Get the schema of a table, including column names, data types, and nullability, for better query planning.

explain_query

Analyze a Trino query execution plan without running it, showing distributed execution stages and resource estimates.

Security

Secrets (e.g. TRINO_PASSWORD) are read purely from environment variables; the docs recommend injecting them via a secrets CLI (1Password `op run`, Vault, or Kubernetes Secrets) rather than committing them — see docs/secrets.md for shell-history, process-list, and env-var leakage nuances. For production HTTP deployments the server supports OAuth 2.1 (native or proxy mode) with JWT validation, PKCE, and token caching; JWT_SECRET is required for multi-pod deployments. User impersonation (TRINO_ENABLE_IMPERSONATION) is opt-in and relies on Trino to enforce per-user permissions.

Trino MCP Server + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Trino MCP Server config there under the "mcpServers" key and restart the client.

Is Trino MCP Server safe to use with Cursor?

Secrets (e.g. TRINO_PASSWORD) are read purely from environment variables; the docs recommend injecting them via a secrets CLI (1Password `op run`, Vault, or Kubernetes Secrets) rather than committing them — see docs/secrets.md for shell-history, process-list, and env-var leakage nuances. For production HTTP deployments the server supports OAuth 2.1 (native or proxy mode) with JWT validation, PKCE, and token caching; JWT_SECRET is required for multi-pod deployments. User impersonation (TRINO_ENABLE_IMPERSONATION) is opt-in and relies on Trino to enforce per-user permissions.

What transports does the server support?

Both STDIO (default, used by Claude Desktop/Windsurf) and StreamableHTTP at the /mcp endpoint (recommended for web clients and remote deployments), with backward-compatible SSE at /sse. Set MCP_TRANSPORT=http to enable HTTP mode.

How is authentication handled?

Authentication is optional. For remote/HTTP deployments the server supports OAuth 2.1 via the oauth-mcp-proxy library with HMAC, Okta, Google, and Azure AD providers, in either native mode (client handles OAuth, zero server-side secrets) or proxy mode. Remote clients pass a JWT via an Authorization: Bearer header.

Can I limit which schemas the AI can see?

Yes. Set TRINO_ALLOWED_SCHEMAS (e.g. hive.analytics,hive.marts) to focus the assistant on specific schemas, which the docs note can yield a 10-20x performance improvement.

View repo Full Trino MCP Server page