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

serve

package
v0.19.12 Latest Latest
Warning

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

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

Documentation

Overview

Package serve offers an Orb session's tools to another agent harness over MCP, the protocol harnesses take outside tools through. The harness integration chooses the tools (those its harness lacks) and carries the messages, over its own channel with a Pipe or over any go-sdk transport. Each call runs through engine.RunToolCall, so argument validation and the session's tool-call hooks, Orb's permission policy among them, apply as in Orb's own loop.

Index

Constants

This section is empty.

Variables

View Source
var Implementation = mcp.Implementation{Name: "orb", Version: "0.1.0"}

Implementation is how Orb names itself to MCP peers, as client and as server.

Functions

This section is empty.

Types

type Pipe

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

Pipe is a transport over a channel the harness integration already has: it hands each message that arrives to Deliver, and write sends one out in the harness's own framing. One Pipe carries one connection.

func NewPipe

func NewPipe(write func(json.RawMessage) error) *Pipe

func (*Pipe) Close

func (p *Pipe) Close() error

func (*Pipe) Connect

func (p *Pipe) Connect(context.Context) (mcp.Connection, error)

func (*Pipe) Deliver

func (p *Pipe) Deliver(message json.RawMessage) error

Deliver queues a message from the harness; it never waits on the server, so the harness's reader keeps reading while a tool runs.

func (*Pipe) Read

func (p *Pipe) Read(ctx context.Context) (jsonrpc.Message, error)

func (*Pipe) SessionID

func (p *Pipe) SessionID() string

func (*Pipe) Write

func (p *Pipe) Write(_ context.Context, message jsonrpc.Message) error

type Server

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

Server is one session's tool server; each harness connection is a session of it.

func New

func New() *Server

func (*Server) Connect

func (s *Server) Connect(ctx context.Context, transport mcp.Transport) error

Connect serves one harness connection until its transport closes.

func (*Server) Offer

func (s *Server) Offer(ctx context.Context, options engine.RunToolCallOptions)

Offer puts options.Tools on offer, run with options from now on and stopped when ctx ends, as the harness's own request may be; connected harnesses hear of every change to the list.

Jump to

Keyboard shortcuts

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