stdio

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package stdio implements isolated command-backed MCP components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environment

func Environment(lookup func(string) (string, bool), configured map[string]string) []string

Environment builds a non-nil child environment from an allow-listed host baseline and explicit component values. Explicit values are appended last.

Types

type Factory

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

Factory creates isolated command-backed component sessions.

func NewFactory

func NewFactory(opts Options) *Factory

NewFactory creates a stdio component factory.

func (*Factory) CallTool

func (f *Factory) CallTool(ctx context.Context, server config.Server, params *mcp.CallToolParams) (*mcp.CallToolResult, error)

func (*Factory) Close

func (f *Factory) Close() error

func (*Factory) Discover

func (f *Factory) Discover(ctx context.Context, server config.Server) (*component.Features, error)

Discover starts an isolated process and exhausts all feature lists.

func (*Factory) GetPrompt

func (f *Factory) GetPrompt(ctx context.Context, server config.Server, params *mcp.GetPromptParams) (*mcp.GetPromptResult, error)

func (*Factory) OpenRuntime

func (f *Factory) OpenRuntime(_ context.Context, server config.Server, opts component.RuntimeOptions) (component.Runtime, error)

func (*Factory) ReadResource

func (f *Factory) ReadResource(ctx context.Context, server config.Server, params *mcp.ReadResourceParams) (*mcp.ReadResourceResult, error)

func (*Factory) Subscribe

func (f *Factory) Subscribe(ctx context.Context, server config.Server, params *mcp.SubscribeParams) error

func (*Factory) Unsubscribe

func (f *Factory) Unsubscribe(ctx context.Context, server config.Server, params *mcp.UnsubscribeParams) error

type Options

type Options struct {
	Logger            *slog.Logger
	LookupEnv         func(string) (string, bool)
	TerminateDuration time.Duration
}

Options controls command construction and shutdown.

Jump to

Keyboard shortcuts

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