mcp

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerName = "tiger"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DBExecuteQueryColumn added in v0.7.0

type DBExecuteQueryColumn struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

DBExecuteQueryColumn represents a column in the query result

type DBExecuteQueryInput added in v0.7.0

type DBExecuteQueryInput struct {
	ServiceID      string `json:"service_id"`
	Query          string `json:"query"`
	Parameters     []any  `json:"parameters,omitempty"`
	TimeoutSeconds int    `json:"timeout_seconds,omitempty"`
	Role           string `json:"role,omitempty"`
	Pooled         bool   `json:"pooled,omitempty"`
}

DBExecuteQueryInput represents input for tiger_db_execute_query

func (DBExecuteQueryInput) Schema added in v0.7.0

type DBExecuteQueryOutput added in v0.7.0

type DBExecuteQueryOutput struct {
	Columns       []DBExecuteQueryColumn `json:"columns,omitempty"`
	Rows          [][]any                `json:"rows,omitempty"`
	RowsAffected  int64                  `json:"rows_affected"`
	ExecutionTime string                 `json:"execution_time"`
}

DBExecuteQueryOutput represents output for tiger_db_execute_query

func (DBExecuteQueryOutput) Schema added in v0.7.0

type ProxyClient

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

ProxyClient manages connection to a remote MCP server and forwards requests

func NewProxyClient

func NewProxyClient(ctx context.Context, url string) (*ProxyClient, error)

NewProxyClient creates a new proxy client for the given remote server configuration

func (*ProxyClient) Close

func (p *ProxyClient) Close() error

Close closes the connection to the remote MCP server

func (*ProxyClient) RegisterPrompts

func (p *ProxyClient) RegisterPrompts(ctx context.Context, server *mcp.Server) error

RegisterPrompts discovers prompts from remote server and registers them as proxy prompts

func (*ProxyClient) RegisterResourceTemplates

func (p *ProxyClient) RegisterResourceTemplates(ctx context.Context, server *mcp.Server) error

RegisterResourceTemplates discovers resource templates from remote server and registers them as proxy resource templates

func (*ProxyClient) RegisterResources

func (p *ProxyClient) RegisterResources(ctx context.Context, server *mcp.Server) error

RegisterResources discovers resources from remote server and registers them as proxy resources

func (*ProxyClient) RegisterTools

func (p *ProxyClient) RegisterTools(ctx context.Context, server *mcp.Server) error

RegisterTools discovers tools from remote server and registers them as proxy tools

type ResourceInfo

type ResourceInfo struct {
	CPU    string `json:"cpu,omitempty" jsonschema:"CPU allocation (e.g., '0.5 cores', '1 core')"`
	Memory string `json:"memory,omitempty" jsonschema:"Memory allocation (e.g., '2 GB', '4 GB')"`
}

ResourceInfo represents resource allocation information

type Server

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

Server wraps the MCP server with Tiger-specific functionality

func NewServer

func NewServer(ctx context.Context) (*Server, error)

NewServer creates a new Tiger MCP server instance

func (*Server) Close

func (s *Server) Close() error

Close gracefully shuts down the MCP server and all proxy connections

func (*Server) HTTPHandler

func (s *Server) HTTPHandler() http.Handler

Returns an HTTP handler that implements the http transport

func (*Server) StartStdio

func (s *Server) StartStdio(ctx context.Context) error

Run starts the MCP server with the stdio transport

type ServiceCreateInput

type ServiceCreateInput struct {
	Name           string   `json:"name,omitempty"`
	Addons         []string `json:"addons,omitempty"`
	Region         *string  `json:"region,omitempty"`
	CPUMemory      *string  `json:"cpu_memory,omitempty"`
	Replicas       int      `json:"replicas,omitempty"`
	Wait           bool     `json:"wait,omitempty"`
	TimeoutMinutes int      `json:"timeout_minutes,omitempty"`
	SetDefault     bool     `json:"set_default,omitempty"`
	WithPassword   bool     `json:"with_password,omitempty"`
}

ServiceCreateInput represents input for service_create

