mcpserver

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollaborationInstructions added in v0.3.0

func CollaborationInstructions() string

CollaborationInstructions exposes the collaboration usage instructions so alternate protocol runtimes reuse the same client guidance.

func CollaborationResourceTemplateInventory added in v0.3.0

func CollaborationResourceTemplateInventory() []map[string]any

CollaborationResourceTemplateInventory exposes collaboration resource templates for alternate protocol runtimes.

func MCPAdditionalCapabilityDefinitions added in v0.3.0

func MCPAdditionalCapabilityDefinitions() ([]transportcatalog.CapabilityDefinition, map[string][]string)

MCPAdditionalCapabilityDefinitions contains MCP-backed capabilities that did not exist in the legacy RemoteCapabilities projection.

func MCPTransportBindings added in v0.3.0

func MCPTransportBindings() ([]transportcatalog.TransportBinding, error)

MCPTransportBindings classifies tools and resources as available only when they are present in the real discovery registry and have callable backing.

func NoteProposalInstructions added in v0.3.0

func NoteProposalInstructions() string

func ResourceTemplateInventory added in v0.3.0

func ResourceTemplateInventory() []map[string]any

func Serve

func Serve(ctx context.Context, service *app.Service, vault string, in io.Reader, out io.Writer) error

func ServeWithOptions added in v0.3.0

func ServeWithOptions(ctx context.Context, service *app.Service, vault string, in io.Reader, out io.Writer, options ServerOptions) error

func TransportManifest added in v0.3.0

func TransportManifest() (transportcatalog.Manifest, error)

TransportManifest assembles the current REST, RPC and local MCP truth for internal conformance. Public query surfaces are added by the manifest task.

Types

type MCPError

type MCPError struct {
	Code    int            `json:"code"`
	Message string         `json:"message"`
	Data    map[string]any `json:"data,omitempty"`
}

func (*MCPError) Error

func (e *MCPError) Error() string

type Request

type Request struct {
	JSONRPC string         `json:"jsonrpc,omitempty"`
	ID      any            `json:"id,omitempty"`
	Method  string         `json:"method"`
	Params  map[string]any `json:"params,omitempty"`
}

type Resource

type Resource struct {
	MIMEType    string `json:"mimeType,omitempty"`
	URI         string `json:"uri"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

func CollaborationResourceInventory added in v0.3.0

func CollaborationResourceInventory() []Resource

CollaborationResourceInventory exposes collaboration static resources for alternate protocol runtimes.

func ConcreteResourceInventory added in v0.3.0

func ConcreteResourceInventory() []Resource

ConcreteResourceInventory is the modern MCP resources/list projection. Parameterized entries are published separately through resources/templates/list as required by the current protocol.

func ResourceInventory added in v0.3.0

func ResourceInventory() []Resource

ResourceInventory is the single discovery projection for resources/list.

type Response

type Response struct {
	JSONRPC   string         `json:"jsonrpc,omitempty"`
	ID        any            `json:"id,omitempty"`
	Tools     []Tool         `json:"tools,omitempty"`
	Resources []Resource     `json:"resources,omitempty"`
	Result    map[string]any `json:"result,omitempty"`
	Error     *MCPError      `json:"error,omitempty"`
}

type Server

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

func NewServer

func NewServer(service *app.Service, vault string) *Server

func NewServerWithOptions added in v0.3.0

func NewServerWithOptions(service *app.Service, vault string, options ServerOptions) *Server

func (*Server) CollaborationToolInventory added in v0.3.0

func (s *Server) CollaborationToolInventory() []Tool

CollaborationToolInventory exposes the per-instance collaboration tool projection so alternate protocol runtimes can register the same tools.

func (*Server) Handle

func (s *Server) Handle(ctx context.Context, req Request) (Response, error)

func (*Server) NoteProposalToolInventory added in v0.3.0

func (s *Server) NoteProposalToolInventory() []Tool

NoteProposalToolInventory is owner-gated and shared by SDK and legacy runtimes.

type ServerOptions added in v0.3.0

type ServerOptions struct {
	NoteProposals   bool
	Collaboration   bool
	NotePolicy      app.CollaborationPolicy
	Input           *inputrequests.Service
	Manifest        func() (domain.Projection, error)
	StrictLifecycle bool
	Diagnostics     io.Writer
}

type Tool

type Tool struct {
	Name         string         `json:"name"`
	Description  string         `json:"description"`
	InputSchema  map[string]any `json:"input_schema,omitempty"`
	OutputSchema map[string]any `json:"output_schema,omitempty"`
	Readonly     bool           `json:"readonly,omitempty"`
	BodyExposure string         `json:"body_exposure,omitempty"`
	CostClass    string         `json:"cost_class,omitempty"`
	Scope        string         `json:"scope,omitempty"`
}

func InputToolInventory added in v0.3.0

func InputToolInventory() []Tool

InputToolInventory exposes the enabled input intake tools so alternate protocol runtimes can register the same tools.

func ToolInventory added in v0.3.0

func ToolInventory() []Tool

ToolInventory is the single discovery projection for tools/list.

Directories

Path Synopsis
Package sdkruntime 提供 Pinax MCP 的官方 Go SDK candidate 运行时。
Package sdkruntime 提供 Pinax MCP 的官方 Go SDK candidate 运行时。

Jump to

Keyboard shortcuts

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