Documentation
¶
Index ¶
- func SubstituteArguments(input string, args map[string]interface{}, argDefs []types.MCPArgument) (string, error)
- func SubstituteProcessConfig(proc *types.ProcessConfig, args map[string]interface{}) (*types.ProcessConfig, error)
- type MCPManager
- type ProcessRunner
- type Server
- func (s *Server) GetRegisteredProcesses() []string
- func (s *Server) IsMCPProcess(name string) bool
- func (s *Server) RegisterControlTools() error
- func (s *Server) RegisterProcess(proc *types.ProcessConfig) error
- func (s *Server) SetStdio(stdin io.Reader, stdout io.Writer)
- func (s *Server) Start() error
- func (s *Server) Stop() error
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
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 ¶
GetRegisteredProcesses returns the list of registered MCP processes
func (*Server) IsMCPProcess ¶
IsMCPProcess returns true if the given process name is MCP-registered
func (*Server) RegisterControlTools ¶ added in v1.110.0
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 ¶
SetStdio sets the stdin and stdout for the MCP server when using stdio transport