mcp

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 8 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 mcp serves one scan to AI agents over the Model Context Protocol. The tools are read-only and answer from the facts file and the map derived from it, each fact with its file and line evidence. Nothing here adds structure: an agent reads what the scanner found, never a guess. See https://cernly.dev/how/mcp/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(src *Source, version string) *sdk.Server

NewServer returns an MCP server with the read-only tools over src.

Types

type FindInput

type FindInput struct {
	Kind   string `json:"kind,omitempty" jsonschema:"fact kind, e.g. service, dependency, env_var, outbound_host, route; empty for all"`
	Text   string `json:"text,omitempty" jsonschema:"case-insensitive text to find in the key or attributes"`
	Path   string `json:"path,omitempty" jsonschema:"only facts with evidence in this file or under this directory"`
	Limit  int    `json:"limit,omitempty" jsonschema:"page size, default 50, at most 500"`
	Offset int    `json:"offset,omitempty" jsonschema:"number of matches to skip"`
}

type FindOutput

type FindOutput struct {
	Total       int         `json:"total"`
	Facts       []fact.Fact `json:"facts"`
	KindsInScan []string    `json:"kinds_in_scan,omitempty"`
}

type GetInput

type GetInput struct {
	Kind string `json:"kind" jsonschema:"the fact's kind"`
	Key  string `json:"key" jsonschema:"the fact's key, as find_facts returns it"`
}

type GetOutput

type GetOutput struct {
	Fact fact.Fact `json:"fact"`
}

type KindCount

type KindCount struct {
	Kind  string `json:"kind"`
	Count int    `json:"count"`
}

type MapInput

type MapInput struct {
	Section string `` /* 272-byte string literal not displayed */
	Text    string `json:"text,omitempty" jsonschema:"case-insensitive text to find in an item"`
	Limit   int    `json:"limit,omitempty" jsonschema:"page size, default 50, at most 500"`
	Offset  int    `json:"offset,omitempty" jsonschema:"number of matches to skip"`
}

type MapOutput

type MapOutput struct {
	Section string `json:"section"`
	Total   int    `json:"total"`
	Items   []any  `json:"items"`
}

type PluginProblem

type PluginProblem struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Errors int    `json:"errors"`
}

type SectionCount

type SectionCount struct {
	Section string `json:"section"`
	Count   int    `json:"count"`
}

type Source

type Source struct {
	Scan *fact.Scan
	Map  *rules.Map
}

Source is what the server answers from: one scan and its map.

type Summary

type Summary struct {
	Repo           string            `json:"repo"`
	Commit         string            `json:"commit"`
	CommittedAt    string            `json:"committed_at"`
	Extractor      string            `json:"extractor"`
	RulesVersion   string            `json:"rules_version"`
	Facts          int               `json:"facts"`
	Kinds          []KindCount       `json:"kinds"`
	PluginProblems []PluginProblem   `json:"plugin_problems"`
	Exclusions     []fact.Exclusion  `json:"exclusions"`
	Stacks         []rules.StackRole `json:"stacks"`
	Map            []SectionCount    `json:"map"`
	// Surface metrics in total and in production; per service in the
	// metrics section.
	Total      *rules.Surface `json:"total,omitempty"`
	Production *rules.Surface `json:"production,omitempty"`
}

Jump to

Keyboard shortcuts

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