Moco is a stub server framework that simplifies setting up mock HTTP endpoints for testing and development.
The tool addresses the friction of integration testing against external services by providing a lightweight alternative to deploying full application servers. Rather than building and redeploying WAR files to test different service responses, developers define stub behavior in configuration files and run Moco as a standalone server. The framework accepts JSON configuration describing request matching rules and corresponding responses, then serves those responses when requests arrive.
Moco suits projects that need to mock HTTP-based integrations during development and testing, particularly REST APIs and web services. It works both as a standalone runner launched from the command line and as an embedded library within Java applications. The tool supports HTTP, WebSocket, and Server-Sent Events protocols. Developers can extend Moco's built-in matching and response capabilities through custom implementations when the standard API does not meet their requirements.
The project maintains active build automation and accepts community contributions. Documentation covers HTTP APIs, REST endpoints, WebSocket support, SSE functionality, global settings across multiple configuration files, command-line usage, and extension mechanisms. The codebase requires Java 17 or later and uses Gradle for building.