Labsco
MCP SERVER

MCP Trino Server

by alaturqua

Explore Trino catalogs, run SQL, and do the Iceberg housekeeping — compaction, snapshot expiry, manifest inspection.

Relational SQL Databases
Summary
Trino exploration plus the Iceberg housekeeping that normally lives in a runbook.

Most database servers stop at query and describe. This one also opens the Iceberg maintenance surface — optimize to compact small files, expire_snapshots to drop the old ones past a retention threshold, and the metadata tables readable one by one — so "why does this table have so many small files?" can be answered and then acted on without leaving the session.

What it is

A Trino client exposed as tools. It walks catalogs, schemas and tables, runs queries and formats the results, and adds a full Iceberg maintenance and metadata surface on top.

What you get
  • Catalogs, schemas and tables listed individually, or the whole hierarchy as one tree
  • A table described column by column, with its CREATE TABLE or CREATE VIEW statement and its statistics
  • Any SQL executed, with the results formatted rather than dumped raw
  • Iceberg tables compacted with optimize, their manifest files optimized, and old snapshots expired past a retention threshold such as 7d
  • Iceberg metadata read directly: properties, history, metadata log entries, snapshots, manifests, manifest entries, partitions, data files and refs
  • The history of queries already run, capped to a limit
Requirements

Python 3.12 or newer and a running Trino server. TRINO_HOST, TRINO_PORT and TRINO_USER identify it; TRINO_CATALOG and TRINO_SCHEMA set the defaults; TRINO_HTTP_SCHEME and TRINO_PASSWORD cover TLS and authentication. Speaks stdio by default, or streamable-http and sse on a host and port you pass on the command line. A Docker image is published, and the repository's docker-compose brings up a local Trino with TPC-H and TPC-DS sample data if you want somewhere to try it.

Setup effort

One command — npx -y @smithery/cli install @alaturqua/mcp-trino-python --client claude