remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Supports Apache Iceberg table maintenance and metadata inspection, including optimizing tables, managing snapshots, viewing table history, and inspecting partitions and data files.
Provides seamless integration with Trino for interactive data exploration, executing SQL queries, catalog/schema navigation, and retrieving query results in formatted outputs.
MCP Trino Server
The MCP Trino Server is a Model Context Protocol (MCP) server that provides seamless integration with Trino and Iceberg, enabling advanced data exploration, querying, and table maintenance capabilities through a standard interface.
Use Cases
- Interactive data exploration and analysis in Trino
- Automated Iceberg table maintenance and optimization
- Building AI-powered tools that interact with Trino databases
- Executing and managing SQL queries with proper result formatting
Prerequisites
- A running Trino server (or Docker Compose for local development)
- Python 3.11 or higher
- Docker (optional, for containerized deployment)
Installation
Running Trino Locally
The easiest way to get started is to use the included Docker Compose configuration to run Trino locally:
This will start a Trino server on localhost:8080
. You can now proceed with configuring the MCP server.
Usage with VS Code
For quick installation, you can add the following configuration to your VS Code settings. You can do this by pressing Ctrl + Shift + P
and typing Preferences: Open User Settings (JSON)
.
Optionally, you can add it to a file called .vscode/mcp.json
in your workspace. This will allow you to share the configuration with others.
Note that the
mcp
key is not needed in the.vscode/mcp.json
file.
Usage with Claude Desktop
Add the following configuration to your Claude Desktop settings:
Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
TRINO_HOST | Trino server hostname | localhost |
TRINO_PORT | Trino server port | 8080 |
TRINO_USER | Trino username | trino |
TRINO_CATALOG | Default catalog | None |
TRINO_SCHEMA | Default schema | None |
TRINO_HTTP_SCHEME | HTTP scheme (http/https) | http |
TRINO_PASSWORD | Trino password | None |
Resources
The server provides the following MCP resources:
Catalog and Schema Navigation
- catalog://main (
show_catalogs
)- Lists all available Trino catalogs
- No parameters required
- schema://{catalog} (
show_schemas
)- Lists all schemas in the specified catalog
- Parameters:
catalog
: Catalog name (string, required)
- table://{catalog}/{schema} (
show_tables
)- Lists all tables in the specified schema
- Parameters:
catalog
: Catalog name (string, required)schema
: Schema name (string, required)
Tools
Query and Exploration Tools
- execute_query
- Execute a SQL query and return formatted results
- Parameters:
query
: SQL query to execute (string, required)
- show_catalog_tree
- Show a hierarchical tree view of catalogs, schemas, and tables
- Returns a formatted tree structure with visual indicators
- No parameters required
- show_create_table
- Show the CREATE TABLE statement for a table
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_create_view
- Show the CREATE VIEW statement for a view
- Parameters:
view
: View name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_stats
- Show statistics for a table
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
Iceberg Table Maintenance
- optimize
- Optimize an Iceberg table by compacting small files
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- optimize_manifests
- Optimize manifest files for an Iceberg table
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- expire_snapshots
- Remove old snapshots from an Iceberg table
- Parameters:
table
: Table name (string, required)retention_threshold
: Age threshold (e.g., "7d") (string, optional)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
Iceberg Metadata Inspection
- show_table_properties
- Show Iceberg table properties
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_table_history
- Show Iceberg table history/changelog
- Contains snapshot timing, lineage, and ancestry information
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_metadata_log_entries
- Show Iceberg table metadata log entries
- Contains metadata file locations and sequence information
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_snapshots
- Show Iceberg table snapshots
- Contains snapshot details including operations and manifest files
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_manifests
- Show Iceberg table manifests for current or all snapshots
- Contains manifest file details and data file statistics
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)all_snapshots
: Include all snapshots (boolean, optional)
- show_partitions
- Show Iceberg table partitions
- Contains partition statistics and file counts
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_files
- Show Iceberg table data files in current snapshot
- Contains detailed file metadata and column statistics
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
- show_entries
- Show Iceberg table manifest entries for current or all snapshots
- Contains entry status and detailed file metrics
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)all_snapshots
: Include all snapshots (boolean, optional)
- show_refs
- Show Iceberg table references (branches and tags)
- Contains reference configuration and snapshot mapping
- Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)
Query History
- show_query_history
- Get the history of executed queries
- Parameters:
limit
: Maximum number of queries to return (number, optional)
License
This project is licensed under the Apache 2.0 License. Please refer to the LICENSE file for the full terms.
This server cannot be installed
A Model Context Protocol server that provides seamless integration with Trino and Iceberg, enabling data exploration, querying, and table maintenance through a standard interface.