diff --git a/packages/plugin/.claude-plugin/plugin.json b/packages/plugin/.claude-plugin/plugin.json index 233711a..826927b 100644 --- a/packages/plugin/.claude-plugin/plugin.json +++ b/packages/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "mpp-inspector", - "description": "Inspect, debug, and test Machine Payments Protocol (HTTP 402) endpoints directly from your AI coding assistant", + "description": "Inspect, debug, and test Machine Payments Protocol (HTTP 402) endpoints directly from Claude Code", "version": "0.1.0", "author": { "name": "MPP Inspector Contributors", @@ -17,5 +17,13 @@ "tempo", "debugging", "mcp" - ] + ], + "commands": ["./skills/"], + "mcpServers": { + "mpp-inspector": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"] + } + }, + "hooks": "./hooks/hooks.json" } diff --git a/packages/plugin/hooks/hooks.json b/packages/plugin/hooks/hooks.json index b485229..8c13fef 100644 --- a/packages/plugin/hooks/hooks.json +++ b/packages/plugin/hooks/hooks.json @@ -2,10 +2,11 @@ "hooks": { "SessionStart": [ { + "matcher": "startup|resume", "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/hooks/session-check.js", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/session-check.js\"", "timeout": 5000 } ] diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 60ade07..7e28f28 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -13,8 +13,7 @@ "dist", ".claude-plugin", "skills", - "hooks", - ".mcp.json" + "hooks" ], "scripts": { "build": "tsup", diff --git a/packages/plugin/skills/mpp-flow/SKILL.md b/packages/plugin/skills/mpp-flow/SKILL.md new file mode 100644 index 0000000..746d30a --- /dev/null +++ b/packages/plugin/skills/mpp-flow/SKILL.md @@ -0,0 +1,27 @@ +--- +description: Dry-run the full MPP (Machine Payments Protocol) payment flow against a URL. Steps through request, parse, sign, retry, and verify without making real transactions. +--- + +# MPP Flow + +Dry-run the full MPP payment flow against an endpoint. + +## Usage + +``` +/mpp-flow +/mpp-flow https://mpp.dev/api/ping/paid +``` + +## What to do + +1. Use the `mpp_flow` MCP tool with the URL provided by the user +2. Present each step of the flow: + - Step 1: Request resource (GET/POST) + - Step 2: Parse 402 challenge + - Step 3: Sign transaction (dry-run — shows what would happen) + - Step 4: Retry with credential (dry-run) + - Step 5: Verify receipt (dry-run) +3. Show timing breakdown and total flow time + +If no URL is provided, use the default: `https://mpp.dev/api/ping/paid` diff --git a/packages/plugin/skills/mpp-inspect/SKILL.md b/packages/plugin/skills/mpp-inspect/SKILL.md new file mode 100644 index 0000000..f635908 --- /dev/null +++ b/packages/plugin/skills/mpp-inspect/SKILL.md @@ -0,0 +1,37 @@ +--- +description: Inspect an MPP (Machine Payments Protocol) 402 challenge from a URL. Parses the WWW-Authenticate header, decodes the base64url request payload, identifies the payment method, and runs verification checks. +--- + +# MPP Inspect + +Inspect a 402 Payment Required challenge from an MPP endpoint. + +## Usage + +``` +/mpp-inspect +/mpp-inspect https://mpp.dev/api/ping/paid +``` + +## What to do + +1. Use the `mpp_inspect` MCP tool with the URL provided by the user +2. Present the results clearly: + - Challenge ID, realm, method, intent + - Decoded request payload (amount, currency, recipient, chainId) + - Problem Details body if present (RFC 9457) + - Verification results (expiry, method known, amount parseable, recipient valid) +3. Explain any issues found in plain language + +If no URL is provided, use the default test endpoint: `https://mpp.dev/api/ping/paid` + +## Example output format + +``` +MPP Challenge at https://mpp.dev/api/ping/paid +- Method: Tempo (blockchain stablecoin) +- Amount: 100,000 units +- Chain: Tempo Mainnet (42431) +- Expires in: 5 minutes +- All verification checks passed ✓ +``` diff --git a/packages/plugin/skills/mpp-scan/SKILL.md b/packages/plugin/skills/mpp-scan/SKILL.md new file mode 100644 index 0000000..ad1161a --- /dev/null +++ b/packages/plugin/skills/mpp-scan/SKILL.md @@ -0,0 +1,24 @@ +--- +description: Scan a domain for MPP (Machine Payments Protocol) endpoints. Checks /.well-known/mpp.json, /llms.txt, /health, and optionally probes common API paths. +--- + +# MPP Scan + +Discover MPP endpoints on a domain. + +## Usage + +``` +/mpp-scan +/mpp-scan mpp.dev +``` + +## What to do + +1. Use the `mpp_scan` MCP tool with the domain provided by the user +2. Present discovered endpoints: + - Which discovery files exist (mpp.json, llms.txt, health) + - List of endpoints found with their payment methods and pricing +3. Suggest follow-up actions (e.g., inspect specific endpoints) + +If the user adds `--probe`, set `probe: true` to also check common API paths.