Skip to main content

A simple Model Context Protocol (MCP) server for Trino with OAuth support

Project description

Trino MCP Server

Model Context Protocol server for Trino query engine, with OAuth2 support.

Quick Start

Install:

uvx trino-mcp

Configure (create .env file):

Variable Required Default Allowed Values Description
TRINO_HOST localhost Any hostname/IP Trino server hostname
TRINO_PORT 8080 Any port number Trino server port
TRINO_USER trino Any username Trino username
AUTH_METHOD PASSWORD NONE, PASSWORD, OAUTH2 Authentication method
TRINO_PASSWORD Conditional* - Any password Required if AUTH_METHOD=PASSWORD
TRINO_HTTP_SCHEME http http, https Connection protocol
TRINO_CATALOG - Any catalog name Default catalog for queries
TRINO_SCHEMA - Any schema name Default schema for queries

Authentication rules:

  • AUTH_METHOD=NONE - No authentication required
  • AUTH_METHOD=PASSWORD - Requires TRINO_PASSWORD to be set
  • AUTH_METHOD=OAUTH2 - OAuth2 flow handled automatically by Trino client
  • If AUTH_METHOD is not set, defaults to PASSWORD

Use with VS Code (in .vscode/mcp.json):

{
  "servers": {
    "trino": {
      "command": "uvx",
      "args": ["trino-mcp"],
      "env": {
        "TRINO_HOST": "trino_host_address",
        "TRINO_USER": "user_name",
        "AUTH_METHOD": "OAuth2"
      }
    }
  }
}

Available Tools

  • list_catalogs() - List all catalogs
  • list_schemas(catalog) - List schemas in a catalog
  • list_tables(catalog, schema) - List tables in a schema
  • describe_table(table, catalog, schema) - Show table structure
  • execute_query(query) - Execute SQL and return results
  • show_create_table(table, catalog, schema) - Show CREATE TABLE statement
  • get_table_stats(table, catalog, schema) - Get table statistics

Development

# Clone and install
git clone https://github.com/weijie-tan3/trino-mcp.git
cd trino-mcp
uv pip install -e .

# Run tests
uv run pytest

# Run locally
uvx --from . trino-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trino_mcp-0.1.1.tar.gz (97.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trino_mcp-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file trino_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: trino_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 97.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for trino_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f5ea4b6e57d3ba12a928c2595cda8a4284e91697e86e0cb38a1101f465b7f6ce
MD5 1c767e45194c0a80e35b8c6913abfac5
BLAKE2b-256 0b632f200dce571f59f6a8acfc0d9749bc2f8e75a5047034769fc2bc977da23c

See more details on using hashes here.

File details

Details for the file trino_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: trino_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for trino_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c550ecc45abc9040151a51ae4ed96197a55f29e97276e3ffc99c2f3639c2160
MD5 26cebcfba8efc9ecccb0b7f34d3c1642
BLAKE2b-256 95679c5f230b00fdda2ab95c2a8a9797747f0333a83442b5f1f08fe2d1117f07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page