mcp

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransportStdio          = "stdio"
	TransportStreamableHTTP = "streamable_http"
)

Variables

This section is empty.

Functions

func CreateServer

func CreateServer(version string, cfg *config.File) (*mcp.Server, error)

CreateServer creates a new MCP server

func NewStreamableHTTPHandler added in v0.0.6

func NewStreamableHTTPHandler(server *mcp.Server, authToken string) (http.Handler, error)

NewStreamableHTTPHandler creates a streamable HTTP handler with required auth.

Types

type ProfileShowInput

type ProfileShowInput struct {
	Name string `json:"name" jsonschema:"Profile name"`
}

ProfileShowInput represents the input for the profile_show tool

type QueryInput

type QueryInput struct {
	SQL     string `json:"sql" jsonschema:"SQL query to execute"`
	Profile string `json:"profile" jsonschema:"Profile name to use"`
}

QueryInput represents the input for the query tool

type ToolHandler

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

ToolHandler manages MCP tools

func NewToolHandler

func NewToolHandler(cfg *config.File) *ToolHandler

NewToolHandler creates a new tool handler

func (*ToolHandler) ProfileList

func (h *ToolHandler) ProfileList(ctx context.Context, req *mcp.CallToolRequest, input struct{}) (*mcp.CallToolResult, any, error)

ProfileList lists all profiles

func (*ToolHandler) ProfileShow

func (h *ToolHandler) ProfileShow(ctx context.Context, req *mcp.CallToolRequest, input ProfileShowInput) (*mcp.CallToolResult, any, error)

ProfileShow shows profile details

func (*ToolHandler) Query

Query executes a SQL query

func (*ToolHandler) RegisterTools

func (h *ToolHandler) RegisterTools(server *mcp.Server)

RegisterTools registers all tools with the MCP server

Jump to

Keyboard shortcuts

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