Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(client ManagementClient, version string) *mcp.Server
NewServer builds a tools-only MCP server backed by vmflow's daemon management API.
func RunStdio ¶
func RunStdio(ctx context.Context, stdin io.Reader, stdout io.Writer, client ManagementClient, version string) error
RunStdio serves one MCP client over the supplied streams. The streams are not closed because the caller normally owns os.Stdin and os.Stdout. Callers must keep diagnostics on stderr so stdout remains a JSON-RPC-only channel.
Types ¶
type ManagementClient ¶
type ManagementClient interface {
Session(context.Context) (*controlapi.SessionResponse, error)
ConfigRules(context.Context) (*controlapi.ConfigRulesResponse, error)
Rules(context.Context) (*controlapi.RulesResponse, error)
Stats(context.Context) (*controlapi.StatsResponse, error)
CurrentPrecheck(context.Context) (*controlapi.CurrentPrecheckResponse, error)
}
ManagementClient is the read-only subset of the daemon management client used by MCP. Keeping this boundary small makes tool contracts testable and prevents write APIs from becoming reachable through the MCP server.
Click to show internal directories.
Click to hide internal directories.