paperclipai/paperclip · error · ToolGatewayHttpError

remote_mcp_error

remote_mcp_error

Error message

Remote MCP context request returned an error

What it means

Remote MCP forwarding failure wrapper: the upstream request failed at the transport/execution level (network error, malformed response, or other non-HTTP-error failure). The 502 mcp_remote_failed surfaces the underlying problem with execution details so callers can distinguish upstream failure from policy denial.

Solutions

  1. The remote MCP server returned a protocol error. Inspect the error code/message and fix the request or the remote server.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at server/src/services/tool-gateway.ts:3133 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/51788fee59673698. Report an issue: GitHub.

Appendix: source

Thrown at server/src/services/tool-gateway.ts:5174

      );
    } catch {
      throw new ToolGatewayHttpError(
        502,
        "Remote MCP context response was invalid",
        "mcp_remote_invalid_json",
        {
          connectionId: input.connection.id,
          method: input.method,
        },
      );
    }
    const record = asRecord(payload);
    if (
      !record ||
      record.error !== undefined ||
      !Object.prototype.hasOwnProperty.call(record, "result")
    ) {
      throw new ToolGatewayHttpError(
        502,
        "Remote MCP context request returned an error",
        "remote_mcp_error",
        {
          connectionId: input.connection.id,
          method: input.method,
        },
      );
    }
    await markRemoteConnectionHealth(
      input.connection,
      "ok",
      `Remote MCP server responded to ${input.method}.`,
    );
    return record.result;
  }

  async function callAssignedConnectionProtocol(input: {

View on GitHub (pinned to 3f1d897a7c)