Trino MCP Server in Go
Overview
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)
Alternative Installation Methods
Manual Download
- Download the appropriate binary for your platform from the GitHub Releases page.
- Place the binary in a directory included in your PATH (e.g.,
/usr/local/bin
on Linux/macOS)
- Make it executable (
chmod +x mcp-trino
on Linux/macOS)
From Source
Downloads
[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] |
MCP Integration
Using Docker Image
Note: Thehost.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.
Cursor
~/.cursor/mcp.json
:Claude Desktop
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Windsurf
mcp_config.json
:ChatWise
- Open ChatWise and go to Settings
- Navigate to the Tools section
- Click the "+" icon to add a new tool
- Select "Command Line MCP"
- Configure with the following details:
- Copy this JSON to your clipboard:
- In ChatWise Settings > Tools, click the "+" icon
- Select "Import JSON from Clipboard"
- Toggle the switch next to the tool to enable it
Available MCP Tools
execute_query
"How many customers do we have per region? Can you show them in descending order?"
list_catalogs
"What databases do we have access to in our Trino environment?"
list_schemas
"What schemas or datasets are available in the tpch catalog?"
list_tables
"What tables are available in the tpch tiny schema? I need to know what data we can query."
get_table_schema
"What columns are in the customer table? I need to know the data types and structure before writing my query."
End-to-End Example
- First, discover available catalogs
- Then, find available schemas
- Explore available tables
- Check the customer table schema
- Finally, execute the query
- Returns the results to the user:
Configuration
[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: WhenTRINO_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 setTRINO_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, setTRINO_ALLOW_WRITE_QUERIES=true
, but be aware this bypasses this security protection.
For Cursor Integration: When using with Cursor, setMCP_TRANSPORT=http
and connect to the/sse
endpoint. The server will automatically handle SSE (Server-Sent Events) connections.
Contributing
License
CI/CD and Releases
Continuous Integration Checks
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
- CI checks are run to validate code quality and security
- If successful, a new release is automatically created with:
Trino MCP Server in Go
Overview
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)
Alternative Installation Methods
Manual Download
- Download the appropriate binary for your platform from the GitHub Releases page.
- Place the binary in a directory included in your PATH (e.g.,
/usr/local/bin
on Linux/macOS)
- Make it executable (
chmod +x mcp-trino
on Linux/macOS)
From Source
Downloads
[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] |
MCP Integration
Using Docker Image
Note: Thehost.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.
Cursor
~/.cursor/mcp.json
:Claude Desktop
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Windsurf
mcp_config.json
:ChatWise
- Open ChatWise and go to Settings
- Navigate to the Tools section
- Click the "+" icon to add a new tool
- Select "Command Line MCP"
- Configure with the following details:
- Copy this JSON to your clipboard:
- In ChatWise Settings > Tools, click the "+" icon
- Select "Import JSON from Clipboard"
- Toggle the switch next to the tool to enable it
Available MCP Tools
execute_query
"How many customers do we have per region? Can you show them in descending order?"
list_catalogs
"What databases do we have access to in our Trino environment?"
list_schemas
"What schemas or datasets are available in the tpch catalog?"
list_tables
"What tables are available in the tpch tiny schema? I need to know what data we can query."
get_table_schema
"What columns are in the customer table? I need to know the data types and structure before writing my query."
End-to-End Example
- First, discover available catalogs
- Then, find available schemas
- Explore available tables
- Check the customer table schema
- Finally, execute the query
- Returns the results to the user:
Configuration
[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: WhenTRINO_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 setTRINO_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, setTRINO_ALLOW_WRITE_QUERIES=true
, but be aware this bypasses this security protection.
For Cursor Integration: When using with Cursor, setMCP_TRANSPORT=http
and connect to the/sse
endpoint. The server will automatically handle SSE (Server-Sent Events) connections.
Contributing
License
CI/CD and Releases
Continuous Integration Checks
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
- CI checks are run to validate code quality and security
- If successful, a new release is automatically created with: