mcp

MCP (Model Context Protocol) JSON-RPC endpoint

Streamable-HTTP MCP endpoint, letting AI agents and LLM tooling drive MockServer as an MCP server. The body is a JSON-RPC 2.0 request object or a batch array. Call initialize first; the response carries a new session id in the Mcp-Session-Id response header, which subsequent calls must send back in the Mcp-Session-Id request header. Protocol versions 2025-06-18 (default), 2025-03-26 and 2024-11-05 are negotiated. Note that a missing or invalid session is reported as a JSON-RPC error inside a 200 response, not as a 4xx. Unlike its sibling endpoints this path has no bare /mcp alias, and sub-paths under /mockserver/mcp/ also route here.

post/mockserver/mcp

Request

  • Base URL: http://localhost:1080
  • URL: http://localhost:1080/mockserver/mcp
  • Auth: none declared

Headers

Mcp-Session-Idstring

session id returned by a previous initialize call; omit on initialize itself

Request body

object required

a JSON-RPC 2.0 request object, or an array of them for a batch

Response

JSON-RPC response. Also used for JSON-RPC-level errors such as an missing or invalid session. On initialize the response carries the new session id in the Mcp-Session-Id header.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.