mcp

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mcp provides a Model Context Protocol (MCP) server that exposes workflow engine functionality to AI assistants. The server dynamically reflects available module types, step types, trigger types, plugin information, and configuration validation so that AI tools can author and validate workflow YAML files with accurate, up-to-date knowledge.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the MCP server version, set at build time.

Functions

This section is empty.

Types

type EngineProvider added in v0.3.0

type EngineProvider interface {
	// BuildFromConfig builds the engine from a parsed workflow config.
	BuildFromConfig(cfg *config.WorkflowConfig) error
	// Start starts the engine and all registered triggers.
	Start(ctx context.Context) error
	// Stop gracefully shuts down the engine.
	Stop(ctx context.Context) error
	// TriggerWorkflow dispatches a workflow execution.
	TriggerWorkflow(ctx context.Context, workflowType string, action string, data map[string]any) error
}

EngineProvider is the interface that the MCP server requires from the workflow engine. It is kept intentionally narrow so that the mcp package does not import the root workflow package directly.

type Server

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

Server wraps an MCP server instance and provides workflow-engine-specific tools and resources.

func NewServer

func NewServer(pluginDir string, opts ...ServerOption) *Server

NewServer creates a new MCP server with all workflow engine tools and resources registered. pluginDir is the directory where installed plugins reside (e.g., "data/plugins"). If set, the server will read plugin manifests from this directory and include plugin-provided types in all type listings. Optional ServerOption values can be provided to attach an engine, etc.

func (*Server) MCPServer

func (s *Server) MCPServer() *server.MCPServer

MCPServer returns the underlying mcp-go server instance (useful for testing).

func (*Server) ServeStdio

func (s *Server) ServeStdio() error

ServeStdio starts the MCP server over standard input/output.

type ServerOption added in v0.3.0

type ServerOption func(*Server)

ServerOption configures optional Server behaviour.

func WithEngine added in v0.3.0

func WithEngine(engine EngineProvider) ServerOption

WithEngine attaches a pre-built workflow engine to the MCP server, enabling the run_workflow tool for AI-driven workflow execution.

type TemplateFunctionDef added in v0.3.0

type TemplateFunctionDef struct {
	Name        string `json:"name"`
	Signature   string `json:"signature"`
	Description string `json:"description"`
	Example     string `json:"example"`
}

TemplateFunctionDef describes a template function available in pipeline templates.

Jump to

Keyboard shortcuts

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