Skip to content

Trino MCP Server Usage Guide

Overview

This guide shows how to use the Trino MCP Server with different MCP clients and integration methods.

Tool Discovery

# Start interactive mode
mcp_platform interactive

# List available tools
mcpp> tools trino
# Discover tools using CLI
mcp_platform tools trino
from mcp_platform.client import MCPClient

async def discover_tools():
    client = MCPClient()
    tools = client.list_tools("trino")
    for tool in tools:
        print(f"Tool: {tool['name']} - {tool['description']}")

Available Tools

list_catalogs

Description: List all accessible Trino catalogs

Parameters: - No parameters required

list_schemas

Description: List schemas in a specific catalog

Parameters: - catalog (string) (required): Catalog name to list schemas from

list_tables

Description: List tables in a specific schema

Parameters: - catalog (string) (required): Catalog name containing the schema - schema (string) (required): Schema name to list tables from

describe_table

Description: Get detailed schema information for a table

Parameters: - catalog (string) (required): Catalog name containing the table - schema (string) (required): Schema name containing the table - table (string) (required): Table name to describe

execute_query

Description: Execute a SQL query against Trino (subject to read-only restrictions)

Parameters: - query (string) (required): SQL query to execute - catalog (string) (optional): Default catalog for the query (optional) - schema (string) (optional): Default schema for the query (optional)

get_query_status

Description: Get status of a running query

Parameters: - query_id (string) (required): Trino query ID to check

cancel_query

Description: Cancel a running query

Parameters: - query_id (string) (required): Trino query ID to cancel

get_cluster_info

Description: Get information about the Trino cluster

Parameters: - No parameters required

Usage Examples

# Start interactive mode
mcp_platform interactive

# Deploy the template (if not already deployed)
mcpp> deploy trino

# List available tools after deployment
mcpp> tools trino

Then call tools:

mcpp> call trino list_catalogs
mcpp> call trino list_schemas '{"catalog": "example_value"}'
mcpp> call trino list_tables '{"catalog": "example_value", "schema": "example_value"}'
# Deploy the template
mcp_platform deploy trino

# Check deployment status
mcp_platform status

# View logs
mcp_platform logs trino

# Stop the template
mcp_platform stop trino
import asyncio
from mcp_platform.client import MCPClient

async def use_trino():
    client = MCPClient()

    # Start the server
    deployment = client.start_server("trino", {})

    if deployment["success"]:
        deployment_id = deployment["deployment_id"]

        try:
            # Discover available tools
            tools = client.list_tools("trino")
            print(f"Available tools: {[t['name'] for t in tools]}")

            # Call list_catalogs
            result = client.call_tool("trino", "list_catalogs", {})
            print(f"list_catalogs result: {result}")

            # Call list_schemas
            result = client.call_tool("trino", "list_schemas", {'catalog': 'example_value'})
            print(f"list_schemas result: {result}")

        finally:
            # Clean up
            client.stop_server(deployment_id)
    else:
        print("Failed to start server")

# Run the example
asyncio.run(use_trino())

Integration Examples

Add this configuration to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "trino": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "trino", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}

Install the MCP extension and add this to your VS Code settings (.vscode/settings.json):

{
  "mcp.servers": {
    "trino": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "trino", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}
# Get connection details for other integrations
mcp_platform connect trino --llm claude
mcp_platform connect trino --llm vscode

Configuration

For template-specific configuration options, see the main template documentation. Common configuration methods:

# Deploy with environment variables
mcp_platform deploy trino --env KEY=VALUE
# Deploy with configuration
mcp_platform deploy trino --config key=value

# Deploy with nested configuration
mcp_platform deploy trino --config category__property=value
# Deploy with config file
mcp_platform deploy trino --config-file config.json

Troubleshooting

Common Issues

  1. Template not found: Ensure the template name is correct

    mcp_platform list  # List available templates
    

  2. Connection issues: Check if the server is running

    mcp_platform status
    

  3. Tool discovery fails: Try refreshing the tool cache

    mcpp> tools trino --refresh
    

Debug Mode

Enable debug logging for troubleshooting:

# Interactive CLI with debug
LOG_LEVEL=debug mcp_platform interactive
# Deploy with debug logging
mcp_platform deploy trino --config log_level=debug

For more help, see the main documentation or open an issue in the repository.