msw-mcp: an MCP server for managing Mock Service Worker network mocks

msw-mcp: an MCP server for managing Mock Service Worker network mocks

msw-mcp•byjasonboy

A monorepo whose msw-mcp package is a Model Context Protocol server that lets AI assistants add, update, and remove MSW network mocks through a browser WebSocket bridge.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Lets assistants manage MSW mocks through MCP tools, bridging to the browser over WebSocket so handlers can change without page reloads.
  • •Supports adding, updating, and removing mocks dynamically without restarting the application source code.
  • •Provides an /msw-setup prompt to scaffold the MSW browser setup including the worker bridge.
  • •A core daemon handles sessions and brokers communication between the MCP server and the browser client.

BEST FOR

  • •AI-assisted frontend development where assistants need to create or modify MSW mock handlers during a live session.
  • •Teams that want to drive MSW mock handler changes from MCP-capable assistants rather than editing source code.

ABOUT MSW-MCP

msw-mcp: an MCP server for managing Mock Service Worker network mocks is cataloged as an MCP server attributed to jasonboy. A monorepo whose msw-mcp package is a Model Context Protocol server that lets AI assistants add, update, and remove MSW network mocks through a browser WebSocket bridge. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for msw-mcp: an MCP server for managing Mock Service Worker network mocks are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can mocks be changed while the app is running?

Yes, mocks can be added, updated, and removed dynamically, and handler updates apply without reloading the page.

How does the MCP server communicate with the browser?

It uses a WebSocket bridge between the CLI/MCP side and the browser, with a core daemon brokering communication to the client.

Upstream README

View this exact version on GitHub

README.md · 5b54cb3da466 · Fetched 2026-11-13 09:08:17 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MSW AI Agent Bridge Monorepo

npm version npm version CI License: MIT

This monorepo provides a suite of tools that bridge AI agents with Mock Service Worker (MSW). It enables dynamic addition, updating, and removal of MSW network mocks directly from a command-line interface or AI tool execution, completely independently of the application source code restarts.

Demo

Walkthrough of the MCP-driven MSW workflow (browser bridge, live handler updates):

https://github.com/user-attachments/assets/06959759-b198-4cd1-ae2b-11ede32acd8e

Key features

  • 🤖 Generate MSW handlers with AI
  • ⚡ Update mocks without reloading the page
  • 🌉 WebSocket bridge between Cli/MCP and the browser
  • 🛠️ Scaffold MSW setup with msw-cli setup or MCP's /msw-setup prompt
  • 💻 Terminal and script control via msw-cli
  • ⚙️ Configurable port, persistence, and client targeting
  • ✨ Agent skills for AI agents to use

Structure

This project is set up as a monorepo using pnpm and turbo.

  • apps/docs (@msw-mcp/docs): Starlight documentation site for MSW Agent Tools (CLI, MCP, guides). Source lives under apps/docs/src/content/docs/.
  • packages/msw-cli: The command-line interface (msw-cli) used by AI agents or developers to send dynamic handler updates. Run msw-cli setup to scaffold a project, then msw-cli open plus handler commands.
  • packages/msw-mcp: The published Model Context Protocol server (msw-mcp) so assistants can manage mocks via MCP tools.
  • packages/client (@msw-mcp/client): The browser/environment client that listens for updates and registers them with the local MSW setup.
  • packages/core (@msw-mcp/core): The core daemon process and session management logic that brokers communication between the CLI or MCP server and the client.

Documentation site

From the repo root:

pnpm --filter @msw-mcp/docs dev

Opens the local docs dev server (default Astro port, often http://localhost:4321). Production search (Pagefind) is easiest to verify after pnpm --filter @msw-mcp/docs build and pnpm --filter @msw-mcp/docs preview.

More detail: apps/docs/README.md.

Quick setup: msw-cli

  1. Install the CLI globally: npm install -g msw-cli (or use your package manager’s equivalent).

  2. In a new project, run msw-cli setup and follow the printed steps for MSW + @msw-mcp/client.

  3. Start a session, then drive handlers from the shell:

    msw-cli open
    msw-cli add "http.get('/api/user', () => HttpResponse.json({ id: 1 }))"
    msw-cli status
    msw-cli close
    

Full command reference, flags, and workflows: packages/msw-cli/README.md.

Quick setup: msw-mcp (MCP)

  1. Register the server in your MCP client (example for JSON config):

    {
      "mcpServers": {
        "msw-mcp": {
          "command": "npx",
          "args": ["msw-mcp@latest"]
        }
      }
    }
    
  2. In the client, use the /msw-setup prompt (or follow manual steps) so the browser app loads msw, @msw-mcp/client, and the worker bridge.

Installation options (VS Code, Claude Code, Cursor, etc.), architecture, MCP tools, and manual setup: packages/msw-mcp/README.md.

Development Scripts

Run these scripts from the root directory using pnpm:

  • pnpm build: Compiles all packages using Turborepo.
  • pnpm dev: Starts the development pipelines for all packages.
  • pnpm format: Formats the code using Prettier.
  • pnpm lint: Runs linting checks across the repository.

Getting Started

  1. Install dependencies:

    pnpm install
    
  2. Build the project:

    pnpm build
    
  3. Use the CLI:
    You can navigate to the CLI directory or use it directly via node after building:

    node packages/msw-cli/build/index.js help
    

License

This project is licensed under the MIT License — see LICENSE.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for msw-mcp: an MCP server for managing Mock Service Worker network mocks from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/msw-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools