mcpserve

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 34 Imported by: 1 module, 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 mcpserve runs icebath as a stdio MCP server over the messaging conversations, optionally with icebath tools

Index

Constants

View Source
const QueueLimit = 1000

Events the bridge queue keeps, the oldest dropped past it

View Source
const ServerName = "icebath"

MCP server name clients see in the initialize reply

Variables

View Source
var ExposedTools = []string{
	"web_search", "web_extract",
	"browser_navigate", "browser_click", "browser_type", "browser_press", "browser_snapshot", "browser_scroll",
	"browser_back", "browser_get_images", "browser_console", "browser_vision",
	"vision_analyze", "image_generate", "skill_view", "skills_list", "text_to_speech",
}

Fixed allowlist --tools offers, never terminal, file, code execution, process, kanban or delegation tools

Functions

func CreateServer

func CreateServer(ctx context.Context, bridge *EventBridge, includeTools bool, in io.Reader, out io.Writer) (*provider.MCPToolServer, error)

MCP server with every bridge tool and, with includeTools, the curated icebath tools after them

func RunServer

func RunServer(ctx context.Context, verbose, includeTools, acceptHooks bool) (code int)

Serves icebath over stdio MCP until the client disconnects and returns the exit status of icebath mcp-serve

Types

type EventBridge

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

Poller of state.db feeding new conversation messages into an in memory event queue that waiters block on

func NewEventBridge

func NewEventBridge(ctx context.Context) *EventBridge

Stopped bridge over the state.db of the home ctx names

func (*EventBridge) ListPendingApprovals

func (b *EventBridge) ListPendingApprovals() []any

Approval requests seen this session ordered by creation time

func (*EventBridge) PollEvents

func (b *EventBridge) PollEvents(afterCursor int64, sessionKey string, limit int64) *jsonutil.Object

Events since afterCursor and the cursor to poll from next

func (*EventBridge) RespondToApproval

func (b *EventBridge) RespondToApproval(approvalID, decision string) *jsonutil.Object

Resolves a pending approval and queues its resolution event

func (*EventBridge) Start

func (b *EventBridge) Start()

Baselines existing history without emitting it, then polls in the background

func (*EventBridge) Stop

func (b *EventBridge) Stop()

Ends the polling loop, wakes every waiter and closes the version gate

func (*EventBridge) WaitForEvent

func (b *EventBridge) WaitForEvent(afterCursor int64, sessionKey string, timeoutMs int64) any

Blocks until a matching event arrives or the timeout expires, nil on timeout

type QueueEvent

type QueueEvent struct {
	Cursor     int64
	Type       string
	SessionKey any
	Data       *jsonutil.Object
}

One entry of the bridge event queue, a message or an approval request or resolution

Jump to

Keyboard shortcuts

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