mcphost

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mcphost bridges MCP stdio to the separate, pinned Restish MCP helper. It deliberately does not implement MCP or discover Restish plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, cfg Config) error

Serve launches Executable directly and brokers only the protocol capabilities needed by restish-mcp v2.3.0. Generic errors never include helper payloads.

Types

type Config

type Config struct {
	Executable     string
	In             io.Reader
	Out, Err       io.Writer
	Spec           []byte
	Operations     []string
	RequestTimeout int
	MaxResultBytes int
	Execute        func(context.Context, plugin.HTTPRequestMsg) plugin.HTTPResponseMsg
}

Config is supplied by the application's guarded resource policy boundary. Spec must already be filtered, and Execute must independently enforce allowed requests. In remains caller-owned. Readers should unblock on context cancellation when possible: an arbitrary Reader (including idle os.Stdin) cannot be interrupted safely without closing it. At most one bounded read goroutine may remain until that reader next returns. Writers and Execute must return on cancellation; arbitrary blocking user callbacks cannot be forcibly interrupted by Go.

Jump to

Keyboard shortcuts

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