mcp

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(cfg Config, backend Backend) (http.Handler, error)

NewHandler builds an MCP streamable HTTP handler with optional API-key auth and endpoint-local rate limiting.

Types

type Backend

type Backend interface {
	Write(ctx context.Context, indexID, content string, metadata map[string]string) (map[string]any, error)
	Read(ctx context.Context, indexID, neuronID string) (map[string]any, error)
	Search(ctx context.Context, indexID, query string, depth, limit int, metadata map[string]string, strict bool) (map[string]any, error)
	Recall(ctx context.Context, indexID string, limit int) (map[string]any, error)
	Context(ctx context.Context, indexID, cue string, depth, maxTokens int) (map[string]any, error)
	RegistryFindOrCreate(ctx context.Context, uuid string, metadata map[string]any) (map[string]any, error)
}

Backend is the minimal capability contract exposed to MCP tools.

type Config

type Config struct {
	APIKey         string
	Stateless      bool
	RateLimitRPS   float64
	RateLimitBurst int
	EnablePrompts  bool
	AllowedTools   []string
}

Config controls MCP route behavior.

Jump to

Keyboard shortcuts

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