Help us shape the future of Go! Take the 2026 Go Developer Survey

serverwire

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package serverwire is the sole go-sdk adapter for the bounded MCP server.

Index

Constants

View Source
const (
	CodeInvalidParams = jsonrpc.CodeInvalidParams
	CodeInternalError = jsonrpc.CodeInternalError
)

Variables

View Source
var ErrBatchUnsupported = errors.New("batch requests are not supported")
View Source
var ErrClosed = errors.New("server closed")
View Source
var ErrInputEnvelope = errors.New("input envelope exceeds limit")
View Source
var ErrInputLimit = errors.New("input exceeds limit")
View Source
var ErrInvalidArgument = errors.New("invalid argument")
View Source
var ErrOutputLimit = errors.New("output exceeds limit")
View Source
var NewClient = mcp.NewClient

Functions

This section is empty.

Types

type Adapter

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

func New

func New(cfg Config) *Adapter

func (*Adapter) RegisterTool

func (a *Adapter) RegisterTool(t Tool)

func (*Adapter) Serve

func (a *Adapter) Serve(ctx context.Context, r io.ReadCloser, w io.WriteCloser) error

Serve owns both endpoints. Cancellation closes them before waiting for the SDK session.

type CallToolParams

type CallToolParams = mcp.CallToolParams

type Client

type Client = mcp.Client

type ClientSession

type ClientSession = mcp.ClientSession

type Config

type Config struct {
	Name, Version                                  string
	MaxMessageBytes, MaxInputBytes, MaxOutputBytes int
	MaxConcurrentRequests                          int
	MaxRequestIDBytes                              int
}

type Content

type Content struct{ Text string }

type FrameReader

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

func NewFrameReader

func NewFrameReader(r io.Reader, max int, idmax ...int) *FrameReader

func (*FrameReader) Read

func (r *FrameReader) Read(p []byte) (int, error)

type FrameWriter

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

func NewFrameWriter

func NewFrameWriter(w io.Writer, max int) *FrameWriter

func (*FrameWriter) Write

func (w *FrameWriter) Write(p []byte) (int, error)

type Handler

type Handler func(context.Context, json.RawMessage) (Result, error)

type IOTransport

type IOTransport = mcp.IOTransport

type Implementation

type Implementation = mcp.Implementation

type JSONRPCError

type JSONRPCError = jsonrpc.Error

type Result

type Result struct {
	Content           []Content
	StructuredContent json.RawMessage
	IsError           bool
}

type TextContent

type TextContent = mcp.TextContent

type Tool

type Tool struct {
	Name, Title, Description  string
	InputSchema, OutputSchema json.RawMessage
	Handler                   Handler
}

type ToolResult

type ToolResult = mcp.CallToolResult

Jump to

Keyboard shortcuts

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