Skip to main content
Glama
weijie-tan3

Trino MCP Server

by weijie-tan3

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TRINO_HOSTNoTrino server hostnamelocalhost
TRINO_PORTNoTrino server port (auto-set to 443 for OAuth2/Azure SPN)8080
TRINO_USERNoUsernametrino
AUTH_METHODNoAuthentication method: NONE, PASSWORD, OAUTH2, or AZURE_SPNNONE
AZURE_SCOPENoAzure token scope for AZURE_SPN auth
TRINO_SCHEMANoDefault schema
TRINO_CATALOGNoDefault catalog
TRINO_PASSWORDNoPassword for PASSWORD auth
AZURE_CLIENT_IDNoAzure client ID for AZURE_SPN auth
AZURE_TENANT_IDNoAzure tenant ID for AZURE_SPN auth
TRINO_HTTP_SCHEMENohttp or https (auto-set to https for OAuth2/Azure SPN)http
ALLOW_WRITE_QUERIESNoEnable write operations (true, 1, or yes)false
AZURE_CLIENT_SECRETNoAzure client secret for AZURE_SPN auth
QUERY_TIMEOUT_MINUTESNoClient-side query timeout in minutes (0 to disable)5
MAX_CONCURRENT_QUERIESNoMax concurrent tool calls1
TRINO_SESSION_PROPERTIESNoJSON object of Trino session properties
TRINO_MCP_CUSTOM_WATERMARKNoJSON object for custom query watermark

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_catalogsA

List all available Trino catalogs.

list_schemasA

List all schemas in a catalog.

Args: catalog: The name of the catalog to list schemas from

list_tablesA

List all tables in a schema.

Args: catalog: The name of the catalog schema: The name of the schema

describe_tableB

Describe the structure of a table (columns, types, etc).

Args: table: The table name (e.g. 'my_table'). Preferably just the table name; catalog and schema should be passed as separate parameters. Fully qualified names like 'catalog.schema.table' are also accepted. catalog: The catalog name (optional if default is configured) schema: The schema name (optional if default is configured)

execute_query_read_onlyA

Execute a read-only SQL query and return the results.

This tool is designed for read-only queries (SELECT, SHOW, DESCRIBE, EXPLAIN, etc.). It validates that the query is read-only before execution.

When output_file is provided, results are written directly to disk and only a confirmation message is returned. This prevents raw data from passing through the AI, avoiding hallucination when processing large result sets. The output format (JSON or CSV) is derived from the file extension.

Args: query: The SQL query to execute (must be read-only) output_file: File path to write results to. Extension determines format (.csv → CSV, .json or others → JSON). Results are NOT returned to the AI, enabling reliable downstream processing.

execute_queryA

Execute a SQL query and return the results.

This tool can execute any SQL query including write operations (INSERT, UPDATE, DELETE, etc.). By default, write operations are disabled for security. Set ALLOW_WRITE_QUERIES=true to enable.

When output_file is provided, results are written directly to disk and only a confirmation message is returned. This prevents raw data from passing through the AI, avoiding hallucination when processing large result sets. The output format (JSON or CSV) is derived from the file extension.

Args: query: The SQL query to execute output_file: File path to write results to. Extension determines format (.csv → CSV, .json or others → JSON). Results are NOT returned to the AI, enabling reliable downstream processing.

show_create_tableA

Show the CREATE TABLE statement for a table.

Args: table: The table name (e.g. 'my_table'). Preferably just the table name; catalog and schema should be passed as separate parameters. Fully qualified names like 'catalog.schema.table' are also accepted. catalog: The catalog name (optional if default is configured) schema: The schema name (optional if default is configured)

get_table_statsB

Get statistics for a table.

Args: table: The table name (e.g. 'my_table'). Preferably just the table name; catalog and schema should be passed as separate parameters. Fully qualified names like 'catalog.schema.table' are also accepted. catalog: The catalog name (optional if default is configured) schema: The schema name (optional if default is configured)

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/weijie-tan3/trino-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server