msw-setup

msw-setup is a skill for Claude Code, Codex from JasonBoy/msw-mcp. It costs 52 tokens per session (517 once invoked), scanned A, original, MIT.

A setup guide for MSW and its MCP client in a web project. MSW is a tool that intercepts network requests so an app can use controlled mock responses during development and testing.

In plain words
What is it for?
Use it when adding MSW to a new web app or moving an existing project to this setup, including projects built with Vite, Next.js, Rspack, Rsbuild, or Webpack.
Why use it?
It removes the manual work of adding the mock service, connecting its browser bridge, and checking that early API requests are actually intercepted.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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 skills/jasonboy/msw-mcp/msw-setup
Any agent
npx skills add JasonBoy/msw-mcp --skill msw-setup
Clone the repo
git clone --depth 1 https://github.com/JasonBoy/msw-mcp

Made for: Claude Code, Codex.

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 msw-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/jasonboy/msw-mcp/msw-setup.svg)](https://agentmods.dev/skills/jasonboy/msw-mcp/msw-setup)
Your own site
<a href="https://agentmods.dev/skills/jasonboy/msw-mcp/msw-setup"><img src="https://agentmods.dev/badge/skills/jasonboy/msw-mcp/msw-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 517 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.1 $0.00052 $0.00517
Opus 5 $0.00026 $0.00259
Sonnet 5 $0.00010 $0.00103
Haiku 4.5 $0.00005 $0.00052

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

Security

Grade A, and why

msw-setup 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 6d 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.

skills/msw-setup/SKILL.md · 29 lines

What it actually says

msw-setup

Project scaffolding for MSW + the MCP client bridge. For runtime handler changes after setup, use the msw-cli skill.

Workflow

  1. Run msw-cli setup in the project root (optional: --framework vite).
  2. Follow the printed setup guide step by step (detect bundler, install deps, create mocks/, env vars, entry point).
  3. Run msw-cli open and set the app's WebSocket URL to the URL from the output.
  4. Run msw-cli status after starting the dev server — confirm connected: true (this only proves the WebSocket bridge, not that the first browser requests were intercepted).
  5. Hard reload the app and confirm in DevTools → Network that initial API calls are mocked. This catches render-before-mock races that msw-cli status misses.
  6. Use msw-cli add (and related commands) to manage mocks at runtime.

Do not duplicate the full setup guide in chat — execute from msw-cli setup output.

Notes

  • Ask permission before npm install / npx msw init (as the guide describes).
  • The WebSocket URL env var name depends on the framework: NEXT_PUBLIC_MSW_WS_URL (Next.js), VITE_MSW_WS_URL (Vite), or MSW_WS_URL (Rspack/Rsbuild/Webpack) — must match the port from msw-cli open. (MCP_SERVER_URL is accepted as a legacy fallback.)
  • Next.js App Router: app/layout.tsx is a Server Component; the MSW bootstrap must be a 'use client' gate so the app subtree does not mount (and fetch) before initMocks() finishes. Follow the guide’s gated MswProvider pattern — do not start MSW in a parallel useEffect while rendering the full tree.
  • MCP users can still use /msw-setup in an MCP client; the same guide backs both paths.
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. 6d ago First seen · 29 lines · 52 tokens per session scan A 07cfcaa16815

Subscribe to this mod's changes

msw-setup is a skill published in the GitHub repository JasonBoy/msw-mcp (81 stars, last pushed 2mo ago), licensed MIT. It adds 52 tokens to every session and 517 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories