server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package server exposes the store over MCP: three stdio tools, no state of its own. The tool descriptions are agent-facing product surface — they are what makes an agent reach for a channel without being told — so they say when to use each verb, not just what it does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(s *mcp.Server, st Store)

Register wires the three channel tools onto s.

Types

type ListArgs

type ListArgs struct{}

ListArgs are the (empty) inputs to channel.list.

type ListResult

type ListResult struct {
	Channels []store.Info `json:"channels"`
}

ListResult is the output of channel.list.

type PostArgs

type PostArgs struct {
	Channel string `json:"channel" jsonschema:"channel name; created on first post"`
	From    string `json:"from" jsonschema:"your identity as shown to readers, e.g. an agent or session name"`
	Body    string `json:"body" jsonschema:"the message"`
}

PostArgs are the inputs to channel.post.

type PostResult

type PostResult struct {
	Posted store.Message `json:"posted"`
}

PostResult is the output of channel.post.

type ReadArgs

type ReadArgs struct {
	Channel string `json:"channel" jsonschema:"channel name"`
	Since   string `json:"since,omitempty" jsonschema:"opaque cursor from a prior read; omit to read from the start"`
	Limit   int    `json:"limit,omitempty" jsonschema:"max messages to return; 0 or omitted = all"`
}

ReadArgs are the inputs to channel.read.

type ReadResult

type ReadResult struct {
	Messages []store.Message `json:"messages"`
	Cursor   string          `json:"cursor"`
}

ReadResult is the output of channel.read.

type Store

type Store interface {
	Post(name, from, body string) (store.Message, error)
	Read(name, cursor string, limit int) ([]store.Message, string, error)
	List() ([]store.Info, error)
}

Store is the narrow store surface the MCP tools need.

Jump to

Keyboard shortcuts

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