402-mcp CLAUDE.md

402-mcp CLAUDE.md is an instructions file for Claude Code from forgesworn/402-mcp. It costs 1,229 tokens per session, scanned A, original, MIT.

Instructions for Claude Code when it works on the 402-mcp project, a server that lets AI agents discover, pay for, and use payment-protected APIs. They cover running the project, configuration, testing, and security-sensitive behaviour.

In plain words
What is it for?
They help Claude Code build, test, and type-check the project, run it through local or network connections, configure wallet and spending limits, and follow its code and security conventions.
Why use it?
They give Claude Code the details needed to start the server correctly and change code without overlooking payment, spending, or network-safety settings.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

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 instructions/forgesworn/402-mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/forgesworn/402-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 402-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/forgesworn/402-mcp/claude-md.svg)](https://agentmods.dev/instructions/forgesworn/402-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/forgesworn/402-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/forgesworn/402-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,229 This file is loaded in full into every session.
When invoked 1,229 The same file — it is already loaded in full.
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.1 $0.01229 $0.01229
Opus 5 $0.00615 $0.00615
Sonnet 5 $0.00246 $0.00246
Haiku 4.5 $0.00123 $0.00123

Measured 5d ago against content hash 4fb60a07b650, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

402-mcp CLAUDE.md 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 5d 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.

CLAUDE.md · 92 lines

How it starts

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

CLAUDE.md - 402-mcp

L402 + x402 client MCP - AI agents discover, pay for, and consume any payment-gated API autonomously.

Commands

npm run build       # tsc → build/
npm test            # vitest run
npm run typecheck   # tsc --noEmit

Running

# Stdio transport (default — used by MCP clients like Claude Desktop)
node build/index.js

# HTTP transport (for network access, e.g. behind a reverse proxy)
TRANSPORT=http PORT=3402 node build/index.js

Key environment variables:

Variable Default Purpose
NWC_URI_FILE Absolute path to a private 0600 file containing the NWC bearer URI
CASHU_TOKENS Path to Cashu token store file
MAX_AUTO_PAY_SATS 1000 Auto-pay threshold per request
MAX_SPEND_PER_MINUTE_SATS 10000 Rolling 60s spend cap
CREDENTIAL_STORE ~/.402-mcp/credentials.json Path to credential store (must be within home dir)
TRANSPORT stdio stdio or http
PORT 3402 HTTP transport listen port
BIND_ADDRESS 127.0.0.1 HTTP transport bind address
CORS_ORIGIN false CORS origin for HTTP transport (* or specific origin)
HUMAN_PAY_TIMEOUT_S 600 Timeout for human wallet QR payment (seconds)
HUMAN_PAY_POLL_S 3 Poll interval for human wallet payment (seconds)
FETCH_TIMEOUT_MS 30000 Outbound HTTP request timeout
FETCH_MAX_RETRIES 2 Max retries for non-mutating requests
FETCH_MAX_RESPONSE_BYTES 10485760 Max response body size (10 MiB)
SSRF_ALLOW_PRIVATE false Allow requests to private IPs (local dev only)
ALLOW_INSECURE_TLS false Acknowledge risk when NODE_TLS_REJECT_UNAUTHORIZED=0

Structure

src/
  index.ts              # Entry point: transport setup, tool registration
  config.ts             # Environment variable parsing, defaults
  fetch/                # Resilient fetch: SSRF guard, timeout, retry
  tools/                # One file per MCP tool (handler + registration)
  wallet/               # Payment implementations (NWC, Cashu melt, human)
  store/                # Persistent JSON stores (credentials, Cashu tokens)
  l402/                 # L402 protocol utilities (parse, detect, cache, bolt11)
  x402/                 # x402 protocol utilities (parse, payment deeplinks)
tests/                  # Tests mirror src/ structure (tests/tools/, tests/wallet/, etc.)
  e2e/                  # Integration tests against in-process toll-booth

Read the full file on GitHub · 92 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. 5d ago First seen · 92 lines · 1,229 tokens per session scan A 4fb60a07b650

Subscribe to this mod's changes

402-mcp CLAUDE.md is an instructions file published in the GitHub repository forgesworn/402-mcp (0 stars, last pushed 2d ago), licensed MIT. It adds 1,229 tokens to every session, about $0.0061 per session on Opus 5. 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-31.