npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

api-mockingbird

v1.2.0

Published

MCP server for creating HTTP mock APIs for frontend development

Readme

API Mockingbird MCP Server

A Model Context Protocol (MCP) server that creates HTTP mock APIs for client development. API Mockingbird allows you to quickly spin up mock servers with realistic responses and error scenarios while your server teammates work on the real APIs.

Features

  • 🚀 Quick HTTP Server Setup - Start mock servers on any port (1024-65535)
  • 🎯 Dynamic Endpoint Management - Add/remove endpoints without server restart
  • 🎭 Error Simulation - Test error handling with configurable error scenarios
  • 🔧 CORS Support - Built-in CORS handling for development
  • 📊 Server Status - Monitor running servers and their endpoints
  • 💾 Persistence - Endpoints auto-save and reload across server restarts

Installation

Claude Code

claude mcp add api-mockingbird npx api-mockingbird@latest

VS Code

code --add-mcp '{"name":"api-mockingbird","command":"npx","args":["api-mockingbird@latest"]}'

Cursor

Install MCP Server

Available Tools

start_mock_server

Start a new HTTP mock server.

Starts server and auto-loads any saved endpoints for that port.

add_endpoint

Add or update a mock endpoint. If an endpoint with the same method and path exists, it will be replaced. Auto-saves configuration.

remove_endpoint

Remove a specific endpoint from a server. Auto-saves configuration.

set_endpoint_error

Configure an error response for an endpoint.

toggle_endpoint_error

Enable or disable the error response for an endpoint.

list_endpoints

List all endpoints for a specific server or all running servers. Shows endpoint details, status, and error configurations.

stop_mock_server

Stop a running mock server.

Example Workflow

1. Start a mock server:
   "Start a api-mockingbird server on port 4000"

2. Add user endpoints:
   "Add a GET /api/users api-mockingbird endpoint that returns a list of 5 users"
   "Add a POST /api/users api-mockingbird endpoint that creates a user"

3. Update endpoints:
   "Change api-mockingbird GET /api/users to return 10 users instead of 5"
   (same add_endpoint command replaces existing)

4. Test your frontend:
   Your React app can now call http://localhost:4000/api/users

5. Manage endpoints:
   "Remove the api-mockingbird POST /api/users endpoint"
   "Set a 500 server error for the GET /api/users api-mockingbird endpoint"
   "Enable error response for api-mockingbird GET /api/users"
   "Disable error response for api-mockingbird GET /api/users"

Endpoint Management

Create: Use add_endpoint to create new endpoints
Update: Use add_endpoint with same method+path to replace existing endpoint
Delete: Use remove_endpoint to delete specific endpoints
View: Use list_endpoints to see all endpoints

All changes auto-save and persist across server restarts.

Configuration Persistence

Endpoints are automatically saved to .api-mockingbird.local/ directory:

  • Each server's endpoints are saved as {port}.json
  • Configurations auto-load when restarting servers
  • Includes endpoint responses, headers, and error settings

Development

npm run dev
npm run build
npm run typecheck
npm run lint
npm run test
npm run test:watch
npm run inspect
npm run release
npm run release:dry-run

Architecture

src/
├── constants.ts     # Application constants and HTTP status codes
├── schemas.ts       # Shared JSON schemas for validation
├── types/           # TypeScript type definitions
├── services/        # Core business logic
│   └── MockServerManager.ts
├── tools/           # MCP tool implementations and registry
│   ├── registry.ts  # Type-safe tool registration system
│   ├── startMockServer.ts
│   ├── stopMockServer.ts
│   ├── addEndpoint.ts
│   ├── removeEndpoint.ts
│   ├── listEndpoints.ts
│   ├── setEndpointError.ts
│   ├── toggleEndpointError.ts
│   └── index.ts     # Tool exports and barrel imports
├── utils/           # Shared utilities
│   ├── responses.ts # Response creation helpers
│   └── validation.ts # Input validation functions
├── server.ts        # MCP server setup with type-safe tool handling
└── index.ts         # Entry point

Testing

Comprehensive test suite with 74+ tests covering:

npm run test        # Run all tests
npm run test:watch  # Watch mode for development

Test Coverage:

  • MockServerManager: Server lifecycle, endpoint CRUD, persistence
  • Tool Handlers: All 7 tool implementations with success/error scenarios
  • Tool Registry: Type-safe tool registration and handler mapping
  • Utilities: Response creation, validation, error handling
  • Persistence: Configuration save/load across server restarts

License

MIT