Trino MCP Server in Go

by heavenlycolle

306 downloads Not rated yet

About

A high-performance Model Context Protocol (MCP) server for Trino implemented in Go. mcp, mcp-server, trino

Explore

- ✅ 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.

The server can be configured using the following environment variables:

| Variable | Description | Default |
| ---------------------- | --------------------------------- | --------- |
| TRINO_HOST | Trino server hostname | localhost |
| TRINO_PORT | Trino server port | 8080 |
| TRINO_USER | Trino user | trino |
| TRINO_PASSWORD | Trino password | (empty) |
| TRINO_CATALOG | Default catalog | memory |
| TRINO_SCHEMA | Default schema | default |
| TRINO_SCHEME | Connection scheme (http/https) | https |
| TRINO_SSL | Enable SSL | true |
| TRINO_SSL_INSECURE | Allow insecure SSL | true |
| TRINO_ALLOW_WRITE_QUERIES | Allow non-read-only SQL queries | false |
| TRINO_QUERY_TIMEOUT | Query timeout in seconds | 30 |
| MCP_TRANSPORT | Transport method (stdio/http) | stdio |
| MCP_PORT | HTTP port for http transport | 9097 |
| MCP_HOST | Host for HTTP callbacks | localhost |

> 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.

brew install mcp-trino


To update to the latest version:

bash
brew update && brew upgrade mcp-trino
```

The server provides the following MCP tools:

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.

GitHub Workflow Status
Go Version
Trivy Scan
SLSA 3
Go Report Card
Go Reference
Docker Image
GitHub Release
License: MIT

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:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.