Trino MCP Server

MIT License
13

Integrations

  • Mentioned as a possible catalog type that can be used with Trino through the MCP server

  • Mentioned as a possible catalog type that can be used with Trino through the MCP server

  • Allows users to list tables, read table contents, and execute arbitrary SQL queries against a Trino database through an MCP server

Trino MCP 服务器

该存储库提供了一个 MCP(模型控制协议)服务器,允许您使用 Python 通过 Trino 列出和查询表。

概述

  • MCP:MCP 是一种用于连接 AI 模型、数据和工具的协议。本示例 MCP 服务器提供以下功能:
    • 作为 MCP 资源的 Trino 表列表
    • 能够通过 MCP 读取表格内容
    • 针对 Trino 执行任意 SQL 查询的工具
  • Trino:一个用于大数据分析的快速分布式 SQL 查询引擎。该服务器利用 Trino 的 Python 客户端 (trino.dbapi) 连接到 Trino 主机、目录和架构。

要求

  • Python 3.9+(或与 mcp、trino 和 asyncio 兼容的版本)
  • trino(Trino 的 Python 驱动程序)
  • mcp(模型控制协议 Python 库)

配置

服务器从环境变量中读取 Trino 连接详细信息:

多变的描述默认
TRINO_HOSTTrino 服务器主机名或 IPlocalhost
TRINO_PORTTrino 服务器端口8080
TRINO_USERTrino 用户名必需的
TRINO_PASSWORDTrino 密码(可选,取决于您的身份验证设置)(空的)
TRINO_CATALOG使用的默认目录(例如, hivetpchpostgresql等)必需的
TRINO_SCHEMA要使用的默认架构(例如defaultpublic等)必需的

用法

{ "mcpServers": { "trino": { "command": "uv", "args": [ "--directory", "<path_to_mcp_server_trino>", "run", "mcp_server_trino" ], "env": { "TRINO_HOST": "<host>", "TRINO_PORT": "<port>", "TRINO_USER": "<user>", "TRINO_PASSWORD": "<password>", "TRINO_CATALOG": "<catalog>", "TRINO_SCHEMA": "<schema>" } } } }
-
security - not tested
A
license - permissive license
-
quality - not tested

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.

MCP 服务器可以使用 Python 列出和查询 Trino 表,并通过模型控制协议提供对数据资源的访问。

  1. Overview
    1. Requirements
      1. Configuration
        1. Usage

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
            Last updated -
            39
            25
            • Apple
          • -
            security
            F
            license
            -
            quality
            A server that helps people access and query data in databases using the Query Runner with integration of the Model Context Protocol (MCP) Python SDK. Support databases including PostgreSQL Redshift MySQL Microsoft SQL Server Google APIs Amazon Web Services (via boto3) CockroachDB SQLite
            Last updated -
            6
            Python
            GPL 3.0
            • Linux
            • Apple
          • -
            security
            -
            license
            -
            quality
            An MCP server that enables natural language interaction with Apache Iceberg data lakehouses, allowing users to query table metadata, schemas, and properties through Claude, Cursor, or other MCP clients.
            Last updated -
            31
            Python
            Apache 2.0
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that provides seamless integration with Trino and Iceberg, enabling data exploration, querying, and table maintenance through a standard interface.
            Last updated -
            14
            Python
            Apache 2.0

          View all related MCP servers

          ID: m94exir35y