Skip to main content
MockServer is a free, open-source tool that intercepts and controls HTTP and HTTPS traffic. Point your application at MockServer instead of a real service, define what responses to return, and verify the requests your application made. Use MockServer to:
  • Isolate dependencies — replace APIs, databases, or third-party services in tests
  • Control edge cases — simulate slow responses, errors, and unexpected payloads
  • Verify behavior — assert that your code made the right requests with the right data
  • Proxy live traffic — inspect, record, and replay real HTTP traffic

Key features

  • HTTP and HTTPS mocking — a single port handles both protocols automatically using port unification
  • Flexible request matching — match on method, path, headers, cookies, query parameters, and body using exact values, regular expressions, XPath, or JSON Schema
  • OpenAPI support — auto-generate expectations from an OpenAPI v3 specification
  • Response templating — return dynamic responses using Mustache, Velocity, or JavaScript templates
  • Proxying and recording — forward requests to real services, record responses, and replay them later
  • Multiple deployment options — Docker, Kubernetes (Helm), Maven plugin, npm module, standalone JAR, JUnit 4/5, and Spring
  • Multiple client SDKs — Java, JavaScript, and Ruby clients, plus a REST API usable from any language
MockServer uses port unification so a single port handles HTTP, HTTPS, and SOCKS traffic. You do not need separate ports for different protocols.

Where to go next

Quick Start

Get MockServer running and mock your first request in under 5 minutes.

Running MockServer

Deploy via Docker, Helm, Maven, npm, or as a standalone JAR.

Creating expectations

Define request matchers and response actions to control what MockServer returns.

REST API reference

Explore the full REST API for managing expectations, verification, and state.