mcp

package
v0.0.0-...-dfb39b5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ToolAliases = map[string]string{
	"compose_namespace_list": "compose_namespace_lookup",
	"compose_module_list":    "compose_module_lookup",
}

ToolAliases maps old tool names to their current equivalents. Add entries here when a tool is renamed so existing agents keep working.

Functions

func ResolveToolAlias

func ResolveToolAlias(name string) string

ResolveToolAlias returns the current tool name for a given name, resolving any alias.

Types

type MCPServer

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

func NewMCPServer

func NewMCPServer(reg *Registry, name, version string) *MCPServer

func (*MCPServer) MountRoutes

func (m *MCPServer) MountRoutes(r chi.Router)

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) ExecuteTool

func (r *Registry) ExecuteTool(ctx context.Context, toolName string, args map[string]any) (any, error)

func (*Registry) GetTools

func (r *Registry) GetTools(ctx context.Context, allowedTools []string) ([]rt.Tool, error)

func (*Registry) HasTool

func (r *Registry) HasTool(name string) bool

func (*Registry) RegisterHiddenTool

func (r *Registry) RegisterHiddenTool(tool mcp.Tool, title string, handler server.ToolHandlerFunc)

func (*Registry) RegisterResource

func (r *Registry) RegisterResource(resource mcp.Resource, handler server.ResourceHandlerFunc)

func (*Registry) RegisterTool

func (r *Registry) RegisterTool(tool mcp.Tool, title string, handler server.ToolHandlerFunc)

func (*Registry) RegisterToolWithAvailability

func (r *Registry) RegisterToolWithAvailability(tool mcp.Tool, title string, handler server.ToolHandlerFunc, available func() bool)

Jump to

Keyboard shortcuts

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