validate

A cargo pmcp command that checks MCP server components before they run or are deployed. MCP is a way for applications to expose tools and workflows to an AI agent.

In plain words
What is it for?
Use it to validate project workflows or perform a pre-flight check of .pmcp/deploy.toml before deploying to AWS.
Why use it?
It catches structural and deployment permission errors early, including unsafe cloud access declarations, without making AWS API calls during the deployment dry run.

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/validate
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 904 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.00904
Opus 5 $0.00000 $0.00452
Sonnet 5 $0.00000 $0.00181
Haiku 4.5 $0.00000 $0.00090

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

Security

Grade A, and why

validate 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/validate.md · 122 lines

How it starts

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

cargo pmcp validate

Validate MCP server components.

Usage

cargo pmcp validate <SUBCOMMAND>

Description

Runs validation checks on workflows, tools, and other server components. Helps catch structural errors before runtime.

Subcommands

Subcommand Description
workflows Validate all workflows in the project
deploy Validate .pmcp/deploy.toml — dry-run for IAM declarations before cargo pmcp deploy

validate deploy

Dry-run validator for .pmcp/deploy.toml. Runs the same gate that cargo pmcp deploy runs immediately before cdk deploy, but makes no AWS API calls — use it as a pre-flight check.

cargo pmcp validate deploy [OPTIONS]

Options

Option Description
--verbose, -v Print the resolved project root
<server> Positional: path to the server directory (defaults to current directory)

What it checks

Full rule catalog lives in DEPLOYMENT.md § IAM Declarations → Validation rules. Summary:

  • Hard error — Wildcard escalation (Allow + actions=["*"] + resources=["*"]) in any [[iam.statements]] entry.
  • Hard erroreffect not in {"Allow", "Deny"} (case-sensitive).
  • Hard error — Empty actions or resources in any [[iam.statements]].
  • Hard error — Action does not match ^[a-z0-9-]+:[A-Za-z0-9*]+$.
  • Hard error — Sugar keyword not in {"read", "write", "readwrite"}.
  • Hard error — Empty name in any [[iam.tables]] or [[iam.buckets]].
  • Warning — Unknown service prefix (not in the curated 40-service list).
  • Warning — Cross-account ARN pins (12-digit account segment).

Hard errors return non-zero; warnings print to stderr but return zero.

Examples

# Validate the project in the current directory
cargo pmcp validate deploy

# Validate a specific server directory, with verbose output
cargo pmcp validate deploy --verbose ./servers/cost-coach

# CI gate — fails on any hard-error rule
cargo pmcp validate deploy || exit 1

Read the full file on GitHub · 122 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 · 122 lines · 0 tokens per session scan A a128551cc338

Subscribe to this mod's changes

validate 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 904 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.