trino.com
trino.com logo

Trino

Enables SQL query execution against Trino databases with tools for data exploration, schema retrieval, and analysis with...

Created byApr 23, 2025

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.

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
  • Server-Sent Events (SSE) support for Cursor and other MCP clients
  • Compatible with Cursor, Claude Desktop, Windsurf, ChatWise, and any MCP-compatible clients.

Installation

Homebrew (macOS and Linux)

The easiest way to install mcp-trino is using Homebrew:
To update to the latest version:

Alternative Installation Methods

Manual Download

  1. Download the appropriate binary for your platform from the GitHub Releases page.
  1. Place the binary in a directory included in your PATH (e.g., /usr/local/bin on Linux/macOS)
  1. Make it executable (chmod +x mcp-trino on Linux/macOS)

From Source

Downloads

You can download pre-built binaries for your platform:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
Or see all available downloads on the GitHub Releases page.

MCP Integration

This MCP server can be integrated with several AI applications:

Using Docker Image

To use the Docker image instead of a local binary:
Note: The host.docker.internal special DNS name allows the container to connect to services running on the host machine. If your Trino server is running elsewhere, replace with the appropriate host.
This Docker configuration can be used in any of the below applications.

Cursor

To use with Cursor, create or edit ~/.cursor/mcp.json:
Replace the environment variables with your specific Trino configuration.
For HTTP+SSE transport mode (supported for Cursor integration):
Then start the server in a separate terminal with:

Claude Desktop

To use with Claude Desktop, edit your Claude configuration file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
After updating the configuration, restart Claude Desktop. You should see the MCP tools available in the tools menu.

Windsurf

To use with Windsurf, create or edit your mcp_config.json:
Restart Windsurf to apply the changes. The Trino MCP tools will be available to the Cascade AI.

ChatWise

To use with ChatWise, follow these steps:
  1. Open ChatWise and go to Settings
  1. Navigate to the Tools section
  1. Click the "+" icon to add a new tool
  1. Select "Command Line MCP"
  1. Configure with the following details:
Alternatively, you can import the configuration from JSON:
  1. Copy this JSON to your clipboard:
  1. In ChatWise Settings > Tools, click the "+" icon
  1. Select "Import JSON from Clipboard"
  1. Toggle the switch next to the tool to enable it
Once enabled, click the hammer icon below the input box in ChatWise to access Trino MCP tools.

Available MCP Tools

The server provides the following MCP tools:

execute_query

Execute a SQL query against Trino with full SQL support for complex analytical queries.
Sample Prompt:
"How many customers do we have per region? Can you show them in descending order?"
Example:
Response:

list_catalogs

List all catalogs available in the Trino server, providing a comprehensive view of your data ecosystem.
Sample Prompt:
"What databases do we have access to in our Trino environment?"
Example:
Response:

list_schemas

List all schemas in a catalog, helping you navigate through the data hierarchy efficiently.
Sample Prompt:
"What schemas or datasets are available in the tpch catalog?"
Example:
Response:

list_tables

List all tables in a schema, giving you visibility into available datasets.
Sample Prompt:
"What tables are available in the tpch tiny schema? I need to know what data we can query."
Example:
Response:

get_table_schema

Get the schema of a table, understanding the structure of your data for better query planning.
Sample Prompt:
"What columns are in the customer table? I need to know the data types and structure before writing my query."
Example:
Response:
This information is invaluable for understanding the column names, data types, and nullability constraints before writing queries against the table.

End-to-End Example

Here's a complete interaction example showing how an AI assistant might use these tools to answer a business question:
User Query: "Can you help me analyze our biggest customers? I want to know the top 5 customers with the highest account balances."
AI Assistant's workflow:
  1. First, discover available catalogs
  1. Then, find available schemas
  1. Explore available tables
  1. Check the customer table schema
  1. Finally, execute the query
  1. Returns the results to the user:
This seamless workflow demonstrates how the MCP tools enable AI assistants to explore and query data in a conversational manner.

Configuration

The server can be configured using the following environment variables:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
Note: When TRINO_SCHEME is set to "https", TRINO_SSL is automatically set to true regardless of the provided value.
Important: The default connection mode is HTTPS. If you're using an HTTP-only Trino server, you must set TRINO_SCHEME=http in your environment variables.
Security Note: By default, only read-only queries (SELECT, SHOW, DESCRIBE, EXPLAIN) are allowed to prevent SQL injection. If you need to execute write operations or other non-read queries, set TRINO_ALLOW_WRITE_QUERIES=true, but be aware this bypasses this security protection.
For Cursor Integration: When using with Cursor, set MCP_TRANSPORT=http and connect to the /sse endpoint. The server will automatically handle SSE (Server-Sent Events) connections.

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.

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:
  1. CI checks are run to validate code quality and security
  1. If successful, a new release is automatically created with:

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.

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
  • Server-Sent Events (SSE) support for Cursor and other MCP clients
  • Compatible with Cursor, Claude Desktop, Windsurf, ChatWise, and any MCP-compatible clients.

