expose

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(ctx context.Context, exec Executor, cfg *ServerConfig) (*http.Server, error)

NewHTTPServer constructs an MCP HTTP server exposing selected executor tools. It does not start listening; callers should run ListenAndServe and handle shutdown.

Types

type Executor

type Executor interface {
	LLMCore() LLMCore
	ExecuteTool(ctx context.Context, name string, args map[string]interface{}, timeoutSec int) (interface{}, error)
}

Executor is the minimal runtime contract needed by MCP expose handlers.

type LLMCore

type LLMCore interface {
	ToolDefinitions() []llm.ToolDefinition
}

LLMCore exposes tool definitions required by MCP tool listing.

type ServerConfig

type ServerConfig struct {
	Port      int      `yaml:"port"`
	ToolItems []string `yaml:"toolItems"`
}

ServerConfig defines MCP server exposure options.

func (*ServerConfig) ToolPatterns

func (c *ServerConfig) ToolPatterns() []string

type ToolHandler

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

ToolHandler exposes executor tool registry via MCP tools/list and tools/call.

func NewToolHandler

func NewToolHandler(exec Executor, patterns []string) *ToolHandler

func (*ToolHandler) Implements

func (h *ToolHandler) Implements(method string) bool

func (*ToolHandler) OnNotification

func (h *ToolHandler) OnNotification(_ context.Context, _ *jsonrpc.Notification)

Jump to

Keyboard shortcuts

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