Documentation
¶
Overview ¶
Package mcpserver exposes a reasoning reasoning.ContextProvider as read-only MCP tools for model-driven investigation.
Each tool maps to one context template and accepts only resource IDs the provider knows. Every call is answered from the provider's immutable graph copy and pinned telemetry for one analysis token; tools cannot read live state, write anything, or reach a different graph revision. Results are bounded and report whether any collection was truncated.
Tools:
- get_security_neighborhood: one-hop relationships around the anchors.
- get_telemetry_chain: pinned telemetry touching the anchors.
- get_governance_posture: governed-by relationships and facets, without inferring policy effect.
- find_graph_paths: the subgraph within a fixed hop limit of the anchors, over every registered predicate except runs-on or an explicit predicate allowlist. It returns reachable resources and relationships, not individual paths; the name predates that and is kept for compatibility.
- get_incident_timeline: ordered incident observations for the anchors.
- get_behavior_baseline: previously observed behavior for the anchors.
The reasoning runtime uses ConnectInMemory, so no MCP transport is exposed outside the process. The standalone command exposes NewHTTPHandler over streamable HTTP. ServeStdio remains available to embedders for local experiments.
Index ¶
- func ConnectInMemory(ctx context.Context, provider *reasoning.ContextProvider) (*mcp.ClientSession, func() error, error)
- func New(provider *reasoning.ContextProvider) *mcp.Server
- func NewHTTPHandler(provider *reasoning.ContextProvider) http.Handler
- func ServeStdio(ctx context.Context, provider *reasoning.ContextProvider) error
- type GraphPathInput
- type QueryInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectInMemory ¶
func ConnectInMemory(ctx context.Context, provider *reasoning.ContextProvider) (*mcp.ClientSession, func() error, error)
ConnectInMemory starts a server for provider on an in-process transport and returns a connected client session. The returned close function stops the server and closes the session; callers must call it.
func New ¶
func New(provider *reasoning.ContextProvider) *mcp.Server
New returns an MCP server whose tools all query provider.
func NewHTTPHandler ¶
func NewHTTPHandler(provider *reasoning.ContextProvider) http.Handler
NewHTTPHandler exposes the MCP server using the streamable HTTP transport. The caller must bind it to a loopback or otherwise authenticated listener: the pinned packet may contain sensitive graph and telemetry context.
func ServeStdio ¶
func ServeStdio(ctx context.Context, provider *reasoning.ContextProvider) error
ServeStdio serves provider's tools over stdin and stdout until the session ends.
Types ¶
type GraphPathInput ¶
type GraphPathInput struct {
AnchorIDs []string `json:"anchorIds" jsonschema:"resource IDs supplied by the analysis packet"`
Predicates []graph.Predicate `` /* 136-byte string literal not displayed */
}
GraphPathInput is the argument schema for find_graph_paths, the multi-hop traversal tool.
type QueryInput ¶
type QueryInput struct {
AnchorIDs []string `json:"anchorIds" jsonschema:"resource IDs supplied by the analysis packet"`
}
QueryInput is the argument schema shared by single-template tools.