Skip to content

Mirror SEP-2792 _meta acceptLanguage to Accept-Language on CLI and TUI connections #2987

Closed

Description

@cliffhall

Follow-up to #2979, which mirrors the SEP-2792 language preference in the web backend only.

The problem

SEP-2792 carries a language preference in params._meta["io.modelcontextprotocol/acceptLanguage"]. On Streamable HTTP a client also mirrors it to Accept-Language, and a server may reject a present header that does not exactly equal _meta (400 / HeaderMismatch, -32020); a missing header is tolerated.

The CLI and TUI connect through the direct Node transport (core/mcp/node/transport.ts), which does not mirror. Worse, the header is never actually missing there: Node's fetch (undici) sends Accept-Language: * on any request that carries none. So with an acceptLanguage set in request metadata (--metadata / server settings), every Streamable HTTP request goes out with _meta = fr-CA beside Accept-Language: *. That is exactly the mismatch a strict server rejects.

Reproduce

  1. npm run test-servers:build (from clients/web), then node test-servers/build/server-composable.js --config test-servers/configs/language-preference-http.json (added in Support SEP-2792 language preferences in Web Inspector #2979).
  2. Call localized_greeting from the CLI or TUI with request metadata { "io.modelcontextprotocol/acceptLanguage": "fr" }.
  3. The result is an isError HeaderMismatch reporting Accept-Language header: *. The same call from the web client returns Bonjour, world!.

clients/web/src/test/integration/mcp/localized-greeting-fixture.test.ts pins this current behavior ("flags Node fetch's default * against an unmirrored _meta preference").

Expected

Direct HTTP connections mirror the preference exactly, as the web backend now does. #2979 adds acceptLanguageHeaderFor(message) in core/mcp/acceptLanguage.ts, which a direct-transport send path could reuse (e.g. via the per-send headers option, as the backend does).

Activity

  1. added this to the v2.17.0 milestone on Nov 18, 2026
  2. added
    enhancement
    v2
    on Nov 18, 2026
  3. cliffhall commented on Nov 18, 2026

    @cliffhall
    MemberAuthor

    Priority score: severity 3 (a feature is missing on two clients, and a strict server rejects the request) + urgency 2 (wanted eventually; SEP-2792 is still an open PR) + 1 (milestoned) = 6 → Medium.

  4. self-assigned this
    on Nov 18, 2026
  5. modified the milestones: v2.17.0, v2.16.0 on Nov 18, 2026
  6. cliffhall commented on Nov 18, 2026

    @cliffhall
    MemberAuthor

    Shipped in #2990 (merged to v2/main as a7eaab0).

  7. added a commit that references this issue on Nov 19, 2026
    4ca5a3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions