mcp trino python
A Model Context Protocol server that provides seamless integration with Trino and Iceberg, enabling data exploration, querying, and table maintenance through a standard interface.
A Model Context Protocol server that provides seamless integration with Trino and Iceberg, enabling data exploration, querying, and table maintenance through a standard interface.
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.
To install MCP Trino Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @alaturqua/mcp-trino-python --client claude
The easiest way to get started is to use the included Docker Compose configuration to run Trino locally:
docker-compose up -d
This will start a Trino server on localhost:8080
. You can now proceed with configuring the MCP server.
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.
{
"mcp": {
"servers": {
"trino": {
"command": "docker",
"args": ["run", "--rm", "ghcr.io/alaturqua/mcp-trino-python:latest"],
"env": {
"TRINO_HOST": "${input:trino_host}",
"TRINO_PORT": "${input:trino_port}",
"TRINO_USER": "${input:trino_user}",
"TRINO_PASSWORD": "${input:trino_password}",
"TRINO_HTTP_SCHEME": "${input:trino_http_scheme}",
"TRINO_CATALOG": "${input:trino_catalog}",
"TRINO_SCHEMA": "${input:trino_schema}"
}
}
}
}
}
Add the following configuration to your Claude Desktop settings:
{
"mcpServers": {
"trino": {
"command": "python",
"args": ["./src/server.py"],
"env": {
"TRINO_HOST": "your-trino-host",
"TRINO_PORT": "8080",
"TRINO_USER": "trino"
}
}
}
}
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 |
The server provides the following MCP resources:
catalog://main (list_catalogs
)
Lists all available Trino catalogs
No parameters required
schema://{catalog} (list_schemas
)
Lists all schemas in the specified catalog
Parameters:
catalog
: Catalog name (string, required)table://{catalog}/{schema} (list_tables
)
catalog
: Catalog name (string, required)schema
: Schema name (string, required)show_catalogs
List all available catalogs
No parameters required
show_schemas
List all schemas in a catalog
Parameters:
catalog
: Catalog name (string, required)show_tables
List all tables in a schema
Parameters:
catalog
: Catalog name (string, required)schema
: Schema name (string, required)describe_table
Show detailed table structure and column information
Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)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
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
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)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
table
: Table name (string, required)retention_threshold
: Age threshold (e.g., "7d") (string, optional)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)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
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
Parameters:
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)show_snapshots
Show Iceberg table snapshots
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
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
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
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
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)
table
: Table name (string, required)catalog
: Catalog name (string, optional)schema
: Schema name (string, optional)limit
: Maximum number of queries to return (number, optional)This project is licensed under the Apache 2.0 License. Please refer to the LICENSE file for the full terms.