Mock Service Worker

Mock Service Worker (MSW) is an open-source library for mocking REST, GraphQL, WebSocket, and Server-Sent Events APIs at the network level. It provides setupWorker for browser environments and setupServer for Node.js, with handlers (http, graphql, ws, sse) that allow developers to declare mocked responses without modifying application code.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/msw"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

API entry from apis.yml

apis.yml Raw ↑
aid: mock-service-worker:msw
name: Mock Service Worker
description: Mock Service Worker (MSW) is an open-source library for mocking REST, GraphQL, WebSocket,
  and Server-Sent Events APIs at the network level. It provides setupWorker for browser environments and
  setupServer for Node.js, with handlers (http, graphql, ws, sse) that allow developers to declare mocked
  responses without modifying application code.
image: https://mswjs.io/static/logos/msw-logo.svg
humanURL: https://mswjs.io/
baseURL: https://mswjs.io/
tags:
- API Mocking
- GraphQL
- HTTP
- Mocking
- Service Worker
- Testing
- WebSocket
properties:
- type: Documentation
  url: https://mswjs.io/docs/
- type: GettingStarted
  url: https://mswjs.io/docs/quick-start
- type: HTTP Handler
  url: https://mswjs.io/docs/network-behavior/rest
- type: GraphQL Handler
  url: https://mswjs.io/docs/network-behavior/graphql
- type: WebSocket Handler
  url: https://mswjs.io/docs/network-behavior/websocket
- type: GitHub
  url: https://github.com/mswjs/msw
- type: Examples
  url: https://github.com/mswjs/examples
- type: NPM
  url: https://www.npmjs.com/package/msw
- type: License
  url: https://github.com/mswjs/msw/blob/main/LICENSE.md
- url: graphql/mock-service-worker-graphql.md
  type: GraphQL
contact:
- FN: MSW Maintainers
  url: https://github.com/mswjs/msw