Installation

Homebrew (macOS and Linux)

The easiest way to install mcp-trino is using Homebrew:
To update to the latest version:

Alternative Installation Methods

Manual Download

  1. Download the appropriate binary for your platform from the GitHub Releases page.
  1. Place the binary in a directory included in your PATH (e.g., /usr/local/bin on Linux/macOS)
  1. Make it executable (chmod +x mcp-trino on Linux/macOS)

From Source

Downloads

You can download pre-built binaries for your platform:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
Or see all available downloads on the GitHub Releases page.

MCP Integration

This MCP server can be integrated with several AI applications:

Using Docker Image

To use the Docker image instead of a local binary:
Note: The host.docker.internal special DNS name allows the container to connect to services running on the host machine. If your Trino server is running elsewhere, replace with the appropriate host.
This Docker configuration can be used in any of the below applications.

Cursor

To use with Cursor, create or edit ~/.cursor/mcp.json:
Replace the environment variables with your specific Trino configuration.
For HTTP+SSE transport mode (supported for Cursor integration):
Then start the server in a separate terminal with:

Claude Desktop

To use with Claude Desktop, edit your Claude configuration file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
After updating the configuration, restart Claude Desktop. You should see the MCP tools available in the tools menu.

Windsurf

To use with Windsurf, create or edit your mcp_config.json:
Restart Windsurf to apply the changes. The Trino MCP tools will be available to the Cascade AI.

ChatWise

To use with ChatWise, follow these steps:
  1. Open ChatWise and go to Settings
  1. Navigate to the Tools section
  1. Click the "+" icon to add a new tool
  1. Select "Command Line MCP"
  1. Configure with the following details:
Alternatively, you can import the configuration from JSON:
  1. Copy this JSON to your clipboard:
  1. In ChatWise Settings > Tools, click the "+" icon
  1. Select "Import JSON from Clipboard"
  1. Toggle the switch next to the tool to enable it
Once enabled, click the hammer icon below the input box in ChatWise to access Trino MCP tools.

Available MCP Tools

The server provides the following MCP tools:

execute_query

Execute a SQL query against Trino with full SQL support for complex analytical queries.
Sample Prompt:
"How many customers do we have per region? Can you show them in descending order?"
Example:
Response:

list_catalogs

List all catalogs available in the Trino server, providing a comprehensive view of your data ecosystem.
Sample Prompt:
"What databases do we have access to in our Trino environment?"
Example:
Response:

list_schemas

List all schemas in a catalog, helping you navigate through the data hierarchy efficiently.
Sample Prompt:
"What schemas or datasets are available in the tpch catalog?"
Example:
Response:

list_tables

List all tables in a schema, giving you visibility into available datasets.
Sample Prompt:
"What tables are available in the tpch tiny schema? I need to know what data we can query."
Example:
Response:

get_table_schema

Get the schema of a table, understanding the structure of your data for better query planning.
Sample Prompt:
"What columns are in the customer table? I need to know the data types and structure before writing my query."
Example:
Response:
This information is invaluable for understanding the column names, data types, and nullability constraints before writing queries against the table.

End-to-End Example

Here's a complete interaction example showing how an AI assistant might use these tools to answer a business question:
User Query: "Can you help me analyze our biggest customers? I want to know the top 5 customers with the highest account balances."
AI Assistant's workflow:
  1. First, discover available catalogs
  1. Then, find available schemas
  1. Explore available tables
  1. Check the customer table schema
  1. Finally, execute the query
  1. Returns the results to the user:
This seamless workflow demonstrates how the MCP tools enable AI assistants to explore and query data in a conversational manner.

Configuration

The server can be configured using the following environment variables:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
Note: When TRINO_SCHEME is set to "https", TRINO_SSL is automatically set to true regardless of the provided value.
Important: The default connection mode is HTTPS. If you're using an HTTP-only Trino server, you must set TRINO_SCHEME=http in your environment variables.
Security Note: By default, only read-only queries (SELECT, SHOW, DESCRIBE, EXPLAIN) are allowed to prevent SQL injection. If you need to execute write operations or other non-read queries, set TRINO_ALLOW_WRITE_QUERIES=true, but be aware this bypasses this security protection.
For Cursor Integration: When using with Cursor, set MCP_TRANSPORT=http and connect to the /sse endpoint. The server will automatically handle SSE (Server-Sent Events) connections.

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.

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:
  1. CI checks are run to validate code quality and security
  1. If successful, a new release is automatically created with: