trino

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package trino provides a Trino toolkit adapter for the MCP data platform.

Package trino provides a Trino toolkit adapter for the MCP data platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host           string        `yaml:"host"`
	Port           int           `yaml:"port"`
	User           string        `yaml:"user"`
	Password       string        `yaml:"password"`
	Catalog        string        `yaml:"catalog"`
	Schema         string        `yaml:"schema"`
	SSL            bool          `yaml:"ssl"`
	SSLVerify      bool          `yaml:"ssl_verify"`
	Timeout        time.Duration `yaml:"timeout"`
	DefaultLimit   int           `yaml:"default_limit"`
	MaxLimit       int           `yaml:"max_limit"`
	ReadOnly       bool          `yaml:"read_only"`
	ConnectionName string        `yaml:"connection_name"`
}

Config holds Trino toolkit configuration.

func ParseConfig

func ParseConfig(cfg map[string]any) (Config, error)

ParseConfig parses a Trino toolkit configuration from a map.

type ReadOnlyInterceptor added in v0.2.0

type ReadOnlyInterceptor struct{}

ReadOnlyInterceptor blocks write operations when read_only mode is enabled. This interceptor detects SQL statements that modify data or schema.

func NewReadOnlyInterceptor added in v0.2.0

func NewReadOnlyInterceptor() *ReadOnlyInterceptor

NewReadOnlyInterceptor creates a new read-only query interceptor.

func (*ReadOnlyInterceptor) Intercept added in v0.2.0

Intercept checks if the query is a write operation and blocks it in read-only mode.

type Toolkit

type Toolkit struct {
	// contains filtered or unexported fields
}

Toolkit wraps mcp-trino toolkit for the platform.

func New

func New(name string, cfg Config) (*Toolkit, error)

New creates a new Trino toolkit.

func (*Toolkit) Client

func (t *Toolkit) Client() *trinoclient.Client

Client returns the underlying Trino client for direct use.

func (*Toolkit) Close

func (t *Toolkit) Close() error

Close releases resources.

func (*Toolkit) Config

func (t *Toolkit) Config() Config

Config returns the toolkit configuration.

func (*Toolkit) Kind

func (t *Toolkit) Kind() string

Kind returns the toolkit kind.

func (*Toolkit) Name

func (t *Toolkit) Name() string

Name returns the toolkit instance name.

func (*Toolkit) RegisterTools

func (t *Toolkit) RegisterTools(s *mcp.Server)

RegisterTools registers Trino tools with the MCP server.

func (*Toolkit) SetMiddleware

func (t *Toolkit) SetMiddleware(chain *middleware.Chain)

SetMiddleware sets the middleware chain for tool handlers.

func (*Toolkit) SetQueryProvider

func (t *Toolkit) SetQueryProvider(provider query.Provider)

SetQueryProvider sets the query execution provider for enrichment.

func (*Toolkit) SetSemanticProvider

func (t *Toolkit) SetSemanticProvider(provider semantic.Provider)

SetSemanticProvider sets the semantic metadata provider for enrichment.

func (*Toolkit) Tools

func (t *Toolkit) Tools() []string

Tools returns the list of tool names that would be provided by this toolkit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL