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 ¶
- type Config
- type ReadOnlyInterceptor
- type Toolkit
- func (t *Toolkit) Client() *trinoclient.Client
- func (t *Toolkit) Close() error
- func (t *Toolkit) Config() Config
- func (t *Toolkit) Kind() string
- func (t *Toolkit) Name() string
- func (t *Toolkit) RegisterTools(s *mcp.Server)
- func (t *Toolkit) SetQueryProvider(provider query.Provider)
- func (t *Toolkit) SetSemanticProvider(provider semantic.Provider)
- func (t *Toolkit) Tools() []string
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.
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
func (r *ReadOnlyInterceptor) Intercept(_ context.Context, sql string, _ trinotools.ToolName) (string, error)
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 (*Toolkit) Client ¶
func (t *Toolkit) Client() *trinoclient.Client
Client returns the underlying Trino client for direct use.
func (*Toolkit) RegisterTools ¶
RegisterTools registers Trino tools with the MCP server.
func (*Toolkit) SetQueryProvider ¶
SetQueryProvider sets the query execution provider for enrichment.
func (*Toolkit) SetSemanticProvider ¶
SetSemanticProvider sets the semantic metadata provider for enrichment.