Trino MCP Server
MCP ServerFree** - A Go implementation of a Model Context Protocol (MCP) server for Trino, enabling LLM models to query distributed SQL databases through standardized tools.
Capabilities12 decomposed
mcp-compliant trino query execution via standardized tool interface
Medium confidenceImplements the Model Context Protocol (MCP) specification to expose Trino SQL query execution as a discoverable, schema-validated tool that LLM clients can invoke. The server translates MCP tool calls into Trino JDBC connections, executes parameterized SQL queries, and returns structured result sets with type information. This enables AI assistants to execute complex analytical queries against distributed data sources without embedding Trino-specific knowledge.
Go-based MCP server implementation with native Trino JDBC driver integration, providing sub-100ms tool discovery and query execution compared to Python-based alternatives that incur interpreter overhead. Uses MCP's native tool schema validation to prevent malformed queries before transmission to Trino.
Faster and lighter than Python MCP servers for Trino (e.g., Anthropic's reference implementations) due to Go's compiled binary and minimal runtime, while maintaining full MCP specification compliance for seamless client compatibility.
distributed database schema discovery and metadata introspection
Medium confidenceProvides four MCP tools (list_catalogs, list_schemas, list_tables, get_table_schema) that query Trino's system catalog to enumerate available data sources, their hierarchical structure, and column-level metadata including types and nullability. The server caches catalog structure in memory and refreshes on demand, enabling LLMs to explore multi-petabyte data warehouses without loading full schema into context.
Implements hierarchical metadata discovery (catalog → schema → table → column) as separate MCP tools, allowing LLMs to progressively explore schema without loading entire warehouse structure. Uses Trino's native information_schema queries rather than custom metadata stores, ensuring consistency with actual database state.
More efficient than REST API wrappers around Trino's UI because it queries system.information_schema directly and exposes results as structured MCP tools that LLMs can reason about, versus requiring LLMs to parse HTML or navigate REST endpoints.
query execution timeout and cancellation with graceful cleanup
Medium confidenceEnforces configurable query execution timeouts and allows clients to cancel long-running queries via MCP cancellation requests. When a timeout or cancellation occurs, the server gracefully closes the Trino connection and releases resources, preventing resource leaks. Timeout errors are reported to the client with clear messages indicating the timeout duration.
Implements query timeout and cancellation using Go's context.Context with deadline support, allowing graceful cleanup of resources even if queries fail or timeout. Timeout errors are reported clearly to the client.
More responsive than relying solely on Trino's query timeout because it enforces timeout at the MCP server level. Simpler than implementing custom query monitoring because it uses Go's built-in context cancellation.
error handling and reporting with trino-specific error codes and messages
Medium confidenceCaptures errors from Trino query execution and translates them into clear, actionable error messages that are returned to the MCP client. Trino-specific error codes (e.g., SYNTAX_ERROR, PERMISSION_DENIED) are preserved and included in error responses, enabling LLM clients to understand and potentially recover from errors. Stack traces are logged server-side but not exposed to clients to avoid information leakage.
Translates Trino JDBC errors into MCP-compliant error responses with Trino-specific error codes preserved, enabling LLM clients to understand and potentially recover from errors. Stack traces are logged server-side but not exposed to clients.
More informative than generic error messages because it preserves Trino error codes and context. More secure than exposing full stack traces because it sanitizes error information before sending to clients.
dual-transport mcp server with stdio and http/sse support
Medium confidenceImplements both STDIO (standard input/output) and HTTP/Server-Sent Events (SSE) transport protocols for MCP communication, allowing flexible deployment across different client architectures. STDIO transport is used by desktop clients (Claude Desktop, Cursor) via subprocess invocation, while HTTP/SSE enables remote server deployments and web-based integrations. The server automatically detects transport mode at startup and routes requests accordingly.
Single Go binary supports both STDIO and HTTP/SSE transports with automatic detection, eliminating the need for separate server implementations or transport adapters. Uses Go's native http.Server with SSE streaming for HTTP mode, avoiding external dependencies for transport layer.
More flexible than Python MCP servers that typically support only one transport, and simpler than Node.js implementations that require separate HTTP and STDIO entry points. Compiled Go binary has minimal startup overhead (~50ms) compared to interpreted alternatives.
read-only query execution with configurable permission controls
Medium confidenceEnforces read-only SQL execution by default, parsing incoming queries to detect and block INSERT, UPDATE, DELETE, DROP, and ALTER statements before transmission to Trino. Administrators can configure granular permissions (e.g., allow specific schemas, deny certain tables) via configuration files. The server validates query intent against the permission policy and returns clear error messages for blocked operations, preventing accidental or malicious data modifications through LLM-driven queries.
Implements query-level permission validation in the MCP server layer before queries reach Trino, providing defense-in-depth alongside database-level permissions. Uses configurable policy files to define allowed operations per schema/table, enabling fine-grained control without modifying Trino configuration.
More granular than Trino's native role-based access control because it operates at the MCP tool level, allowing per-query validation and LLM-friendly error messages. Simpler than implementing custom Trino plugins because it requires only configuration file changes, not Java development.
multi-platform binary distribution with docker and homebrew packaging
Medium confidenceProvides pre-built binaries for macOS (Intel/ARM), Linux (x86_64/ARM64), and Windows (x86_64), plus Docker image distribution via GitHub Container Registry and Homebrew package for macOS/Linux. This eliminates the need to compile from source for most users and enables one-command installation and updates. The Docker image includes Trino JDBC driver and all dependencies, simplifying containerized deployments.
Distributes pre-built binaries across 6+ platform/architecture combinations plus Docker image and Homebrew formula from a single GitHub repository, reducing friction for users who don't want to compile Go. Uses GitHub Actions for automated cross-platform builds and container registry publishing.
Faster to deploy than Python MCP servers that require pip install + dependency resolution, and more accessible than source-only distributions because users avoid Go toolchain setup. Docker image is smaller than Node.js-based alternatives due to Go's minimal runtime.
ai assistant platform compatibility layer with mcp protocol translation
Medium confidenceImplements the Model Context Protocol (MCP) specification to ensure compatibility with multiple AI assistant platforms (Claude Desktop, Cursor, Windsurf, ChatWise) without platform-specific code. The server exposes tools via MCP's standardized tool discovery mechanism, allowing any MCP-compatible client to discover and invoke Trino query capabilities. This abstraction layer decouples the MCP server from client implementation details.
Implements MCP specification without client-specific extensions, ensuring that the same server binary works with any MCP-compatible client. Uses MCP's native tool discovery and schema validation to provide consistent behavior across platforms.
More portable than custom integrations (e.g., Cursor-specific plugins) because it relies on the standardized MCP protocol rather than proprietary APIs. Avoids the fragmentation of maintaining separate plugins for each AI assistant platform.
parameterized sql query execution with type-safe input binding
Medium confidenceAccepts SQL queries with parameter placeholders (e.g., ? or $1 syntax) and binds user-provided values using Trino's native parameterized query API, preventing SQL injection attacks. The server validates parameter types against the query's expected input types and returns clear error messages for type mismatches. This enables LLMs to construct queries dynamically while maintaining security and correctness.
Uses Trino's native JDBC parameterized query API for type-safe binding, avoiding string interpolation and SQL injection risks. Validates parameter types against query expectations before execution, providing early error detection.
More secure than string-based query construction because it relies on database-level parameter binding rather than client-side escaping. Simpler than ORM-based approaches because it works with raw SQL while maintaining safety.
configuration-driven server initialization with environment variable override
Medium confidenceLoads server configuration (Trino connection details, transport settings, permission policies) from YAML/JSON files or environment variables, enabling flexible deployment across development, staging, and production environments without code changes. Configuration is validated at startup and errors are reported clearly, preventing silent misconfigurations. Environment variables override file-based settings, allowing containerized deployments to inject secrets and connection details.
Supports both file-based (YAML/JSON) and environment variable configuration with environment variables taking precedence, enabling flexible deployment patterns from the same binary. Configuration is validated at startup with clear error messages, preventing silent misconfigurations.
More flexible than hardcoded configuration because it supports multiple sources (files + environment variables) and environment variable override. Simpler than custom configuration frameworks because it uses standard YAML/JSON formats.
trino jdbc connection pooling with configurable pool size and timeout
Medium confidenceManages a pool of Trino JDBC connections with configurable pool size, connection timeout, and idle timeout settings. The server reuses connections across multiple queries to reduce connection overhead, and automatically closes idle connections to free resources. Connection pool metrics (active connections, queued requests) are available for monitoring and debugging.
Implements connection pooling in Go using the database/sql package with configurable pool parameters, avoiding the overhead of creating new connections for each query. Pool metrics are available for monitoring and debugging.
More efficient than creating a new connection per query because it reuses connections across multiple queries, reducing latency and resource overhead. Simpler than external connection pooling solutions (PgBouncer, Pgpool) because it's built into the MCP server.
query result streaming with configurable batch size and memory limits
Medium confidenceStreams query results from Trino in batches rather than loading the entire result set into memory, enabling efficient handling of large result sets without memory exhaustion. Batch size and memory limits are configurable, allowing tuning for different deployment environments. Results are streamed to the MCP client as they become available, reducing latency for queries that return large datasets.
Implements streaming result handling in Go using goroutines and channels, allowing efficient processing of large result sets without loading entire datasets into memory. Batch size and memory limits are configurable for different deployment scenarios.
More memory-efficient than buffering entire result sets because it streams results in batches. More flexible than fixed pagination because batch size is configurable per deployment.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with Trino MCP Server, ranked by overlap. Discovered automatically through the match graph.
SchemaCrawler
** - Connect to any relational database, and be able to get valid SQL, and ask questions like what does a certain column prefix mean.
Database
** (by Legion AI) - Universal database MCP server supporting multiple database types including PostgreSQL, Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite
CockroachDB
** - A Model Context Protocol server for managing, monitoring, and querying data in [CockroachDB](https://cockroachlabs.com).
run-sql-connectorx
** - Execute SQL (PostgreSQL, MariaDB, BigQuery, MS SQL Server, RedShift, etc.) via ConnectorX and stream results to CSV/Parquet. MCP tool: run_sql.
SQLite
** - Database interaction and business intelligence capabilities.
Apache Doris
** - MCP Server For [Apache Doris](https://doris.apache.org/), an MPP-based real-time data warehouse.
Best For
- ✓AI assistant developers integrating Trino analytics into LLM workflows
- ✓Teams building data exploration agents that need standardized database access
- ✓Organizations deploying Claude Desktop or Cursor with enterprise Trino backends
- ✓Data analysts using Claude/Cursor to explore unfamiliar Trino schemas
- ✓LLM-powered data discovery agents that need to reason about available datasets
- ✓Teams with multi-tenant Trino deployments where schema visibility is role-based
- ✓Production deployments where query runaway is a risk
- ✓Multi-tenant environments where one user's query shouldn't starve others
Known Limitations
- ⚠Query execution is synchronous — long-running queries (>30s) may timeout depending on MCP client timeout settings
- ⚠No built-in query result pagination — large result sets are returned in full, potentially exceeding token limits
- ⚠MCP tool schema is static at server startup; schema changes require server restart to reflect new tables/columns
- ⚠Metadata discovery is read-only and reflects Trino's system.information_schema; custom metadata (tags, descriptions) are not exposed
- ⚠Large catalogs (1000+ tables) may return slow responses due to Trino's catalog enumeration latency, not MCP server overhead
- ⚠No caching layer — each metadata query hits Trino's coordinator; high-frequency discovery calls can impact cluster performance
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
** - A Go implementation of a Model Context Protocol (MCP) server for Trino, enabling LLM models to query distributed SQL databases through standardized tools.
Categories
Alternatives to Trino MCP Server
Are you the builder of Trino MCP Server?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →