mcp

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package mcp provides an MCP server that exposes TaskFlow resources and operations as MCP resources and tools. Both are auto-derived from model.Resources() and model.Operations().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(client *httpclient.Client, notifier *Notifier) *gomcp.Server

NewServer creates an MCP server with all TaskFlow resources and tools registered. If notifier is non-nil, tool responses include pending notifications from other actors.

Types

type Notification

type Notification struct {
	Event     string `json:"event"`
	Board     string `json:"board"`
	Task      string `json:"task,omitempty"`
	Actor     string `json:"actor"`
	Summary   string `json:"summary"`
	Timestamp string `json:"timestamp"`
}

Notification is a summary of a domain event from another actor.

type Notifier

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

Notifier subscribes to the global event stream and buffers notifications from other actors. Pending notifications are retrieved and cleared on each tool call via Drain().

func NewNotifier

func NewNotifier(ctx context.Context, client *httpclient.Client, selfName string) *Notifier

NewNotifier starts a background event subscription and buffers notifications from actors other than selfName. Cancel the context to stop.

func (*Notifier) Drain

func (n *Notifier) Drain() []Notification

Drain returns all pending notifications and clears the buffer.

Jump to

Keyboard shortcuts

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