func (ServiceCreateInput) Schema

type ServiceCreateOutput

type ServiceCreateOutput struct {
	Service         ServiceDetail                   `json:"service"`
	Message         string                          `json:"message"`
	PasswordStorage *password.PasswordStorageResult `json:"password_storage,omitempty"`
}

ServiceCreateOutput represents output for service_create

func (ServiceCreateOutput) Schema added in v0.7.0

type ServiceDetail

type ServiceDetail struct {
	ServiceID        string        `json:"id" jsonschema:"Service identifier (10-character alphanumeric string)"`
	Name             string        `json:"name"`
	Status           string        `json:"status" jsonschema:"Service status (e.g., READY, PAUSED, CONFIGURING, UPGRADING)"`
	Type             string        `json:"type"`
	Region           string        `json:"region"`
	Created          string        `json:"created,omitempty"`
	Resources        *ResourceInfo `json:"resources,omitempty"`
	Replicas         int           `json:"replicas" jsonschema:"Number of HA replicas (0=single node/no HA, 1+=HA enabled)"`
	DirectEndpoint   string        `json:"direct_endpoint,omitempty" jsonschema:"Direct database connection endpoint"`
	PoolerEndpoint   string        `json:"pooler_endpoint,omitempty" jsonschema:"Connection pooler endpoint"`
	Paused           bool          `json:"paused"`
	Password         string        `json:"password,omitempty" jsonschema:"Password for tsdbadmin user (only included if with_password=true)"`
	ConnectionString string        `json:"connection_string" jsonschema:"PostgreSQL connection string (password embedded only if with_password=true)"`
}

ServiceDetail represents detailed service information

func (ServiceDetail) Schema added in v0.7.0

func (ServiceDetail) Schema() *jsonschema.Schema

type ServiceGetInput added in v0.7.2

type ServiceGetInput struct {
	ServiceID    string `json:"service_id"`
	WithPassword bool   `json:"with_password,omitempty"`
}

ServiceGetInput represents input for service_get

func (ServiceGetInput) Schema added in v0.7.2

func (ServiceGetInput) Schema() *jsonschema.Schema

type ServiceGetOutput added in v0.7.2

type ServiceGetOutput struct {
	Service ServiceDetail `json:"service"`
}

ServiceGetOutput represents output for service_get

func (ServiceGetOutput) Schema added in v0.7.2

type ServiceInfo

type ServiceInfo struct {
	ServiceID string        `json:"id" jsonschema:"Service identifier (10-character alphanumeric string)"`
	Name      string        `json:"name"`
	Status    string        `json:"status" jsonschema:"Service status (e.g., READY, PAUSED, CONFIGURING, UPGRADING)"`
	Type      string        `json:"type"`
	Region    string        `json:"region"`
	Created   string        `json:"created,omitempty"`
	Resources *ResourceInfo `json:"resources,omitempty"`
}

ServiceInfo represents simplified service information for MCP output

func (ServiceInfo) Schema added in v0.7.0

func (ServiceInfo) Schema() *jsonschema.Schema

type ServiceListInput

type ServiceListInput struct{}

ServiceListInput represents input for service_list

func (ServiceListInput) Schema

type ServiceListOutput

type ServiceListOutput struct {
	Services []ServiceInfo `json:"services"`
}

ServiceListOutput represents output for service_list

func (ServiceListOutput) Schema added in v0.7.0

type ServiceUpdatePasswordInput

type ServiceUpdatePasswordInput struct {
	ServiceID string `json:"service_id"`
	Password  string `json:"password"`
}

ServiceUpdatePasswordInput represents input for service_update_password

func (ServiceUpdatePasswordInput) Schema

type ServiceUpdatePasswordOutput

type ServiceUpdatePasswordOutput struct {
	Message         string                          `json:"message"`
	PasswordStorage *password.PasswordStorageResult `json:"password_storage,omitempty"`
}

ServiceUpdatePasswordOutput represents output for service_update_password

func (ServiceUpdatePasswordOutput) Schema added in v0.7.0

Jump to

Keyboard shortcuts

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