mcpserver

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcpserver is the stdio MCP server interactive sessions and onward-enabled workers use to send mail (RFC 7.2).

There is deliberately no tool that reads another agent's inbound mail or the agent's own handled items (D4): reading those is a human action.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context) error

Run serves MCP on stdio.

func Server

func Server(id Identity, dial func() (*api.Client, error)) *mcp.Server

Server builds the MCP server for an identity. dial opens a daemon client.

func ToolNames

func ToolNames(origin string) []string

ToolNames returns the tool names exposed for an origin (tests assert this list matches RFC 7.2 exactly).

Types

type AgentsIn

type AgentsIn struct{}

AgentsIn is smif_agents' input (none).

type AskIn

type AskIn struct {
	To       string         `json:"to" jsonschema:"agent id"`
	Intent   string         `json:"intent" jsonschema:"e.g. store.status"`
	Subject  string         `json:"subject"`
	Body     string         `json:"body,omitempty"`
	Priority string         `json:"priority,omitempty" jsonschema:"low|normal|high|urgent"`
	Data     map[string]any `json:"data,omitempty"`
	WaitS    int            `json:"wait_s,omitempty" jsonschema:"seconds to wait, max 120"`
}

AskIn is smif_ask's input.

type AwaitIn

type AwaitIn struct {
	Ticket string `json:"ticket" jsonschema:"from smif_ask"`
	WaitS  int    `json:"wait_s,omitempty" jsonschema:"max 120"`
}

AwaitIn is smif_await's input.

type Identity

type Identity struct {
	Agent  string
	Origin string // interactive | worker | none
	Auth   api.Auth
}

Identity is who the server acts as.

func Resolve

func Resolve(cwd string) Identity

Resolve picks the identity: a worker run token, SMIF_AGENT, or the agent whose repo contains cwd. Origin "none" means an unregistered directory: only smif_agents is exposed.

type SendIn

type SendIn struct {
	To        string         `json:"to" jsonschema:"agent id"`
	Kind      string         `json:"kind,omitempty" jsonschema:"tell (default) or event"`
	Intent    string         `json:"intent" jsonschema:"e.g. crash.report"`
	Subject   string         `json:"subject"`
	Body      string         `json:"body,omitempty"`
	Priority  string         `json:"priority,omitempty" jsonschema:"low|normal|high|urgent"`
	DedupeKey string         `json:"dedupe_key,omitempty" jsonschema:"event repeats with this key merge"`
	Data      map[string]any `json:"data,omitempty"`
}

SendIn is smif_send's input.

type StatusIn

type StatusIn struct{}

StatusIn is smif_status' input (none).

Jump to

Keyboard shortcuts

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