generate_mock_apiLABSCO SUMMARY
The mock keeps the logs, so the test result is evidence rather than an assertion.
Every generated server logs full requests and responses, and query_mock_logs turns those into latency percentiles, error rates and traffic patterns — you can see what the client under test actually sent, not what it claimed to. The scenario tools are the other half: switch the mock into an error or load configuration without regenerating it.
What it is
A mock-server generator and test platform. It turns an API specification into a FastAPI mock with logging, an admin interface and Docker files, then gives you tools to run scenarios against it and analyse what happened.
What you get
- generate_mock_api — a FastAPI mock server from a spec URL or local file, with auth, webhooks, admin UI and storage each switchable
- query_mock_logs — request logs filtered by method, path pattern and time range, with performance metrics and traffic patterns
- discover_mock_servers — find running mock servers and their configuration
- manage_mock_data — update responses and create, switch and list scenarios on a running server
- validate_scenario_config, deploy_scenario, switch_scenario, list_active_scenarios — scenario lifecycle
- execute_test_plan, run_test_iteration, run_load_test, run_security_test — test execution
- analyze_test_results, generate_test_report, compare_test_runs, get_performance_metrics — results and trends
- create_test_session, end_test_session, schedule_test_suite, monitor_test_progress — workflow management
- create_test_session_context, create_workflow_context, create_agent_context — stateful context for long runs
- get_context_data, update_context_data, list_contexts_by_type, create_context_snapshot, restore_context_snapshot — context data with snapshot and rollback
- get_global_context_data and update_global_context_data — state shared across sessions
- Prompts for scenario generation, including analyze_openapi_for_testing, generate_error_scenarios and generate_security_test_scenarios
Requirements
Python 3.10+ and pip; install from PyPI as mockloop-mcp and point your client at the mockloop-mcp command. Docker and Docker Compose are needed to run the generated mock servers, which ship with their own Dockerfile and compose file. The generated server uses separate ports for the mocked API and the admin interface.
Setup effort
One command — pip install mockloop-mcp
USE CASES
Standing up a dependency you do not have yet
Point the generator at the OpenAPI spec and get a running mock with an admin interface.
Finding out what your client actually sends
Filter the request log by method and path and read the bodies and headers back.
Testing the unhappy path
Generate error scenarios from the spec, validate the configuration, deploy it, and switch the mock into it.
Seeing whether a change made things slower
Run the test plan, then compare this run against the previous one.
Keeping a long test run coherent
Create a session context, snapshot it before a risky step, and restore it if the step goes wrong.
Finding the mocks already running
Discover the servers on the machine and their configuration before starting another.
30 tools
Listed in project docs. Your client may show a different list.
query_mock_logsdiscover_mock_serversmanage_mock_datavalidate_scenario_configdeploy_scenarioswitch_scenariolist_active_scenariosexecute_test_planrun_test_iterationrun_load_testrun_security_testanalyze_test_resultsgenerate_test_reportcompare_test_runsget_performance_metricscreate_test_sessionend_test_sessionschedule_test_suitemonitor_test_progresscreate_test_session_contextcreate_workflow_contextcreate_agent_contextget_context_dataupdate_context_datalist_contexts_by_typecreate_context_snapshotrestore_context_snapshotget_global_context_dataupdate_global_context_dataBEFORE YOU INSTALL
What to know first
Tools you get
30 tools named in the project's documentation.
Requires
- mockloop-mcp on PATH
- Python 3.10+
INSTALLATION
Connect your client
Server setup
pip install mockloop-mcpMCP Clients
Claude Desktop
{
"mcpServers": {
"mockloop": {
"command": "mockloop-mcp",
"args": []
}
}
}Claude Code
claude mcp add -t stdio mockloop-mcp mockloop-mcpCline
{
"mcpServers": {
"MockLoopLocal": {
"command": "mockloop-mcp",
"args": [],
"transportType": "stdio"
}
}
}