mcp

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mcp provides the JSON-serializable model, mapper, and option decoder for the MCP layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeOptions

func DecodeOptions(raw json.RawMessage) ([]greet.GreetOption, error)

DecodeOptions decodes raw MCP options into engine GreetOptions.

func FromResult

func FromResult(data greet.LayerData) any

FromResult maps a *greetmcp.MCPResult to *Data. It returns the input unchanged when data is not a *greetmcp.MCPResult.

func Register

func Register(c *jsonapi.Codec)

Register registers the MCP data mapper and option decoder on the given Codec.

Types

type Data

type Data struct {
	ProtocolVersion   string                           `json:"protocolVersion"`
	ServerInfo        *sdkmcp.Implementation           `json:"serverInfo,omitempty"`
	Capabilities      *sdkmcp.ServerCapabilities       `json:"capabilities,omitempty"`
	Resources         []*greetmcp.ResourceInfo         `json:"resources,omitempty"`
	ResourceTemplates []*greetmcp.ResourceTemplateInfo `json:"resourceTemplates,omitempty"`
	Tools             []*greetmcp.ToolInfo             `json:"tools,omitempty"`
	Prompts           []*greetmcp.PromptInfo           `json:"prompts,omitempty"`
}

Data is the JSON-serializable payload for an MCP layer.

type Options

type Options struct {
	ClientInfo            *sdkmcp.Implementation `json:"clientInfo,omitempty"`
	Path                  string                 `json:"path,omitempty"`
	BearerToken           string                 `json:"bearerToken,omitempty"`
	ListResources         bool                   `json:"listResources,omitempty"`
	ListTools             bool                   `json:"listTools,omitempty"`
	ListPrompts           bool                   `json:"listPrompts,omitempty"`
	ListResourceTemplates bool                   `json:"listResourceTemplates,omitempty"`
}

Options holds JSON-serializable MCP layer options.

Jump to

Keyboard shortcuts

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