Skip to main content

Module mcp

Module mcp 

Source
Expand description

The mcp module: the MCP projection of this registry, described as one typed value.

MCP is a projection and owns nothing: every tool is a capability, every resource a capability or an object of the layer. What a client can find out about the projection was nevertheless scattered — the protocol versions in initialize, the tools one page at a time in tools/list, the effect of each in an annotation, the client configurations in share/providers.yaml, whether each one starts this repository’s server in a shell function. mcp.projection is the same facts as one answer, read by the Cockpit’s MCP page, the HTTP route, the tool and majordomus mcp --inspect alike, so that none of them keeps an inventory of its own.

Nothing here is a second list. The tools are the registry’s, filtered by the exposure they declare; the effect and the hints are the capability’s classification (ExecutionPolicy::hints); the protocol facts are the constants the server answers initialize with; the clients are the providers the distribution declares.

use majordomus_cli::capability::builtin::mcp;
use majordomus_cli::capability::model::CapabilityKind;

let m = mcp::module();
let c = &m.capabilities[0].capability;
assert_eq!(c.id.as_str(), "mcp.projection");
// describing the projection reads the registry and changes nothing
assert_eq!(c.kind, CapabilityKind::Query);
assert_eq!(c.exposure.http.as_ref().unwrap().path, "/api/v1/mcp");

Structs§

McpClient
One client the distribution declares a project-scoped configuration for.
McpEffectCount
How many tools have one effect.
McpFinding
Something about the projection a person should act on.
McpProjection
The MCP projection of this registry in this repository.
McpProjectionInput
The input of mcp.projection: which tools to list. Everything else in the answer is about the projection as a whole and is always given.
McpResourceSummary
The resources a client can read.
McpServerIdentity
Who answers initialize, as it answers.
McpServing
What the server serves of the protocol, and what it does not.
McpToolEntry
One tool, as the registry projects it.
McpTransportEntry
One way a client reaches the server.

Enums§

McpClientStanding
Where a client’s project-scoped configuration stands in this repository.

Constants§

LAUNCHER
The launcher a client configuration names: the one command that finds or builds the executable and speaks MCP. Relative to a repository that carries it, and the name of the installed command where a repository does not.
MCP_URI
The URI under which the description is read as a resource.

Functions§

describe
The projection as the capability answers it, for a caller inside this program that already holds the context: mcp --inspect prints the same value the tool, the resource and the route are asked for, and reading it cannot fail, because nothing in it is fetched — the registry, the peer board and the layer’s index are in the context, and a client configuration that cannot be read is one that is absent.
module
The mcp module: the one capability that describes the MCP projection, composed into the application like every other module, so that describing the projection is itself a tool, a resource and a route of it.
standing
Where a client configuration stands: read from the file, never from a list of who is expected to be wired.
tools
Every tool the registry projects, in registry order.