agent

A command-line tool for creating and running AI agents that use a language model and connected tools in a repeated loop. It can scaffold a Rust package and run it against compatible online or offline completion sources.

In plain words
What is it for?
Use it to create an agent package, run the agent locally, test it with different completion sources, and prepare it for deployment through existing target adapters.
Why use it?
It provides a starting structure and local runner, so you do not have to assemble the agent package and execution setup yourself.

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/agent
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 1,140 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.01140
Opus 5 $0.00000 $0.00570
Sonnet 5 $0.00000 $0.00228
Haiku 4.5 $0.00000 $0.00114

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

Security

Grade A, and why

agent 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/agent.md · 123 lines

How it starts

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

cargo pmcp agent

Scaffold and run deploy-anywhere agents (an agent is an MCP client with a loop).

Usage

cargo pmcp agent <SUBCOMMAND>

Description

An agent is a pmcp-agent loop that drives a completion source (an LLM) against a set of tools. cargo pmcp agent is the on-ramp for building and running one — it mirrors the server story (new to scaffold, dev to run locally), so the same muscle memory carries over.

  • agent new scaffolds a compilable agent crate: an AgentPackage manifest (agent.package.json), a manifest-driven runner, the full dependency set, and an in-scaffold version-pin tripwire test against pmcp-agent.
  • agent dev runs the loop locally against an OpenAI-compatible endpoint, a sampling host, or an offline fixed source.

An agent deploys through the existing target adapters — an agent-as-server is just a server binary, so cargo pmcp deploy applies once you wrap it.

Subcommands

Subcommand Description
new Scaffold a new agent package (AgentPackage manifest + runnable crate)
dev Run an agent loop against a completion source

agent new

Scaffold a runnable agent crate at ./<name> (or <path>/<name>). The emitted crate compiles as-is: it loads its own agent.package.json, drives AgentEngine, and ships a tests/pin.rs tripwire that fails if the generated pmcp-agent pin drifts.

cargo pmcp agent new <NAME> [--path <DIR>] [--force]

Options

Option Description
<NAME> Name of the agent package to scaffold (positional, required; validated as a Cargo crate name)
--path <DIR> Parent directory to create the package in (defaults to the current dir, so the package lands at ./<name>)
--force Overwrite an existing non-empty destination directory. A symlinked or file destination is always refused

Example

$ cargo pmcp agent new demo_agent
✓ Agent package created successfully!

🚀 Next Steps (deploy-anywhere agent):
  1. Enter your package:
     cd demo_agent
  2. Run it (drives the agent loop; edit agent.package.json to point at your model):
     cargo run
  3. Verify the pin tripwire stays green:
     cargo test --test pin

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

Subscribe to this mod's changes

agent 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 1,140 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.