MCP server for Trino data warehouses. Query, analyze plans, and explore schemas.
MCP server for Trino data warehouses that enables querying, analyzing plans, and exploring schemas. It is published under the name “io.github.txn2/mcp-trino” with the topics “mcp-server” and “trino” and a repository-focused readme excerpt pointing to its official site and project metadata.
🛠️ Key Features
Query Trino data warehouses
Analyze query plans
Explore schemas
🚀 Use Cases
Investigate Trino table and schema structures
Review and understand execution/analysis plans for Trino queries
Support Trino querying workflows via MCP
⚡ Developer Benefits
MCP server implementation targeting Trino
Repository documentation references Go ecosystem project details (license, Go reference, and quality reporting badges)
⚠️ Limitations
Provided excerpt does not specify available tools, configuration options, authentication, or runtime behavior (e.g., toolCount).
A Model Context Protocol (MCP) server for Trino, enabling AI assistants to query and explore data warehouses with optional semantic context from metadata catalogs.
AI assistants excel at querying data but lack organizational context: which tables are trustworthy, what metrics mean, and which columns contain sensitive data. mcp-trino bridges this gap by connecting Trino to AI assistants through the MCP protocol, with an optional semantic layer that surfaces business metadata alongside query results.
MCP Data Platform Ecosystem
mcp-trino is part of a broader suite of open-source MCP servers designed to work together as a composable data platform. Each component can run standalone or be combined to give AI assistants unified access to storage, query engines, and metadata catalogs.
Execute read-only SQL queries (SELECT, SHOW, DESCRIBE) with limit/timeout control
trino_execute
Execute any SQL including write operations (INSERT, UPDATE, DELETE, CREATE, DROP)
trino_explain
Get execution plans (logical/distributed/io/validate)
trino_browse
Browse catalog hierarchy: list catalogs, schemas, or tables
trino_describe_table
Get columns, sample data, and semantic context (if configured)
trino_list_connections
List all configured server connections
Semantic Layer
AI agents operate more reliably when they understand organizational context: not just table structures, but which datasets are production-ready, what business terms mean, and which columns require careful handling.
mcp-trino's semantic layer integrates with metadata catalogs to surface this context alongside query results:
Metadata
Description
Descriptions
Business-friendly explanations of tables and columns
Ownership
Data stewards and technical owners
Tags & Domains
Classification labels and business domains
Glossary Terms
Links to formal business definitions
Data Quality
Freshness scores and quality metrics
Sensitivity
PII and sensitive data markers at column level
Lineage
Upstream and downstream data dependencies
Providers
Provider
Description
DataHub
Connect to DataHub's GraphQL API for enterprise metadata
Static Files
Load metadata from YAML or JSON files with hot-reload
Custom
Implement the semantic.Provider interface for any catalog
Connect to multiple Trino servers from a single installation. Configure your primary server with the standard environment variables, then add additional servers via JSON:
Use the connection parameter in any tool to target a specific server:
code
"Query the staging server: SELECT * FROM users LIMIT 10"
→ trino_query(sql="...", connection="staging")
Use trino_list_connections to discover available connections.
File-Based Configuration
For production deployments using Kubernetes ConfigMaps, Vault, or other secret management systems, mcp-trino supports file-based configuration:
yaml
# config.yamltrino:host:trino.example.comport:443user:${TRINO_USER}# Supports env var expansionpassword:${TRINO_PASSWORD}# Secrets can come from envcatalog:hiveschema:defaultssl:truetimeout:120stoolkit:default_limit:1000max_limit:10000default_timeout:120smax_timeout:300sextensions:logging:truereadonly:trueerrors:true
Load configuration in your custom server:
go
import"github.com/txn2/mcp-trino/pkg/extensions"// Load from file with env var overrides
cfg, err := extensions.LoadConfig("/etc/mcp-trino/config.yaml")
// Convert to individual configs
clientCfg := cfg.ClientConfig()
toolsCfg := cfg.ToolsConfig()
extCfg := cfg.ExtConfig()
Using as a Library
mcp-trino is designed to be composable. You can import its tools into your own MCP server:
go
package main
import (
"context""log""github.com/modelcontextprotocol/go-sdk/mcp""github.com/txn2/mcp-trino/pkg/client""github.com/txn2/mcp-trino/pkg/tools"
)
funcmain() {
// Create your MCP server
server := mcp.NewServer(&mcp.Implementation{
Name: "my-data-server",
Version: "1.0.0",
}, nil)
// Create Trino client
trinoClient, err := client.New(client.Config{
Host: "trino.example.com",
Port: 443,
User: "service_user",
SSL: true,
Catalog: "hive",
Schema: "analytics",
})
if err != nil {
log.Fatal(err)
}
defer trinoClient.Close()
// Add Trino tools to your server
toolkit := tools.NewToolkit(trinoClient, tools.Config{
DefaultLimit: 1000,
MaxLimit: 10000,
})
toolkit.RegisterAll(server)
// Add your own custom tools here...// mcp.AddTool(server, &mcp.Tool{...}, handler)// Run the serverif err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {
log.Fatal(err)
}
}
Extensions
The standalone server includes optional extensions that can be enabled via environment variables:
Read-Only: ReadOnly interceptor enabled by default blocks modification statements
Access Control: Configure Trino roles and catalog access for defense in depth
Development
bash
# Clone the repository
git clone https://github.com/txn2/mcp-trino.git
cd mcp-trino
# Build
make build
# Run tests
make test# Run linter
make lint
# Run all checks
make verify
# Run with a local Trino (e.g., via Docker)
make docker-trino
export TRINO_HOST=localhost
export TRINO_PORT=8080
export TRINO_USER=admin
export TRINO_SSL=false
./mcp-trino
Contributing
We welcome contributions for bug fixes, tests, and documentation. See CONTRIBUTING.md for guidelines.