{
 "kind": "mcp",
 "slug": "com-mock-server-mockserver",
 "path": "mcp/servers/com-mock-server-mockserver/",
 "name": "mock",
 "maker": "mock-server",
 "density": "full",
 "crumbs": [
  [
   "MCP servers",
   "mcp/"
  ],
  [
   "Developer tools",
   "mcp/developer-tools/"
  ]
 ],
 "lead": "fake the services your app calls, by asking.",
 "chips": [
  {
   "label": "Developer tools",
   "path": "mcp/developer-tools/"
  },
  {
   "label": "Official"
  },
  {
   "label": "Local"
  }
 ],
 "primary": {
  "label": "Copy connect command",
  "copy": "claude mcp add mockserver --transport streamable-http http://localhost:1080/mockserver/mcp"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/mock-server/mockserver-monorepo"
  },
  {
   "label": "Website",
   "href": "https://www.mock-server.com"
  }
 ],
 "track": "New versions and outages of the remote endpoint on your dashboard",
 "verdicts": [
  {
   "key": "official",
   "label": "Made by",
   "value": "The service itself",
   "status": "yes",
   "sub": "Official server",
   "quote": "\"websiteUrl\": \"https://www.mock-server.com\"",
   "note": "The MCP server is built into MockServer itself; the repository belongs to the mock-server organization, whose site mock-server.com documents it.",
   "src": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/server.json"
  },
  {
   "key": "secrets",
   "label": "Keys",
   "value": "No key needed",
   "status": "yes",
   "sub": "No account",
   "quote": "The MCP server is available at the following URL on any running MockServer instance — no additional configuration is required",
   "note": "Start MockServer first (docker run -d --rm -p 1080:1080 mockserver/mockserver). The setup page has no Codex section; any client that speaks Streamable HTTP can use the local address.",
   "src": "https://www.mock-server.com/mock_server/ai_mcp_setup.html"
  },
  {
   "key": "where",
   "label": "Runs",
   "value": "On your machine",
   "status": "cond",
   "sub": "Runs code locally: oci",
   "note": "Checked: no remote; it runs locally on your machine.",
   "src": "https://github.com/mock-server/mockserver-monorepo"
  },
  {
   "key": "license",
   "label": "Commercial use",
   "value": "Allowed",
   "status": "yes",
   "sub": "Apache-2.0 license",
   "quote": "Apache License Version 2.0, January 2004",
   "note": "Apache 2.0 allows using it to test paid products.",
   "src": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/LICENSE.md"
  }
 ],
 "vfoot": "Checked against its repository at one commit, on Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What mock does",
   "parts": [
    {
     "t": "prose",
     "text": "MockServer is a free test tool that stands in for the outside services your app talks to, such as a payment service or an AI model. Its built-in connector lets your AI assistant set up fake answers, record real traffic and check which calls your app made, all in plain words. It runs on your own computer, for example with Docker."
    },
    {
     "t": "h3",
     "text": "What people use it for"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Fake a service that is not ready yet",
       "text": "Your app needs a health check or a partner's service that does not exist yet. Ask the assistant for a fake answer and keep building.",
       "idea": false
      },
      {
       "title": "Record a real service, then replay it",
       "text": "Let real traffic pass through once and be recorded, then turn the recording into fakes. Tests then run without the real service.",
       "idea": false
      },
      {
       "title": "Check that your app made the right calls",
       "text": "After a test, ask whether your app called the payment service exactly once, or in the right order.",
       "idea": false
      },
      {
       "title": "Find out why a request got a 404",
       "text": "When a call hits no fake, the assistant shows the closest one and what to change, so you stop guessing.",
       "idea": false
      },
      {
       "title": "Test your AI agent without paying for the model",
       "text": "Fake answers from OpenAI, Anthropic and other model providers, including failures and retries, so agent tests are free and repeatable.",
       "idea": false
      },
      {
       "title": "Check a connector you built yourself",
       "text": "If you build your own MCP server, point this tool at it to check that it answers the protocol's basic calls correctly.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "mock popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "5,011",
       "l": "GitHub stars, mock-server/mockserver-monorepo"
      },
      {
       "n": "0",
       "l": "public agent projects connect it"
      }
     ]
    }
   ]
  },
  {
   "id": "tools",
   "nav": "Tools",
   "h2": "Tools it gives your agent (46)",
   "parts": [
    {
     "t": "tools",
     "items": [
      {
       "name": "list_mock_tools",
       "text": "Turns the current mocks into tool definitions an agent can call."
      },
      {
       "name": "list_expectations",
       "text": "Lists the active mocks, optionally by method and path."
      },
      {
       "name": "set_operating_mode",
       "text": "Switches between returning mocks (SIMULATE), mocks plus recording the rest (SPY) and recording everything (CAPTURE)."
      },
      {
       "name": "promote_recordings",
       "text": "Turns recorded real traffic into active mocks, with secrets redacted."
      },
      {
       "name": "create_expectation",
       "text": "Creates a mock: when this request comes, answer with this response."
      },
      {
       "name": "verify_request",
       "text": "Checks that a request arrived a given number of times."
      },
      {
       "name": "retrieve_recorded_requests",
       "text": "Returns the requests MockServer received."
      },
      {
       "name": "retrieve_logs",
       "text": "Returns MockServer's log of matching, mismatches and errors."
      },
      {
       "name": "clear_expectations",
       "text": "Removes matching mocks and/or recorded requests."
      },
      {
       "name": "reset",
       "text": "Clears all mocks, recorded requests and logs."
      },
      {
       "name": "manage_service_chaos",
       "text": "Adds or removes delays, errors and dropped connections per upstream host."
      },
      {
       "name": "get_status",
       "text": "Shows whether MockServer runs and on which ports."
      },
      {
       "name": "verify_request_sequence",
       "text": "Checks that requests arrived in a given order."
      },
      {
       "name": "retrieve_request_responses",
       "text": "Returns recorded request and response pairs."
      },
      {
       "name": "create_forward_expectation",
       "text": "Forwards matching requests to a real host (proxy)."
      },
      {
       "name": "debug_request_mismatch",
       "text": "Shows field by field why a request matches no mock."
      },
      {
       "name": "explain_unmatched_requests",
       "text": "Lists recent requests that matched nothing, with the closest mock and a hint."
      },
      {
       "name": "explain_request",
       "text": "Explains which mock served one received request and why others did not."
      },
      {
       "name": "diagnose_config",
       "text": "Shows which settings are changed and where each came from; secrets masked."
      },
      {
       "name": "explain_forward_failure",
       "text": "Explains why a forwarded request failed with a 502."
      },
      {
       "name": "test_template",
       "text": "Dry-runs a response template against a sample request."
      },
      {
       "name": "lint_expectations",
       "text": "Finds mocks that can never match or never answer."
      },
      {
       "name": "suggest_expectation_fix",
       "text": "Suggests a patch that would make a close mock match an unmatched request."
      },
      {
       "name": "create_expectation_from_openapi",
       "text": "Creates mocks from an OpenAPI spec."
      },
      {
       "name": "create_expectations_from_recorded_traffic",
       "text": "Turns recorded proxy traffic into mocks, with an optional preview."
      },
      {
       "name": "stop_server",
       "text": "Shuts MockServer down at once."
      },
      {
       "name": "raw_expectation",
       "text": "Creates a mock from full MockServer JSON (all features)."
      },
      {
       "name": "raw_retrieve",
       "text": "Full retrieve call with type, format and correlation id filters."
      },
      {
       "name": "raw_verify",
       "text": "Full verification call in MockServer JSON."
      },
      {
       "name": "verify_traffic_against_openapi",
       "text": "Checks recorded calls against an OpenAPI contract."
      },
      {
       "name": "run_contract_test",
       "text": "Sends example requests from an OpenAPI spec to your running service and checks the answers."
      },
      {
       "name": "run_resiliency_test",
       "text": "Sends malformed and edge-case requests to your service and reports what it failed to handle."
      },
      {
       "name": "run_mcp_contract_test",
       "text": "Checks that an MCP server you built follows the protocol over Streamable HTTP."
      },
      {
       "name": "record_llm_fixtures",
       "text": "Writes recorded AI model traffic to a fixture file on disk for replay."
      },
      {
       "name": "load_expectations_from_file",
       "text": "Loads mocks from a fixture file on disk."
      },
      {
       "name": "mock_llm_completion",
       "text": "Fakes an AI model answer in the right provider format (Anthropic, OpenAI and others)."
      },
      {
       "name": "create_llm_conversation",
       "text": "Fakes a multi-turn AI model conversation."
      },
      {
       "name": "mock_llm_failover",
       "text": "Makes the first N model calls fail, then succeed, to test retries."
      },
      {
       "name": "verify_tool_call",
       "text": "Checks that an agent called a named tool, from recorded model requests."
      },
      {
       "name": "verify_structured_output",
       "text": "Checks recorded model answers against a JSON Schema."
      },
      {
       "name": "verify_cost_budget",
       "text": "Checks that the estimated cost of recorded model calls stays within a budget."
      },
      {
       "name": "explain_agent_run",
       "text": "Summarises a recorded agent run: turns and tool calls."
      },
      {
       "name": "export_optimisation_report",
       "text": "Exports a cost and design report from captured model traffic."
      },
      {
       "name": "diff_agent_runs",
       "text": "Compares two recorded agent runs prompt by prompt."
      },
      {
       "name": "detect_llm_drift",
       "text": "Replays a recording against the live model provider with your key and reports changed response shapes."
      },
      {
       "name": "mock_adversarial_llm_response",
       "text": "Fakes a hostile model answer (prompt injection, oversized content) to test your agent."
      }
     ]
    }
   ]
  },
  {
   "id": "data",
   "nav": "Data and license",
   "h2": "What it sends and its license",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Sends",
       "v": "requests you choose to forward or proxy, including recorded AI model traffic",
       "sub": "To the real host you set as the forward target; only in SPY or CAPTURE mode or with a forward expectation; SIMULATE answers from mocks only. Opt out: stay in SIMULATE mode and add no forward expectations."
      },
      {
       "l": "Sends",
       "v": "replayed recordings and your provider key",
       "sub": "To the live AI model provider of the configured backend; only when detect_llm_drift runs with a backend configured; otherwise it does nothing. Opt out: configure no runtime model backend."
      },
      {
       "l": "Sends",
       "v": "test requests generated from your OpenAPI spec",
       "sub": "To the service address you pass to run_contract_test or run_resiliency_test; only when those tools run. Opt out: point them only at your own test service."
      }
     ]
    },
    {
     "t": "prose",
     "text": "MockServer is free and open source under the Apache 2.0 license, also for paid work. It is meant for testing only, never for a live public service."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "Yes",
       "status": "yes",
       "sub": "Apache 2.0 allows using it to test paid products.",
       "quote": "Apache License Version 2.0, January 2004",
       "src": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/LICENSE.md"
      },
      {
       "l": "client-work",
       "v": "Yes",
       "status": "yes",
       "sub": "Use it in tests for client projects; keep it out of production.",
       "quote": "MockServer is designed for development, testing, and QA environments only.",
       "src": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/SECURITY.md"
      },
      {
       "l": "Pass on its files",
       "v": "With conditions",
       "status": "cond",
       "sub": "Copies of the code or image may be passed on under Apache 2.0, keeping its license and notices.",
       "quote": "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
       "src": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/LICENSE.md"
      }
     ]
    }
   ]
  },
  {
   "id": "alive",
   "nav": null,
   "spy_as": "data",
   "h2": "Is it alive",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Latest version",
       "v": "9.4.0 in the registry, updated Nov 20, 2026"
      },
      {
       "l": "Last release",
       "v": "9.2.0 (2026-10-26)"
      },
      {
       "l": "Remote endpoint",
       "v": "no remote; it runs locally on your machine",
       "status": "cond"
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "mock",
       "me": true,
       "facts": [
        "5,011 stars",
        "Local"
       ]
      },
      {
       "name": "msw",
       "why": "Pick it if you only fake requests inside a JavaScript app's tests or browser",
       "path": null,
       "facts": [
        "Local"
       ]
      },
      {
       "name": "Keploy",
       "why": "Pick it if you want tests generated from OpenAPI, Postman or real traffic",
       "path": "mcp/servers/io-github-keploy-mcp/",
       "facts": [
        "19.9K stars",
        "Remote"
       ]
      }
     ],
     "more": "All developer tools servers",
     "more_path": "mcp/developer-tools/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Start MockServer 9.2.0 in Docker on port 1080, connect its MCP server at http://localhost:1080/mockserver/mcp, mock GET /api/health with 200 OK, then verify my test called it exactly once."
    },
    {
     "t": "h3",
     "text": "Connect it"
    },
    {
     "t": "tabs",
     "label": "Connect by client",
     "items": [
      {
       "tab": "Claude Code",
       "code": "claude mcp add mockserver --transport streamable-http http://localhost:1080/mockserver/mcp"
      },
      {
       "tab": "Docker (stdio)",
       "code": "docker run -i --rm docker.io/mockserver/mockserver:9.4.0"
      },
      {
       "tab": "Cursor",
       "code": "{\n  \"mcpServers\": {\n    \"mockserver\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"http://localhost:1080/mockserver/mcp\"\n    }\n  }\n}\n"
      }
     ]
    },
    {
     "t": "small",
     "text": "Start MockServer first (docker run -d --rm -p 1080:1080 mockserver/mockserver). The setup page has no Codex section; any client that speaks Streamable HTTP can use the local address."
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Adding the connector before MockServer is running",
       "fix": "Start it first (docker run -d --rm -p 1080:1080 mockserver/mockserver), then add http://localhost:1080/mockserver/mcp",
       "why": "The connector lives inside a running MockServer; there is nothing to connect to otherwise."
      },
      {
       "dont": "Using create_expectation to match headers, cookies or a request body",
       "fix": "Use raw_expectation with full MockServer JSON for those matches",
       "why": "create_expectation rejects parameters outside its small input list."
      },
      {
       "dont": "Running detect_llm_drift in every commit's test run",
       "fix": "Run it in an opt-in or scheduled job, with a backend key set up on purpose",
       "why": "It calls the real provider with your key, so it costs money and gives changing results."
      },
      {
       "dont": "Committing fixture files from record_llm_fixtures without reading them",
       "fix": "Pass redactBodyFields for body fields with secrets, then review the file",
       "why": "Headers are redacted, message bodies are not."
      },
      {
       "dont": "Exposing port 1080 of a shared or cloud machine to the internet",
       "fix": "Keep it on localhost or a private test network",
       "why": "MockServer is a test tool with features that are unsafe on an open network."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it cost anything or need an account?",
       "a": "No. It is open source under Apache 2.0 and runs on your own machine; the connector needs no sign-in by default.",
       "evidence": {
        "url": "https://www.mock-server.com/mock_server/ai_mcp_setup.html",
        "quote": "The MCP server is available at the following URL on any running MockServer instance — no additional configuration is required"
       }
      },
      {
       "q": "Which assistants does it work with?",
       "a": "The docs show setups for Cursor, Claude Code, Windsurf, Cline, Continue and OpenCode, plus code libraries such as LangChain.",
       "evidence": {
        "url": "https://www.mock-server.com/mock_server/ai_mcp_setup.html",
        "quote": "Choose your AI coding assistant or client library below and follow the configuration instructions."
       }
      },
      {
       "q": "Do I need Java?",
       "a": "Not with Docker; the image brings its own. The JAR needs Java 17 or newer.",
       "evidence": {
        "url": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/README.md",
        "quote": "The official Docker image bundles its own JVM, so containerised users need no JVM of their own."
       }
      },
      {
       "q": "Can I turn the connector off?",
       "a": "Yes. Set MOCKSERVER_MCP_ENABLED=false (or -Dmockserver.mcpEnabled=false); the default is on.",
       "evidence": {
        "url": "https://github.com/mock-server/mockserver-monorepo/blob/d68a943b88569d0fdfa6ed275ccbc31cde186c75/jekyll-www.mock-server.com/mock_server/_includes/mcp_configuration.html",
        "quote": "Enable or disable the MCP (Model Context Protocol) endpoint at /mockserver/mcp"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Registry name",
   "com.mock-server/mockserver"
  ],
  [
   "Category",
   "Developer tools"
  ],
  [
   "Version",
   "9.4.0"
  ],
  [
   "Package",
   "oci docker.io/mockserver/mockserver:9.4.0"
  ],
  [
   "License",
   "Apache-2.0"
  ],
  [
   "GitHub",
   "mock-server/mockserver-monorepo"
  ],
  [
   "In the registry since",
   "Nov 20, 2026"
  ],
  [
   "Works with",
   "Claude Code, OpenAI Codex, OpenCode, LangChain, n8n, LangGraph"
  ]
 ],
 "good": [
  "Test machines only. Never run it on a live server or on a network that strangers can reach.",
  "The connector is on by default on every running MockServer. Anyone who can reach its port can drive it, unless you add its login checks or switch it off.",
  "One tool, stop_server, shuts MockServer down at once, and reset wipes every fake and recording."
 ],
 "checked_line": "Read by AgentGid from 11 pages and files at one commit, checked Nov 10, 2026; stars update daily.",
 "logo": "https://agentgid.com/media/avatars/mock-server.png"
}