mcp-trino
A fast Go-based MCP server for seamless Trino SQL access.
Key Features
Use Cases
README
Trino MCP Server in Go
A high-performance Model Context Protocol (MCP) server for Trino implemented in Go. This project enables AI assistants to seamlessly interact with Trino's distributed SQL query engine through standardized MCP tools.
Overview
This project implements a Model Context Protocol (MCP) server for Trino in Go. It enables AI assistants to access Trino's distributed SQL query engine through standardized MCP tools.
Trino (formerly PrestoSQL) is a powerful distributed SQL query engine designed for fast analytics on large datasets.
Architecture
graph TB
subgraph "AI Clients"
CC[Claude Code]
CD[Claude Desktop]
CR[Cursor]
WS[Windsurf]
CW[ChatWise]
end
subgraph "Authentication (Optional)"
OP[OAuth Provider<br/>Okta/Google/Azure AD]
JWT[JWT Tokens]
end
subgraph "MCP Server (mcp-trino)"
HTTP[HTTP Transport<br/>/mcp endpoint]
STDIO[STDIO Transport]
AUTH[OAuth Middleware]
TOOLS[MCP Tools<br/>• execute_query<br/>• list_catalogs<br/>• list_schemas<br/>• list_tables<br/>• get_table_schema<br/>• explain_query]
end
subgraph "Data Layer"
TRINO[Trino Cluster<br/>Distributed SQL Engine]
CATALOGS[Data Sources<br/>• PostgreSQL<br/>• MySQL<br/>• S3/Hive<br/>• BigQuery<br/>• MongoDB]
end
%% Connections
CC -.->|OAuth Flow| OP
OP -.->|JWT Token| JWT
CC -->|HTTP + JWT| HTTP
CD -->|STDIO| STDIO
CR -->|HTTP + JWT| HTTP
WS -->|STDIO| STDIO
CW -->|HTTP + JWT| HTTP
HTTP --> AUTH
AUTH -->|Validated| TOOLS
STDIO --> TOOLS
TOOLS -->|SQL Queries| TRINO
TRINO --> CATALOGS
%% Styling
classDef client fill:#e1f5fe
classDef auth fill:#f3e5f5
classDef server fill:#e8f5e8
classDef data fill:#fff3e0
class CC,CD,CR,WS,CW client
class OP,JWT auth
class HTTP,STDIO,AUTH,TOOLS server
class TRINO,CATALOGS data
Key Components:
- AI Clients: Various MCP-compatible applications
- Authentication: Optional OAuth 2.0 with OIDC providers
- MCP Server: Go-based server with dual transport support
- Data Layer: Trino cluster connecting to multiple data sources
Features
- ✅ MCP server implementation in Go
- ✅ Trino SQL query execution through MCP tools
- ✅ Catalog, schema, and table discovery
- ✅ Docker container support
- ✅ Supports both STDIO and HTTP transports
- ✅ OAuth 2.1 authentication via oauth-mcp-proxy library
- 4 Providers: HMAC, Okta, Google, Azure AD
- Native mode: Client handles OAuth directly (zero server-side secrets)
- Proxy mode: Server proxies OAuth flow for simple clients
- Production-ready: Token caching, PKCE, defense-in-depth security
- Reusable: OAuth library available for any Go MCP server
- ✅ StreamableHTTP support with JWT authentication (upgraded from SSE)
- ✅ Backward compatibility with SSE endpoints
- ✅ Compatible with Cursor, Claude Desktop, Windsurf, ChatWise, and any MCP-compatible clients.
Installation & Quick Start
Install:
# Homebrew
brew install tuannvm/mcp/mcp-trino
# Or one-liner (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/tuannvm/mcp-trino/main/install.sh | bash
Run (Local Development):
export TRINO_HOST=localhost TRINO_USER=trino
mcp-trino
For production deployment with OAuth, see Deployment Guide and OAuth Architecture.
Usage
Supported Clients: Claude Desktop, Claude Code, Cursor, Windsurf, ChatWise
Available Tools: execute_query, list_catalogs, list_schemas, list_tables, get_table_schema, explain_query
For client integration and tool documentation, see Integration Guide and Tools Reference.
Configuration
Key Variables: TRINO_HOST, TRINO_USER, TRINO_SCHEME, MCP_TRANSPORT, OAUTH_PROVIDER
OAuth Configuration:
# Native mode (most secure - zero server-side secrets)
export OAUTH_ENABLED=true OAUTH_MODE=native OAUTH_PROVIDER=okta
export OIDC_ISSUER=https://company.okta.com OIDC_AUDIENCE=https://mcp-server.com
# Proxy mode (centralized credential management)
export OAUTH_MODE=proxy OIDC_CLIENT_ID=app-id OIDC_CLIENT_SECRET=secret
export OAUTH_REDIRECT_URI=https://mcp-server.com/oauth/callback # Fixed mode (localhost-only)
export OAUTH_REDIRECT_URI=https://app1.com/cb,https://app2.com/cb # Allowlist mode
export JWT_SECRET=$(openssl rand -hex 32) # Required for multi-pod deployments
Performance Optimization:
# Focus AI on specific schemas only (10-20x performance improvement)
export TRINO_ALLOWED_SCHEMAS="hive.analytics,hive.marts,hive.reporting"
For complete configuration, see Deployment Guide, OAuth Architecture, and Allowlists Guide.
OAuth Implementation
mcp-trino uses oauth-mcp-proxy - a standalone OAuth 2.1 library for Go MCP servers.
Why a separate library?
- ✅ Reusable across any Go MCP server
- ✅ Independent testing and versioning
- ✅ Dedicated documentation and examples
- ✅ Community-maintained OAuth implementation
For OAuth details:
- oauth-mcp-proxy Documentation - Complete OAuth guide
- Provider Setup Guides - Okta, Google, Azure AD
- Security Best Practices - Production security
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Projects
- oauth-mcp-proxy - OAuth 2.1 authentication library used by mcp-trino (reusable for any Go MCP server)
CI/CD and Releases
This project uses GitHub Actions for continuous integration and GoReleaser for automated releases.
Continuous Integration Checks
Our CI pipeline performs the following checks on all PRs and commits to the main branch:
Code Quality
- Linting: Using golangci-lint to check for common code issues and style violations
- Go Module Verification: Ensuring go.mod and go.sum are properly maintained
- Formatting: Verifying code is properly formatted with gofmt
Security
- Vulnerability Scanning: Using govulncheck to check for known vulnerabilities in dependencies
- Dependency Scanning: Using Trivy to scan for vulnerabilities in dependencies (CRITICAL, HIGH, and MEDIUM)
- SBOM Generation: Creating a Software Bill of Materials for dependency tracking
- SLSA Provenance: Creating verifiable build provenance for supply chain security
Testing
- Unit Tests: Running tests with race detection and code coverage reporting
- Build Verification: Ensuring the codebase builds successfully
CI/CD Security
- Least Privilege: Workflows run with minimum required permissions
- Pinned Versions: All GitHub Actions use specific versions to prevent supply chain attacks
- Dependency Updates: Automated dependency updates via Dependabot
Release Process
When changes are merged to the main branch:
- CI checks are run to validate code quality and security
- If successful, a new release is automatically created with:
- Semantic versioning based on commit messages
- Binary builds for multiple platforms
- Docker image publishing to GitHub Container Registry
- SBOM and provenance attestation
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Topics
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
go-mcp-mysql
Zero-burden Model Context Protocol (MCP) server for MySQL automation.
go-mcp-mysql is a ready-to-use server that implements the Model Context Protocol (MCP) for seamless interaction and automation with MySQL databases. Written in Go, it enables users to perform CRUD operations and check query plans without requiring a Node.js or Python environment. The server supports both command-line and DSN configurations, includes a read-only mode, and features a set of tools for managing schema and data. It is designed for low-overhead deployment and flexible MySQL automation workflows.
- ⭐ 46
- MCP
- Zhwt/go-mcp-mysql
XiYan MCP Server
A server enabling natural language queries to SQL databases via the Model Context Protocol.
XiYan MCP Server is a Model Context Protocol (MCP) compliant server that allows users to query SQL databases such as MySQL and PostgreSQL using natural language. It leverages the XiYanSQL model, providing state-of-the-art text-to-SQL translation and supports both general LLMs and local deployment for enhanced security. The server lists available database tables as resources and can read table contents, making it simple to integrate with different applications.
- ⭐ 218
- MCP
- XGenerationLab/xiyan_mcp_server
MCP libSQL by xexr
Secure, protocol-compliant libSQL database server for MCP-enabled clients.
MCP libSQL by xexr provides a Model Context Protocol (MCP) server designed for secure database access and management via libSQL. It enables database operations—such as querying, table management, and schema inspection—through standardized MCP tools, ensuring compatibility with clients like Claude Desktop and Cursor. The project emphasizes robust security validation, audit logging, and comprehensive error handling. Users benefit from production-ready deployment, extensive test coverage, and streamlined integration with MCP-compatible platforms.
- ⭐ 16
- MCP
- Xexr/mcp-libsql
MCP AI SOC Sher
AI-driven SOC Text2SQL framework with security threat analysis
MCP AI SOC Sher is an advanced AI-powered platform that converts natural language prompts into optimized SQL queries using a Model Context Protocol-based server setup. It supports Text2SQL translation, real-time query processing, and security threat analysis across multiple database types. The tool offers multiple interfaces including STDIO, SSE, and REST API for flexible integration, and features in-depth SOC (Security Operations Center) monitoring capabilities. Built-in security features include SQL injection detection, sensitive table monitoring, and configurable security levels.
- ⭐ 5
- MCP
- akramIOT/MCP_AI_SOC_Sher
MXCP
Enterprise-Grade Model Context Protocol Framework for AI Applications
MXCP is an enterprise-ready framework that implements the Model Context Protocol (MCP) for building secure, production-grade AI application servers. It introduces a structured methodology focused on data modeling, robust service design, policy enforcement, and comprehensive testing, integrated with strong security and audit capabilities. The framework enables rapid development and deployment of AI tools, supporting both SQL and Python environments, with built-in telemetry and drift detection for reliability and compliance.
- ⭐ 49
- MCP
- raw-labs/mxcp
mcp_mysql_server_pro
Advanced MySQL server tool with Model Context Protocol support and database health analysis.
mcp_mysql_server_pro enables seamless MySQL database operations and analysis, supporting all Model Context Protocol (MCP) transfer modes including STDIO, SSE, and Streamable HTTP. It provides flexible permission control, advanced anomaly detection, and health status monitoring, with easy extensibility via custom tools. OAuth2.0 authentication is supported, and users can execute multi-statement SQL queries, perform index and lock analysis, and leverage prompt template invocation.
- ⭐ 273
- MCP
- wenb1n-dev/mysql_mcp_server_pro
Didn't find tool you were looking for?