Skip to content

MCP: a client request cannot be signed with AWS SigV4 because its body is a transient entity #1777

Done

Description

@jlouvel

Problem

An MCP client request cannot be signed with AWS Signature Version 4 for a service other than S3: HttpAwsSigV4Helper fails with AWS SigV4 signing for the 'execute-api' service needs an entity that can be read again, and for S3 it silently signs UNSIGNED-PAYLOAD instead of the body's hash.

The client transports (McpModernHttpTransport.request and RestletMcpClientTransport) send their JSON-RPC message as a ByteArrayRepresentation, which is an InputRepresentation: it is transient, and HttpAwsSigV4Helper.getPayloadHash returns null for a transient entity.

Reproduction

Start an McpClientAdapter on a Client and a ChallengeResponse with ChallengeScheme.HTTP_AWS_SIGV4 (service execute-api) through setRequestCustomizer/setCallCustomizer: server/discover fails with McpResponseLostException, caused by IllegalArgumentException: AWS SigV4 signing for the 'execute-api' service needs an entity that can be read again.

Found while moving Ikanos's consumed MCP servers to the Restlet client (naftiko/ikanos#1256), which signs them with HttpAwsSigV4Helper since naftiko/ikanos#959.

Proposed fix

Send the message as a repeatable entity (a StringRepresentation of the encoded JSON) so the signer can hash it, and add a test that signs a request of both transports.

Activity

  1. added 3 commits that reference this issue on Nov 30, 2026
  2. self-assigned this
    on Dec 1, 2026
  3. jlouvel commented on Dec 1, 2026

    @jlouvel
    CollaboratorAuthor

    Fixed by #1778, merged into 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions