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

mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mcp exposes devbay to coding agents.

This is the primary interface, not a wrapper around the CLI. An agent shelling out and parsing terminal output is lossy in both directions: it has to guess at formatting that changes between versions, and it loses the distinction between "the test failed" and "the command failed". Every tool here returns a typed object.

Written against the 2026-07-28 spec, which changed three things that shape this file:

  • The protocol core is stateless. There is no initialize handshake and no session id, so no bay state may be keyed on a connection. Every tool takes an explicit bay name.
  • Servers cannot initiate requests. Nothing here calls out to the client; logs are pulled through a tool rather than pushed.
  • Custom transports over a reliable byte stream should reuse the stdio framing, which is newline-delimited JSON-RPC. So a unix socket and stdio are the same code path, and the shim binary an agent spawns is a pipe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SocketPath

func SocketPath() string

SocketPath is the default control socket.

Types

type Server

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

Server serves the devbay tool surface.

func NewServer

func NewServer(mgr *bay.Manager) *Server

NewServer builds a server over a bay manager.

func (*Server) ListenUnix

func (s *Server) ListenUnix(ctx context.Context, path string) error

ListenUnix serves on a unix socket until the context is cancelled.

One daemon owns the ports, containers and worktrees for a machine, and many agent sessions connect to it. A socket rather than a per-session process is what makes that possible.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, rw io.ReadWriter) error

Serve runs the JSON-RPC loop over one connection.

func (*Server) Tools

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

Tools returns the registered tools.

type Tool

type Tool struct {
	Name        string         `json:"name"`
	Title       string         `json:"title,omitempty"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
	// contains filtered or unexported fields
}

Tool is one callable capability.

Jump to

Keyboard shortcuts

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