MCP integration
Use component-shape-mcp when an application must expose component metadata
or typed Rust inputs through MCP. The crate keeps each published schema paired
with the decoder and handler contract that accepts it.
Add the crate as shown in Getting started. Its default features include the schema and tool-input derives.
Choose the input contract
- Use
McpInputandschema_for_inputfor coarse metadata published by a component shape. - Use
McpJsonSchemafor a nested Rust value with a precise JSON Schema. - Use
McpToolValuewhen one value needs both schema and strict decoding. - Use
McpToolInputfor a named top-level tool argument struct. - Use
McpRange<T>for a typed{ "min": ..., "max": ... }range. - Use
McpAnyonly when unconstrained JSON is intentional.
Follow the integration path
- Define schemas and strict arguments in Schemas and decoding.
- Pair arguments with handlers and structured results in Tools and results.
- Compose registrations and choose a transport in Servers and stdio.
The crate checks protocol contracts and executes Koruma rules for validated typed registrations. Koruma is the ecosystem’s canonical domain validator. Your application selects the rules, authorizes calls, and decides what handlers may do.