Lists all available tables in the configured Trino catalog and schema
Reads and returns the contents of a specified Trino table
Executes arbitrary SQL queries against the Trino database
The Trino MCP Server provides a seamless interface for AI models to interact with Trino, a fast distributed SQL query engine for big data analytics. This integration allows you to list available tables, explore their contents, and execute arbitrary SQL queries against your Trino databases, making your data accessible for AI-powered analysis and insights.
The Trino MCP Server enables AI models to interact with Trino databases through the Model-Control-Protocol (MCP). This server provides capabilities to list available tables, read table contents, and execute SQL queries against your Trino instance.
To use the Trino MCP Server, you'll need to have Python 3.9 or later installed on your system. The server requires the trino
Python driver and the mcp
library.
git clone https://github.com/Dataring-engineering/mcp-server-trino.git
cd mcp-server-trino
pip install -r requirements.txt
The Trino MCP Server requires configuration to connect to your Trino instance. You'll need to set the following environment variables:
TRINO_HOST
: Hostname or IP address of your Trino server (defaults to localhost
)TRINO_PORT
: Port number for your Trino server (defaults to 8080
)TRINO_USER
: Username for authentication (required)TRINO_PASSWORD
: Password for authentication (optional, depends on your setup)TRINO_CATALOG
: Default catalog to use (required, e.g., hive
, tpch
, postgresql
)TRINO_SCHEMA
: Default schema to use (required, e.g., default
, public
)To use the Trino MCP Server with an AI assistant, you'll need to add it to your configuration. The server provides access to Trino tables as resources and offers tools for executing SQL queries.
When interacting with the AI assistant, you can:
The AI assistant will use the Trino MCP Server to fetch the requested information and present it to you in a readable format.
Here are some example prompts you can use with an AI assistant that has the Trino MCP Server configured:
The AI assistant will execute these requests through the Trino MCP Server and return the results.