mcp

package
v1.110.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubstituteArguments

func SubstituteArguments(input string, args map[string]interface{}, argDefs []types.MCPArgument) (string, error)

SubstituteArguments replaces @{arg} and @{arg:default} patterns with actual values Returns the modified command string

func SubstituteProcessConfig

func SubstituteProcessConfig(proc *types.ProcessConfig, args map[string]interface{}) (*types.ProcessConfig, error)

SubstituteProcessConfig creates a copy of the process config with substituted arguments

Types

type MCPManager

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

MCPManager handles MCP server lifecycle

func NewMCPManager

func NewMCPManager(runner ProcessRunner, mcpConfig *types.MCPServerConfig, processes types.Processes) *MCPManager

NewMCPManager creates a new MCP manager if MCP is configured

func (*MCPManager) SetStdio

func (m *MCPManager) SetStdio(stdin io.Reader, stdout io.Writer)

SetStdio sets the stdin and stdout for the MCP server when using stdio transport

func (*MCPManager) Start

func (m *MCPManager) Start() error

Start starts the MCP server

func (*MCPManager) Stop

func (m *MCPManager) Stop() error

Stop stops the MCP server

type ProcessRunner

type ProcessRunner interface {
	StartProcess(name string) error
	StopProcess(name string) error
	StopProcesses(names []string) (map[string]string, error)
	RestartProcess(name string) error
	ScaleProcess(name string, scale int) error
	GetProcessState(name string) (*types.ProcessState, error)
	GetProcessesState() (*types.ProcessesState, error)
	GetProcessPorts(name string) (*types.ProcessPorts, error)
	GetProjectState(checkMem bool) (*types.ProjectState, error)
	GetProcessLog(name string, offsetFromEnd, limit int) ([]string, error)
	GetProcessLogLength(name string) int
	SetProcessInfo(config *types.ProcessConfig) error
	TruncateProcessLogs(name string) error
}

ProcessRunner defines the interface needed from ProjectRunner

type Server

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

Server wraps the MCP server and integrates with process-compose

func NewServer

func NewServer(runner ProcessRunner, config *types.MCPServerConfig) *Server

NewServer creates a new MCP server instance

func (*Server) GetRegisteredProcesses

func (s *Server) GetRegisteredProcesses() []string

GetRegisteredProcesses returns the list of registered MCP processes

func (*Server) IsMCPProcess

func (s *Server) IsMCPProcess(name string) bool

IsMCPProcess returns true if the given process name is MCP-registered

func (*Server) RegisterControlTools added in v1.110.0

func (s *Server) RegisterControlTools() error

RegisterControlTools registers all built-in process-compose control tools (process and project management) on the MCP server.

func (*Server) RegisterProcess

func (s *Server) RegisterProcess(proc *types.ProcessConfig) error

RegisterProcess registers a process as an MCP tool or resource

func (*Server) SetStdio

func (s *Server) SetStdio(stdin io.Reader, stdout io.Writer)

SetStdio sets the stdin and stdout for the MCP server when using stdio transport

func (*Server) Start

func (s *Server) Start() error

Start starts the MCP server with the configured transport

func (*Server) Stop

func (s *Server) Stop() error

Stop gracefully stops the MCP server

Jump to

Keyboard shortcuts

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