agent-cassette
Records and deterministically replays Ollama LLM HTTP/SSE token streams and tool-call interactions, enabling offline agent tests without a live model server.
Records and deterministically replays OpenAI and OpenAI-compatible LLM HTTP/SSE token streams and tool-call interactions, enabling offline agent tests without live API keys.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
agent-cassette
Deterministic VCR cassette recorder and offline replay proxy for LLM HTTP/SSE streams and MCP stdio runs. Replay multi-turn agent tests in ~0ms in CI without GPUs or live API keys.
Install
bunx @kanchingyg/agent-cassette record -- npm test
npx @kanchingyg/agent-cassette record -- npm test
# or install in your project / globally
bun add -d @kanchingyg/agent-cassette
npm i -D @kanchingyg/agent-cassetteJSR:
bunx jsr add @kanchingyg/agent-cassette
npx jsr add @kanchingyg/agent-cassetteRelated MCP server: ResiliReplay
Quick start
# Record live LLM HTTP/SSE and MCP interactions into a deterministic cassette
npx @kanchingyg/agent-cassette record -- npm test
bunx @kanchingyg/agent-cassette record -- bun test
# Replay offline in CI in ~0ms with zero network calls or API keys
npx @kanchingyg/agent-cassette replay -- npm test
# Run as an MCP server over stdio
npx @kanchingyg/agent-cassette --mcpFeatures
HTTP & SSE stream recording: Captures chunked token streams from OpenAI, Anthropic, Ollama, and OpenAI-compatible endpoints and replays them deterministically.
Prompt & tool-call hashing: Normalizes volatile headers and timestamps while matching prompt and tool-call signatures.
Automatic secret scrubbing: Strips
Authorization,x-api-key, and bearer tokens before writing cassette files to disk.SSRF & path containment: Blocks private-network target redirection and enforces workspace path containment on cassette reads/writes.
MCP setup
{
"mcpServers": {
"agent-cassette": {
"command": "npx",
"args": ["-y", "@kanchingyg/agent-cassette", "--mcp"]
}
}
}MCP Tools Reference
Tool | Mutates | Description |
|
| Inspect recorded HTTP, SSE, and MCP interactions inside a cassette JSON file with secret scrubbing. |
|
| Compute semantic prompt and tool-call drift between two recorded agent cassettes. |
|
| Remove stale entries from a cassette file on disk (requires |
Editor and Agent Integration
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"agent-cassette": {
"command": "npx",
"args": ["-y", "@kanchingyg/agent-cassette", "--mcp"]
}
}
}Claude Code CLI
claude mcp add agent-cassette -- npx -y @kanchingyg/agent-cassette --mcpProgrammatic Usage (JSR / TypeScript)
import * as bridge from "jsr:@kanchingyg/agent-cassette/bridge";Runtime Safety and Guardrails
Stdio frame isolation: When
--mcpis active,hijackStdoutForMcp()redirects accidentalconsole.logcalls tostderrso JSON-RPC 2.0 frames onstdoutnever corrupt.Read-only by default: Mutating tools (
mutates: true) are blocked in--dry-runmode and require explicit--allow-writeauthorization.Loop breaker: Repeated identical
(toolName, args)invocations are hashed with SHA-256 and halted after 3 consecutive repeats to prevent runaway agent loops.Context budget truncation: Tool outputs are middle-truncated (
60%head /40%tail) scaled to the probed local modeln_ctx(Ollama/api/show, llama.cpp/props, vLLM/v1/models).Secret redaction and path normalization: AWS keys (
AKIA*,ASIA*), bearer tokens, andsk-*keys are scrubbed before returning tool output, and Windows drive paths (C:\...) translate cleanly to/mnt/c/...when WSL mode is enabled.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan prompts for injection attacks, redact PII, and audit LLM SDK usage from any MCP client
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
Security firewall for AI agents — scans MCP calls for injection, secrets, and risks.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceVCR for MCP servers: a zero-dependency stdio proxy that records and replays MCP JSON-RPC tool calls to local cassette files, enabling deterministic, offline testing of AI agent workflows without side-effects or rate limits.1MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP and coding-agent reliability harness that captures bounded, sanitized failure evidence and generates deterministic executable regression tests. Capture is opt-in; no API key or hosted service is required.2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceLets coding agents drive a record-replay fake LLM server by listing parked calls, answering them, pre-recording new entries, editing and pinning existing ones, and testing prompt matches. It exposes this over streamable HTTP at /mcp/ or as a stdio server.1Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables real-time injection fuzzing, exfiltration canary detection, least-privilege tool sandboxing, and cryptographic audit proofs for untrusted prompts, RAG context, and agent actions over MCP.MIT