mcpserver

package
v0.0.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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.

Jump to

Keyboard shortcuts

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