A simple Model Context Protocol (MCP) server for Trino with OAuth support
Project description
Trino MCP Server
Model Context Protocol server for Trino query engine, with OAuth2 support.
Quick Start
Install:
uvx trino-mcp
Configure (create .env file):
| Variable | Required | Default | Allowed Values | Description |
|---|---|---|---|---|
TRINO_HOST |
✅ | localhost |
Any hostname/IP | Trino server hostname |
TRINO_PORT |
✅ | 8080 |
Any port number | Trino server port |
TRINO_USER |
✅ | trino |
Any username | Trino username |
AUTH_METHOD |
❌ | PASSWORD |
NONE, PASSWORD, OAUTH2 |
Authentication method |
TRINO_PASSWORD |
Conditional* | - | Any password | Required if AUTH_METHOD=PASSWORD |
TRINO_HTTP_SCHEME |
❌ | http |
http, https |
Connection protocol |
TRINO_CATALOG |
❌ | - | Any catalog name | Default catalog for queries |
TRINO_SCHEMA |
❌ | - | Any schema name | Default schema for queries |
Authentication rules:
AUTH_METHOD=NONE- No authentication requiredAUTH_METHOD=PASSWORD- RequiresTRINO_PASSWORDto be setAUTH_METHOD=OAUTH2- OAuth2 flow handled automatically by Trino client- If
AUTH_METHODis not set, defaults toPASSWORD
Use with VS Code (in .vscode/mcp.json):
{
"servers": {
"trino": {
"command": "uvx",
"args": ["trino-mcp"],
"env": {
"TRINO_HOST": "trino_host_address",
"TRINO_USER": "user_name",
"AUTH_METHOD": "OAuth2"
}
}
}
}
Available Tools
list_catalogs()- List all catalogslist_schemas(catalog)- List schemas in a cataloglist_tables(catalog, schema)- List tables in a schemadescribe_table(table, catalog, schema)- Show table structureexecute_query(query)- Execute SQL and return resultsshow_create_table(table, catalog, schema)- Show CREATE TABLE statementget_table_stats(table, catalog, schema)- Get table statistics
Development
# Clone and install
git clone https://github.com/weijie-tan3/trino-mcp.git
cd trino-mcp
uv pip install -e .
# Run tests
uv run pytest
# Run locally
uvx --from . trino-mcp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trino_mcp-0.1.1.tar.gz
(97.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trino_mcp-0.1.1.tar.gz.
File metadata
- Download URL: trino_mcp-0.1.1.tar.gz
- Upload date:
- Size: 97.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ea4b6e57d3ba12a928c2595cda8a4284e91697e86e0cb38a1101f465b7f6ce
|
|
| MD5 |
1c767e45194c0a80e35b8c6913abfac5
|
|
| BLAKE2b-256 |
0b632f200dce571f59f6a8acfc0d9749bc2f8e75a5047034769fc2bc977da23c
|
File details
Details for the file trino_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: trino_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c550ecc45abc9040151a51ae4ed96197a55f29e97276e3ffc99c2f3639c2160
|
|
| MD5 |
26cebcfba8efc9ecccb0b7f34d3c1642
|
|
| BLAKE2b-256 |
95679c5f230b00fdda2ab95c2a8a9797747f0333a83442b5f1f08fe2d1117f07
|