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

mpx-api

v1.2.3

Published

API testing, mocking, and documentation CLI. Developer-first HTTP workflows. AI-native with JSON output and MCP server.

Readme

mpx-api 🚀

Developer-first API testing, mocking, and documentation CLI.

No GUI. No proprietary formats. Just powerful, git-friendly API testing from your terminal.

Part of the Mesaplex developer toolchain.

npm version License: Dual Node.js

Features

  • Git-friendly — Collections are YAML files, not proprietary blobs
  • CI/CD ready — Exit codes, JSON output, no GUI dependency
  • Beautiful terminal output with syntax highlighting
  • Request chaining — Use response data from one request in another
  • Built-in mock server — Test against OpenAPI specs without deploying (Pro)
  • Load testing — RPS control, percentile reporting (Pro)
  • Doc generation — Generate API docs from collections (Pro)
  • MCP server — Integrates with any MCP-compatible AI agent
  • Self-documenting--schema returns machine-readable tool description

Installation

npm install -g mpx-api

Or run directly with npx:

npx mpx-api get https://api.github.com/users/octocat

Requirements: Node.js 18+ · No native dependencies · macOS, Linux, Windows

Quick Start

# Simple GET request
mpx-api get https://jsonplaceholder.typicode.com/users

# POST with JSON
mpx-api post https://api.example.com/users --json '{"name":"Alice"}'

# Custom headers
mpx-api get https://api.example.com/protected \
  -H "Authorization: Bearer $TOKEN"

# Verbose output (show headers)
mpx-api get https://httpbin.org/get -v

# Quiet mode (only response body)
mpx-api get https://api.example.com/data -q

Usage

HTTP Requests

Supports get, post, put, patch, delete, head, and options:

mpx-api get https://api.example.com/users
mpx-api post https://api.example.com/users --json '{"name":"Bob"}'
mpx-api put https://api.example.com/users/1 --json '{"name":"Alice"}'
mpx-api delete https://api.example.com/users/1

Collections

Collections are YAML files for repeatable API test suites:

# Initialize collection in your project
mpx-api collection init

# Add requests
mpx-api collection add get-users GET /users
mpx-api collection add create-user POST /users --json '{"name":"Bob"}'

# Run the collection
mpx-api collection run

Collection file format (.mpx-api/collection.yaml):

name: My API Tests
baseUrl: https://api.example.com

requests:
  - name: get-users
    method: GET
    url: /users
    headers:
      Authorization: Bearer {{env.API_TOKEN}}
    assert:
      status: 200
      body.length: { gt: 0 }
      responseTime: { lt: 500 }

  - name: get-specific-user
    method: GET
    url: /users/{{get-users.response.body[0].id}}
    assert:
      status: 200

Features: request chaining ({{request.response.body.id}}), environment variables ({{env.VAR}}), built-in assertions.

Environments

mpx-api env init                              # Create dev, staging, production
mpx-api env set staging API_URL=https://...   # Set variables
mpx-api env list                              # List environments
mpx-api collection run --env staging          # Run with environment

Testing & Assertions

mpx-api test ./collection.yaml
mpx-api test ./collection.yaml --env production
mpx-api test ./collection.yaml --json
mpx-api test ./collection.yaml --pdf report.pdf    # Export PDF report

Assertion operators: gt, lt, gte, lte, eq, ne, contains, exists

Request History

mpx-api history         # View recent requests
mpx-api history -n 50   # Last 50

Mock Server (Pro)

mpx-api mock ./openapi.yaml --port 4000

Load Testing (Pro)

mpx-api load https://api.example.com/health --rps 100 --duration 30s

Documentation Generation (Pro)

mpx-api docs ./collection.yaml --output API.md

AI Agent Usage

mpx-api is designed to be used by AI agents as well as humans.

JSON Output

Add --json to any command for structured, machine-readable output:

mpx-api get https://api.github.com/users/octocat --json
{
  "request": {
    "method": "GET",
    "url": "https://api.github.com/users/octocat",
    "headers": {},
    "body": null
  },
  "response": {
    "status": 200,
    "statusText": "OK",
    "headers": { "content-type": "application/json" },
    "body": { "login": "octocat" },
    "responseTime": 145,
    "size": 1234
  }
}

Schema Discovery

mpx-api --schema

Returns a complete JSON schema describing all commands, flags, inputs, outputs, and examples.

MCP Integration

Add to your MCP client configuration (Claude Desktop, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "mpx-api": {
      "command": "npx",
      "args": ["mpx-api", "mcp"]
    }
  }
}

The MCP server exposes these tools:

  • http_request — Send HTTP requests with full control over method, headers, body
  • get_schema — Get the complete tool schema for dynamic discovery

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success (2xx or 3xx HTTP status) | | 1 | Request failed or 4xx/5xx HTTP status |

Automation Tips

  • Use --json for machine-parseable output
  • Use --quiet to suppress banners and progress info
  • Pipe output to jq for filtering
  • Check exit codes for pass/fail in CI/CD

CI/CD Integration

# .github/workflows/api-tests.yml
- name: Run API Tests
  run: npx mpx-api test ./tests/api-collection.yaml --env staging

Free vs Pro

| Feature | Free | Pro | |---------|------|-----| | HTTP requests | ✅ | ✅ | | Collections & chaining | ✅ | ✅ | | Environments | ✅ | ✅ | | Assertions & testing | ✅ | ✅ | | JSON output | ✅ | ✅ | | MCP server | ✅ | ✅ | | Mock server | ❌ | ✅ | | Load testing | ❌ | ✅ | | Doc generation | ❌ | ✅ |

Upgrade to Pro: https://mesaplex.com/mpx-api

License

Dual License — Free tier for personal use, Pro license for commercial use and advanced features. See LICENSE for full terms.

Links

Related Tools


Made with ❤️ by Mesaplex