MockServer Documentation
June 24, 2026 · View on GitHub
Comprehensive internal documentation for the MockServer project covering code architecture, infrastructure, build system, CI/CD, and deployment.
Documentation style. These docs follow the Pyramid Principle with progressive disclosure — lead with the outcome, then layer detail beneath it. The Level column below (High / Medium / Low) is that principle applied across the doc set: start High for the big picture, drill into Low for subsystem detail. See
.opencode/rules/documentation-style.mdfor the authoring skeleton.
Documentation Index
Code Architecture
Deep-dive documentation of MockServer's codebase, from high-level module structure down to individual subsystems.
| Document | Level | Description |
|---|---|---|
| Code Overview | High | Module hierarchy, dependency graph, package layout |
| Netty Pipeline | Medium | Port unification, protocol detection, channel handlers, MCP handler, relay pattern |
| Request Processing | Medium | Mock matching, proxy forwarding, action dispatch, WAR bridge |
| Event System | Medium | LMAX Disruptor ring buffer, verification, persistence, observers |
| Dashboard UI | Medium | React SPA, Zustand state, twelve top-level views (Dashboard / Traffic / Sessions / Mocks / Library / Chaos / Drift / Verification / AsyncAPI / Metrics / Breakpoints / Get Started), WebSocket communication, data assembly |
| Domain Model | Low | Model hierarchy, matchers, codecs, OpenAPI support, configuration (incl. MCP) |
| TLS & Security | Low | BouncyCastle CA, SNI, mTLS, JWT auth, control plane security |
| Client & Integrations | Low | MockServerClient, JUnit 4/5, Spring, WebSocket callbacks, VS Code extension, JetBrains plugin |
| Editor Extensions | Low | VS Code and JetBrains extensions: shared JSON Schema generation, REST client architecture, feature inventory, build/CI, gotchas |
| Memory Management | Medium | Log entry and expectation memory analysis, default limit calculation, tuning guide |
| Metrics & Monitoring | Low | Prometheus metrics, memory monitoring, CSV export |
| Telemetry | Low | OpenTelemetry integration: OTLP export, GenAI spans, W3C trace context propagation |
| AI & RPC Protocol Mocking | Medium | SSE streaming, JSON-RPC matching, MCP and A2A mock builders, gRPC mocking |
| LLM Mocking | Medium | LLM response builder, provider codecs, streaming physics, conversation matchers, isolation, MCP tools, dashboard |
| LLM Codec Golden Files | Low | Automated wire-format drift detection for the LLM provider codecs: golden-master fixtures, normalization, refresh process |
| CLI | Low | picocli command tree, subcommands, preprocessArguments heuristic, legacy flag compatibility, how to add a subcommand |
| Configuration Reference | Low | Property mechanism, resolution order, four equivalent forms, how to add a property |
| Chaos Experiments | Low | Scheduled multi-stage chaos experiments: ChaosExperimentOrchestrator, ordered stages, auto-halt integration, PUT/GET/DELETE /chaosExperiment |
| Breakpoints | Low | Request/response/stream breakpoints: BreakpointRegistry, PausedExchange, request and response phases, stream frame interception |
| Drift Detection | Low | Mock drift detection: comparing forwarded responses against stub expectations |
| SLO Verdicts | Low | Synchronous SLO verdicts over forwarded traffic: SloSampleStore, SloEvaluator, PUT /mockserver/verifySLO (200 PASS / 406 FAIL) |
| Load Generation | Low | API-driven load scenarios: LoadScenarioOrchestrator, ramp profiles, per-iteration templating, PUT/GET/DELETE /mockserver/loadScenario, SLI producer for SLO verdicts |
| WASM Rules | Low | WASM custom rule engine: chicory interpreter, module ABI, REST endpoints, configuration |
| Async Messaging | Low | AsyncAPI broker mocking: spec parsing, example generation, Kafka/MQTT publisher adapters, orchestrator |
| HTTP/3 (QUIC) | Low | Experimental HTTP/3 support: Http3Server, QUIC native dependency, MVP boundaries |
| Clustered State | Low | StateBackend SPI, InMemoryStateBackend, InfinispanStateBackend (LOCAL/CLUSTERED), cross-node invalidation, config knobs, limitations |
| LLM Security Audit | Low | M5 security review: known codec limitations, Bedrock SigV4, Ollama NDJSON, adversarial-response safety |
Infrastructure
AWS accounts, CI/CD pipelines, container images, and Kubernetes deployment.
| Document | Description |
|---|---|
| AWS Infrastructure | AWS accounts, Terraform IaC, EC2 agents, S3 hosting, CloudFront CDN |
| CI/CD | Buildkite pipelines and GitHub Actions workflows |
| Docker | Docker images, variants, multi-arch builds, and Compose examples |
| Helm & Kubernetes | Helm charts, deployment templates, and Kind-based testing |
| Service Mesh / Sidecar | Transparent HTTP interception and Kubernetes sidecar deployment |
| AWS SES Email Forwarding | SES catch-all email forwarding for mock-server.com |
Operations
Build process, releases, dependencies, security scanning, and the documentation website.
| Document | Description |
|---|---|
| Build System | Maven configuration, profiles, plugins, and build scripts |
| Release Process | End-to-end release workflow with Mermaid diagrams |
| Security | Consolidated security overview: CodeQL, Dependabot, Snyk, AI security review, SNAPSHOT policy |
| Snyk Security | Vulnerability scanning, CLI usage, javax/jakarta constraints, triage workflow |
| Website | Jekyll documentation site structure and publishing |
| Testing | Test frameworks, module inventory, architecture, configuration, coverage gaps, CI execution |
| Performance Tuning | Internal companion to the website performance page: where the budget goes, rules of thumb, JVM flags, measuring, regression triage |
| AI-Native SDLC Principles | Principles for working with AI across the SDLC: spec-first, verification, context, guardrails, the lethal trifecta |
| AI-Assisted Development | AI development approach, adversarial review, testing backstop, structural safety |
| OpenCode Configuration | AI harness: config, agents, rules, skills, commands, plugins |
| OpenCode Building Blocks | Generic guide to the 9 building blocks: what each controls, when to use which, and how they fit together |
| MCP Registry Publishing | Publishing MockServer's MCP server to public MCP registries |
| Migration: Java 17 + Jakarta | Completed javax→jakarta namespace migration: scope, approach, and verification |
| Release Principles | Principles and rules governing the release scripts and Buildkite release pipeline |
Plans
| Document | Description |
|---|---|
| Security Defaults | Insecure default flips planned for the next major release |
Other
| Document | Description |
|---|---|
| Architecture | Original high-level architecture overview (see also Code Overview) |
Quick Reference
mockserver-monorepo/
├── mockserver/ # Java server (multi-module Maven project)
│ ├── mockserver-core/ # Core domain model, matching, serialisation
│ ├── mockserver-client-java/ # Java client library
│ ├── mockserver-netty/ # Netty-based HTTP server (main artifact)
│ ├── mockserver-war/ # WAR-packaged mock server
│ ├── mockserver-proxy-war/ # WAR-packaged proxy
│ ├── mockserver-junit-rule/ # JUnit 4 integration
│ ├── mockserver-junit-jupiter/ # JUnit 5 integration
│ ├── mockserver-spring-test-listener/ # Spring test integration
│ ├── mockserver-testing/ # Shared test utilities
│ └── mockserver-integration-testing/ # Integration test infrastructure
├── examples/ # Runnable usage examples (java/node/python/ruby/curl/json/docker-compose/wasm/chaos)
├── mockserver-ui/ # React dashboard UI (Vite + TypeScript)
├── mockserver-node/ # Node.js MockServer launcher (npm)
├── mockserver-client-node/ # Node.js/browser client library (npm)
├── mockserver-client-python/ # Python client library (PyPI)
├── mockserver-client-ruby/ # Ruby client library (RubyGems)
├── mockserver-performance-test/ # k6-based performance tests
├── container_integration_tests/ # Docker & Helm integration tests
├── jekyll-www.mock-server.com/ # Jekyll documentation website
├── helm/ # Helm charts (mockserver + mockserver-config)
├── docker/ # Production Docker images (5 variants)
├── docker_build/ # CI build Docker images
├── terraform/ # Terraform IaC (Buildkite agents + pipelines)
├── scripts/ # Build, deploy, and utility scripts
└── docs/ # This documentation (you are here)
├── code/ # Code architecture (25 docs)
├── infrastructure/ # AWS, CI/CD, Docker, Helm, Service Mesh (6 docs)
├── operations/ # Build, release, deps, security, website, perf (15 docs)
├── plans/ # Active plans and RFCs (1 doc)
└── testing.md # Test frameworks, architecture, config, coverage, CI
Key Links
- Website: https://www.mock-server.com
- GitHub: https://github.com/mock-server/mockserver-monorepo
- Docker Hub: https://hub.docker.com/r/mockserver/mockserver
- Maven Central:
org.mock-server:mockserver-netty - Helm Chart Repo: https://www.mock-server.com/mockserver-7.2.0.tgz
- SwaggerHub API: https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi
- Buildkite: https://buildkite.com/mockserver/mockserver
- Snyk: https://app.snyk.io/org/mockserver/projects