mcpserver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeStdio

func ServeStdio(ctx context.Context, host HostContext, opts ...ServerOption) error

ServeStdio runs the reserved MCP server over stdin/stdout until the client disconnects.

Types

type Engine

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

Engine resolves child agents and executes them as real nested ACP sessions.

func NewEngine

func NewEngine(opts ...Option) *Engine

NewEngine constructs a nested-agent execution engine with default dependencies.

func (*Engine) RunAgent

func (e *Engine) RunAgent(
	ctx context.Context,
	host HostContext,
	req RunAgentRequest,
) RunAgentResult

RunAgent executes one child reusable agent and always returns a structured result payload suitable for the reserved `run_agent` tool.

type HostContext

type HostContext struct {
	BaseRuntime reusableagents.NestedBaseRuntime
	Nested      reusableagents.NestedExecutionContext
}

HostContext carries the host-owned state that a reserved `run_agent` tool call is allowed to inherit.

func LoadHostContextFromEnv

func LoadHostContextFromEnv() (HostContext, error)

LoadHostContextFromEnv loads the host-owned reserved-server runtime payload from PRODUCTIZE_RUN_AGENT_CONTEXT.

type Option

type Option func(*Engine)

Option configures an Engine.

func WithPromptExecutor

WithPromptExecutor overrides the real nested ACP prompt runner for tests.

type RunAgentRequest

type RunAgentRequest struct {
	Name  string `json:"name"`
	Input string `json:"input"`
}

RunAgentRequest is the generic nested-agent tool contract.

type RunAgentResult

type RunAgentResult struct {
	Name            string                           `json:"name"`
	Source          string                           `json:"source"`
	Output          string                           `json:"output"`
	RunID           string                           `json:"run_id,omitempty"`
	Success         bool                             `json:"success"`
	Error           string                           `json:"error,omitempty"`
	Blocked         bool                             `json:"blocked,omitempty"`
	BlockedReason   kinds.ReusableAgentBlockedReason `json:"blocked_reason,omitempty"`
	ParentAgentName string                           `json:"parent_agent_name,omitempty"`
	Depth           int                              `json:"depth,omitempty"`
	MaxDepth        int                              `json:"max_depth,omitempty"`
}

RunAgentResult is the deterministic nested-agent success/failure payload.

type Server

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

Server serves the reserved Productize MCP tool surface over stdio.

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer constructs the reserved stdio MCP server.

func (*Server) RunStdio

func (s *Server) RunStdio(ctx context.Context, host HostContext) error

RunStdio runs the reserved MCP server over stdin/stdout until the client disconnects.

type ServerOption

type ServerOption func(*Server)

ServerOption configures the stdio MCP server.

func WithEngine

func WithEngine(engine *Engine) ServerOption

WithEngine overrides the nested-agent execution engine.

func WithImplementation

func WithImplementation(impl *mcp.Implementation) ServerOption

WithImplementation overrides the advertised MCP implementation metadata.

Jump to

Keyboard shortcuts

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