# Trino MCP — OAuth 2.1 + Query CLI for Data Warehouses > Trino MCP is a Go MCP server and CLI for Trino with OAuth 2.1 support, letting agents query catalogs and schemas with traceable user identity. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use 1. Install: ```bash brew install tuannvm/mcp/mcp-trino # or curl -fsSL https://raw.githubusercontent.com/tuannvm/mcp-trino/main/install.sh | bash ``` 2. Run (local dev): ```bash export TRINO_HOST=localhost TRINO_USER=trino mcp-trino ``` 3. Verify CLI mode: ```bash mcp-trino catalogs mcp-trino query "SELECT 1" ``` ## Intro Trino MCP is a Go MCP server and CLI for Trino with OAuth 2.1 support, letting agents query catalogs and schemas with traceable user identity. - **Best for:** data platform teams that want MCP access to Trino plus an operator-friendly CLI for debugging and smoke tests - **Works with:** Trino, Go-based binary via Homebrew or install script, OAuth 2.1 for production deployments - **Setup time:** 10-30 minutes ## Practical Notes - Quant: the CLI supports catalogs/schemas/tables/describe/explain commands—use it as a deterministic health check for agent tooling. - Quant: for production, adopt OAuth so every query is attributable to a user identity instead of a shared service token. ## Why it matters Trino deployments often have many catalogs and mixed governance. This server is notable because it treats OAuth identity and a query-first CLI as core features. - Installs as a single binary (Homebrew or one-liner), lowering friction for operators. - CLI mode makes it easy to verify connectivity before you involve an LLM client. - OAuth guidance and user identity tagging align with data governance expectations. ## Rollout pattern - Use CLI mode to validate baseline connectivity, then connect an MCP client for natural-language workflows. - Create a least-privilege Trino user for agent workflows; keep admin capabilities out-of-band. - Enable OAuth when you move beyond a single-user laptop setup to shared deployments. ## Watchouts A powerful query tool can become an exfiltration path. Apply catalog/schema allowlists, result-size limits, and audit logging before broad rollout. ### FAQ **Q: Is the CLI required?** A: No, but it is a great verification tool. Use the CLI for deterministic smoke tests before LLM-driven queries. **Q: What does OAuth buy me?** A: User-level attribution and safer shared deployments, instead of one shared token for everyone. **Q: How do I start safely?** A: Use a staging Trino environment, restrict catalogs, and keep query limits small until you understand agent behavior. ## Source & Thanks > Source: https://github.com/tuannvm/mcp-trino > License: MIT > GitHub stars: 103 · forks: 45 --- ## 快速使用 1. 安装: ```bash brew install tuannvm/mcp/mcp-trino # 或 curl -fsSL https://raw.githubusercontent.com/tuannvm/mcp-trino/main/install.sh | bash ``` 2. 运行(本地开发): ```bash export TRINO_HOST=localhost TRINO_USER=trino mcp-trino ``` 3. 验证 CLI: ```bash mcp-trino catalogs mcp-trino query "SELECT 1" ``` ## 简介 Trino MCP 是 Go 实现的 MCP Server + CLI,支持 OAuth 2.1 与身份追踪,让 Agent 能在 Trino 的多 catalog/多 schema 环境里安全查询并保留可审计的用户归因。 - **适合谁:** 数据平台团队:既要 Trino 的 MCP 接入,又要可用于排障与冒烟的 CLI - **可搭配:** Trino、Homebrew/安装脚本分发的 Go 二进制、生产部署可用 OAuth 2.1 - **准备时间:** 10-30 分钟 ## 实战建议 - 量化信息:CLI 覆盖 catalogs/schemas/tables/describe/explain 等命令,可做确定性的健康检查。 - 量化信息:生产环境建议启用 OAuth,让每次查询都能归因到用户身份,而不是共享 token。 ## 为什么值得收录 Trino 往往有多 catalog、多权限边界;这个项目的特点是把 OAuth 身份与查询型 CLI 当作核心能力,而不是可选配件。 - 单二进制安装(Homebrew/一行脚本)对运维很友好。 - 先用 CLI 验证连通性,再接入 LLM 客户端,排障更可控。 - OAuth 与身份标记符合数据治理对可审计性的要求。 ## 落地路径 - 先用 CLI 验证基础连通性,再用 MCP 客户端做自然语言工作流。 - 为 Agent 准备最小权限 Trino 用户;管理能力独立隔离。 - 从单机走向共享部署时开启 OAuth,避免所有人共用一个 token。 ## 注意事项 强查询工具可能变成数据外发路径。上线前应加 allowlist、结果大小限制与审计日志。 ### FAQ **一定要用 CLI 吗?** 答:不一定,但它非常适合做确定性冒烟测试,建议先用 CLI 再上 LLM。 **OAuth 能带来什么?** 答:用户级归因与更安全的共享部署,避免所有请求都来自同一个 token。 **如何安全起步?** 答:先用 staging 环境、限制 catalog,并把查询限制设小,观察 Agent 行为后再放开。 ## 来源与感谢 > Source: https://github.com/tuannvm/mcp-trino > License: MIT > GitHub stars: 103 · forks: 45 --- Source: https://tokrepo.com/en/workflows/trino-mcp-oauth-2-1-query-cli-for-data-warehouses Author: MCP Hub