Class HttpMcpClient

java.lang.Object
com.shaft.commandline.mcp.AbstractMcpClient
com.shaft.commandline.mcp.HttpMcpClient
All Implemented Interfaces:
McpClient, AutoCloseable

public final class HttpMcpClient extends AbstractMcpClient
MCP client speaking streamable HTTP to a persistent shaft-mcp daemon (session mode).

Observed transport contract (live-probed): initialize returns HTTP 200 application/json plus an Mcp-Session-Id response header that must be echoed on every subsequent request; notifications/initialized returns 202; tools/list and tools/call return HTTP 200 text/event-stream (SSE-framed). close() is a no-op: the daemon and its live browser state outlive the CLI invocation.

  • Constructor Details

    • HttpMcpClient

      public HttpMcpClient(URI endpoint)
      Parameters:
      endpoint - the daemon MCP endpoint, e.g. http://127.0.0.1:8081/mcp
  • Method Details

    • close

      public void close()