softwaremill / softwaremill/chimp
T12 - client HTTP request headers
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 102
- Forks
- 10
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 16
Description
Target branch: 2026-07-28-protocol-support
Requires:
Every POST a chimp client sends on the stateless wire carries the request headers the spec requires, including header values derived from tool arguments. The client refuses tool definitions whose header annotations are invalid.
Standard headers
- Every POST carries
Mcp-Methodequal to the JSON-RPCmethod, case preserved. tools/callandprompts/getPOSTs carryMcp-Nameequal toparams.name.resources/readPOSTs carryMcp-Nameequal toparams.uri.- A value that is not plain ASCII, or that has leading or trailing spaces or control characters, is sent in the Base64 sentinel form defined by the spec.
- Legacy requests are unchanged. stdio has no headers.
Custom headers from tool arguments
- When a tool's input schema marks a property with
x-mcp-header, the client mirrors that argument into anMcp-Param-<name>header on thetools/callPOST. - Values follow the spec encoding: plain ASCII strings as they are, other strings in the Base64 sentinel form, booleans as
trueorfalse, numbers as their JSON text. Anullargument produces no header. An argument without the annotation produces no header.
Invalid annotations
- When
tools/listover HTTP returns a tool whosex-mcp-headervalue is invalid (empty, not a string, the same header name on two properties, or a name with spaces, colons, non-ASCII or control characters), the client drops that tool from the result and keeps the others, logging a warning. - Over stdio the annotations are ignored.
Coverage
- The rules above hold for the sync HTTP transport and the streaming HTTP transports on ZIO, Ox and Pekko.
- The conformance client handles
http-standard-headers,http-custom-headers(tool arguments come fromMCP_CONFORMANCE_CONTEXT) andhttp-invalid-tool-headers.
Spec:
- Streamable HTTP - Standard Request Headers
- Streamable HTTP - Custom Headers from Tool Parameters
- Streamable HTTP - Value Encoding
- Streamable HTTP - Client Behavior
- Streamable HTTP - Case Sensitivity
- Tools - x-mcp-header
Conformance scenarios that must pass after this task:
- Client:
http-standard-headers,http-custom-headers,http-invalid-tool-headers.
Docs: yes.
docs/client/transport.md: the headers the HTTP transport adds on the stateless wire,x-mcp-headermirroring, and the filtering of tools with invalid annotations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read docs/client/transport.md and the linked Streamable HTTP specification sections first, then use the http-standard-headers, http-custom-headers, and http-invalid-tool-headers conformance scenarios as entry points. Trace the sync and streaming HTTP transports on ZIO, Ox, and Pekko, including the prerequisite issue 248. Done means all three scenarios pass and the transport documentation covers standard headers, x-mcp-header mirroring, and invalid-annotation filtering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100