Skip to content
Agents tracked: 378 Downloads (7d): 244M down 5.7% GitHub stars: 8.4M VS Code installs: 151M Releases (7d): 407 Agent status: 1 with issues Updated Oct 10, 2026

Mock Service Worker

API mocking library for seamless request interception in tests and development.

Testing npm MIT

Used in agent projects
100
0.8% of 12,697 public repos built with AI coding agents
Rank in testing
#12 of 40
by use in those projects
Downloads
22.7M
npm, last 7 days, msw
GitHub stars
18.3K
last push Oct 10, 2026

How Mock Service Worker is used

Mock Service Worker is a dependency in 100 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (0.8%), #12 of 40 in testing. The most used alternative there is Vitest. Projects that use it most often also use Vitest (75.0%), Testing Library (74.0%), Playwright (JavaScript) (63.0%).

Often used with Mock Service Worker

Vitest75.0% of Mock Service Worker projects · 6.1× more than average
Testing Library74.0% of Mock Service Worker projects · 10.3× more than average
Playwright (JavaScript)63.0% of Mock Service Worker projects · 7.2× more than average
jsdom54.0% of Mock Service Worker projects · 10.1× more than average
Vite67.0% of Mock Service Worker projects · 2.9× more than average
Zod57.0% of Mock Service Worker projects · 3.4× more than average
tsx43.0% of Mock Service Worker projects · 4.3× more than average
Prettier54.0% of Mock Service Worker projects · 3.1× more than average

By coding agent

Claude Code2.1% of projects set up for it
Cursor1.6% of projects set up for it
GitHub Copilot1.3% of projects set up for it
OpenAI Codex2.7% of projects set up for it
Gemini CLI1.6% of projects set up for it
OpenCode1.9% of projects set up for it

Share of public repos configured for each agent that list Mock Service Worker as a dependency.

Install

Packagenpm install msw
Main stacksTypeScript / JavaScript (55), Next.js (36), PHP (4), React Native / Expo (1)
Example projectsrajyraman/Levelup-for-Dynamics-CRM, Asvarox/allkaraoke, storybookjs/mealdrop, bartstc/vite-ts-react-template, bitrise-io/bitrise-workflow-editor

Alternatives to Mock Service Worker

All testing

Tool Used in agent projectsDownloads / wk GitHub starsLicense
Vitest npm
Next-generation testing framework powered by Vite with native ESM.
1,549 (12.2%) 123M 17.2K MIT
Playwright (JavaScript) npm
Cross-browser automation library for end-to-end testing.
1,117 (8.8%) 74.2M 97.4K Apache-2.0
Testing Library npm
Testing utilities for React encouraging testing user behavior.
915 (7.2%) 68.7M 19.7K MIT
Jest npm
Delightful JavaScript testing framework with minimal configuration.
702 (5.5%) 46.3M 45.6K MIT
jsdom npm
JavaScript implementation of web standards for testing DOM interactions.
681 (5.4%) 112M 21.7K MIT
pytest pypi
Simple, powerful Python testing framework with fixtures and plugins.
330 (2.6%) 196M 14.6K —
Chai npm
BDD/TDD assertion library for Node.js and browsers with expressive syntax.
305 (2.4%) 14M 8,265 MIT
Mocha npm
Feature-rich JavaScript test framework for Node.js and browsers.
281 (2.2%) 12.6M 22.9K MIT
Is Mock Service Worker right for your project? Ask AgentGid →