show_catalogsLABSCO 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
Build from source — git clone https://github.com/alaturqua/mcp-trino-python.git
USE CASES
Finding your way around an unfamiliar Trino cluster
Print the catalog, schema and table hierarchy as a tree, then describe the table you actually care about.
Answering a question that needs SQL
Check the table's columns and statistics, then run the query and get formatted results back.
Cleaning up an Iceberg table that has drifted
Compact the small files, tidy the manifests, then expire snapshots older than your retention threshold.
Working out why a table got slow
Read its partitions, data files and manifest entries to see where the file counts and statistics went wrong.
Tracing what changed a table and when
Read the table history and its snapshots for operations, timing and lineage.
Reproducing a definition somewhere else
Pull the CREATE TABLE or CREATE VIEW statement and the table's properties as they currently stand.
22 tools
Listed in project docs. Your client may show a different list.
show_schemasshow_tablesdescribe_tableexecute_queryshow_catalog_treeshow_create_tableshow_create_viewshow_statsoptimizeoptimize_manifestsexpire_snapshotsshow_table_propertiesshow_table_historyshow_metadata_log_entriesshow_snapshotsshow_manifestsshow_partitionsshow_filesshow_entriesshow_refsshow_query_historyBEFORE YOU INSTALL
What to know first
Tools you get
22 tools named in the project's documentation.
Requires
python on PATH
Where it runs
All 3 documented setups run the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/alaturqua/mcp-trino-python.git
cd mcp-trino-pythonCreate a .env file in the root directory with TRINO_HOST, TRINO_PORT, TRINO_USER (and optionally TRINO_CATALOG, TRINO_SCHEMA) for your Trino server
uv syncMCP Clients
Claude Desktop
{
"mcpServers": {
"trino": {
"command": "python",
"args": [
"./src/server.py"
],
"env": {
"TRINO_HOST": "<YOUR_TRINO_HOST>",
"TRINO_PORT": "8080",
"TRINO_USER": "trino"
}
}
}
}The README runs this from the clone: ./src/server.py is relative, and Claude Desktop does not start in that folder. It has to be the absolute path to src/server.py in your clone, and "command" a Python that has the project installed (the README's pip install -e . in the clone).
VS Code
{
"servers": {
"mcp-trino-python": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"trino",
"--with",
"loguru",
"mcp",
"run",
"<YOUR_PATH_TO_MCP_TRINO_PYTHON>/src/server.py"
],
"envFile": "<YOUR_PATH_TO_MCP_TRINO_PYTHON>/.env"
}
}
}<YOUR_PATH_TO_MCP_TRINO_PYTHON> is the folder you cloned; envFile reads the .env file you created there.
VS Code — Docker
{
"servers": {
"mcp-trino-python": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network",
"mcp-trino-python_trino-network",
"-e",
"TRINO_HOST=trino",
"-e",
"TRINO_PORT=8080",
"-e",
"TRINO_USER=trino",
"mcp-trino-python"
]
}
}
}Build the image first, inside the clone: docker build -t mcp-trino-python . The network mcp-trino-python_trino-network and TRINO_HOST=trino belong to the Trino container that docker-compose up -d trino starts from the clone. For a Trino server running on your machine outside Docker, the README's stdio run uses -e TRINO_HOST=host.docker.internal with no --network.