schema

A command group for reading an MCP server’s available tools, resources, and prompts, then saving that information as a JSON schema. It can also generate typed Rust code for calling the server’s tools.

In plain words
What is it for?
Exporting, validating, and comparing MCP server schemas, or creating Rust clients from them.
Why use it?
It keeps a local description of a server’s interface and helps detect changes between that description and the live server.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/paiml/rust-mcp-sdk/schema
Clone the repo
git clone --depth 1 https://github.com/paiml/rust-mcp-sdk
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00634
Opus 5 $0.00000 $0.00317
Sonnet 5 $0.00000 $0.00127
Haiku 4.5 $0.00000 $0.00063

Measured 2d ago against content hash c2892a329215, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

schema scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cargo-pmcp/docs/commands/schema.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cargo pmcp schema

Export and manage schemas from MCP servers.

Usage

cargo pmcp schema <SUBCOMMAND>

Description

Connect to a foundation MCP server, export its schema (tools, resources, prompts), and generate typed Rust client code for calling its tools. Supports both MCP HTTP and Lambda invocation.

Subcommands

Subcommand Description
export Export schema from an MCP server endpoint
validate Validate a local schema file
diff Compare local schema with a live server

schema export

Export schema from an MCP server endpoint.

cargo pmcp schema export [OPTIONS]

Connects to the server, performs an MCP initialize handshake, then fetches tools, resources, and prompts. Writes a JSON schema file.

Options

Option Description
--endpoint <URL>, -e MCP server endpoint URL
--server <ID>, -s Server ID on pmcp.run (alternative to --endpoint)
--output <PATH>, -o Output file path (default: schemas/<server_id>.json)

One of --endpoint or --server is required.

Examples

# Export from a URL
cargo pmcp schema export --endpoint https://mcp.example.com

# Export from a pmcp.run server
cargo pmcp schema export --server db-demo

# Export to a custom path
cargo pmcp schema export --endpoint https://mcp.example.com --output my-schema.json

schema validate

Validate a local schema file.

cargo pmcp schema validate <SCHEMA>

Checks that the schema JSON is well-formed and contains required fields (server_id, name, tool names).

Arguments

Argument Required Description
SCHEMA Yes Path to the schema file to validate

Example

cargo pmcp schema validate schemas/calculator.json

schema diff

Compare a local schema with a live server.

cargo pmcp schema diff <SCHEMA> --endpoint <URL>

Connects to the live server, fetches its current tools, and reports added/removed tools compared to the local schema file.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 116 lines · 0 tokens per session scan A c2892a329215

Subscribe to this mod's changes

schema is a command published in the GitHub repository paiml/rust-mcp-sdk (53 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 634 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.