mcp

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 24 Imported by: 0 modules, 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 mcp provides the MCP server adapter for Prism.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, runner app.AgentRunner) error

Serve starts the MCP server over stdio until the client disconnects.

func ServeWithConfig added in v0.1.14

func ServeWithConfig(ctx context.Context, runner app.AgentRunner, cfg Config) error

func StatusSummary

func StatusSummary(runner app.AgentRunner) string

StatusSummary returns a one-line startup message for logging.

Types

type CallMCPToolInput added in v0.1.14

type CallMCPToolInput struct {
	Server    string         `json:"server"`
	Tool      string         `json:"tool"`
	Arguments map[string]any `json:"arguments,omitempty"`
}

type Config added in v0.1.14

type Config struct {
	Policy         *internalpolicy.Engine
	EventSink      observe.Sink
	DownstreamMCP  *downstreammcp.Client
	EventStorePath string
	RootDir        string
	SkillsDir      string
	SkillsFS       fs.FS
}

type DoctorInput

type DoctorInput struct{}

type ExplainPolicyInput added in v0.1.14

type ExplainPolicyInput struct {
	AgentID string `json:"agent_id"`
	// omitempty keeps these optional in the inferred tool schema — a policy
	// question may involve no skills or plugins, and source defaults to
	// "mcp" in the handler.
	Skills  []string `json:"skills,omitempty"`
	Plugins []string `json:"plugins,omitempty"`
	Source  string   `json:"source,omitempty"`
}

type GetConstitutionInput

type GetConstitutionInput struct {
	AgentID string `json:"agent_id"`
}

type GetPromptInput

type GetPromptInput struct {
	PromptID  string            `json:"prompt_id"`
	Variables map[string]string `json:"variables,omitempty"`
}

type GetPromptOutput

type GetPromptOutput struct {
	PromptID string `json:"prompt_id"`
	Title    string `json:"title"`
	Prompt   string `json:"prompt"`
}

type GetResourceInput

type GetResourceInput struct {
	URI string `json:"uri"`
}

type GetResourceOutput

type GetResourceOutput struct {
	URI      string `json:"uri"`
	Name     string `json:"name"`
	MimeType string `json:"mime_type"`
	Content  string `json:"content"`
}

type ListAgentsInput

type ListAgentsInput struct{}

type ListAgentsOutput

type ListAgentsOutput struct {
	Agents []agent.Summary `json:"agents"`
	Count  int             `json:"count"`
}

type ListMCPServerToolsInput added in v0.1.14

type ListMCPServerToolsInput struct {
	Server        string `json:"server"`
	IncludeSchema bool   `json:"include_schema,omitempty"`
	MaxTools      int    `json:"max_tools,omitempty"`
}

type ListMCPServerToolsOutput added in v0.1.14

type ListMCPServerToolsOutput struct {
	Server string                      `json:"server"`
	Tools  []downstreammcp.ToolSummary `json:"tools"`
	Count  int                         `json:"count"`
	// Total is the number of tools the downstream server actually exposes;
	// when Truncated is true the list was cut at max_tools.
	Total     int  `json:"total"`
	Truncated bool `json:"truncated,omitempty"`
}

type ListMCPServersInput added in v0.1.14

type ListMCPServersInput struct{}

type ListMCPServersOutput added in v0.1.14

type ListMCPServersOutput struct {
	Configured bool                   `json:"configured"`
	Servers    []downstreammcp.Server `json:"servers"`
}

type ListPoliciesInput added in v0.1.14

type ListPoliciesInput struct{}

type ListPoliciesOutput added in v0.1.14

type ListPoliciesOutput struct {
	Configured bool   `json:"configured"`
	Reason     string `json:"reason"`
}

type ListPromptsInput

type ListPromptsInput struct{}

type ListPromptsOutput

type ListPromptsOutput struct {
	Prompts []PromptTemplate `json:"prompts"`
	Count   int              `json:"count"`
}

type ListResourcesInput

type ListResourcesInput struct{}

type ListResourcesOutput

type ListResourcesOutput struct {
	Resources []MCPResource `json:"resources"`
	Count     int           `json:"count"`
}

type MCPResource

type MCPResource struct {
	URI         string `json:"uri"`
	Name        string `json:"name"`
	Description string `json:"description"`
	MimeType    string `json:"mime_type"`
}

type PromptTemplate

type PromptTemplate struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Variables   []string `json:"variables,omitempty"`
}

PromptTemplate describes an LLM-callable prompt helper exposed as an MCP tool.

type RunAgentInput

type RunAgentInput struct {
	AgentID    string          `json:"agent_id"`
	Task       string          `json:"task"`
	SkillNames []string        `json:"skill_names"`
	Format     string          `json:"format,omitempty"`
	Workspace  *WorkspaceInput `json:"workspace,omitempty"`
}

type RunGraphInput added in v0.1.14

type RunGraphInput struct {
	Graph graphpkg.Definition `json:"graph"`
}

type SkillHealth added in v0.1.14

type SkillHealth struct {
	Name     string   `json:"name"`
	OK       bool     `json:"ok"`
	Chars    int      `json:"chars"`
	Evals    int      `json:"evals,omitempty"`
	Errors   []string `json:"errors,omitempty"`
	Warnings []string `json:"warnings,omitempty"`
}

type SkillHealthInput added in v0.1.14

type SkillHealthInput struct {
	SkillName string `json:"skill_name,omitempty"`
}

type SkillHealthOutput added in v0.1.14

type SkillHealthOutput struct {
	Skills []SkillHealth `json:"skills"`
	Count  int           `json:"count"`
}

type SuggestRouteInput added in v0.1.14

type SuggestRouteInput struct {
	Task string `json:"task"`
	// omitempty keeps source optional in the inferred tool schema; the
	// handler defaults it to "mcp". Without it the SDK rejects calls that
	// omit source before the handler can apply the default.
	Source string `json:"source,omitempty"`
}

type UsageSummaryInput added in v0.1.14

type UsageSummaryInput struct{}

type WorkspaceInput added in v0.1.21

type WorkspaceInput struct {
	Root string `json:"root"`
}

Jump to

Keyboard shortcuts

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