Document http.maxRequestBodySize (REST, MCP application endpoint, and operations API body limits)

Offen Anfängerfreundlich
#806 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
88/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Bereich
documentation

Rechercherichtung

Beginne mit reference/configuration/options.md und dokumentiere http.maxRequestBodySize und operationsApi.network.maxRequestBodySize anhand der im Issue beschriebenen Standardwerte und des Vererbungsverhaltens. Füge dann den Hinweis zum MCP-Body-Limit in reference/mcp/overview.md hinzu und orientiere dich für die Platzierung am vorhandenen Hinweis zur Ratenbegrenzung. Fertig ist es, wenn alle drei Durchsetzungspunkte und der angegebene Versionsvorbehalt korrekt dokumentiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Re-verified on harper main a7dae444c (2026-10-26). Correction to the version note below: MCP application-endpoint enforcement merged as harper#3398 on 2026-10-26 and ships in 5.4; the v5.3 cherry-pick (harper#3536) is still open, so say "5.4 (and 5.3.x once #3536 ships)" rather than 5.3.1. Re-checked against harper main a7dae444c: the three enforcement points are unchanged. Related: harper#3397 (bound the discard of a rejected body).

What is missing

http.maxRequestBodySize does not appear anywhere in the documentation tree (git grep -i maxrequestbody at origin/main 34b029d9 → 0 hits). reference/configuration/options.md:156 lists the operationsApi: block without network.maxRequestBodySize; reference/mcp/configuration.md and reference/mcp/overview.md say nothing about a request-body limit.

What the code does (harper main 0c94b150b)

One option, three enforcement points:

  • REST / any streamToBuffer reader — server/serverHelpers/contentTypes.ts:618 reads http_maxRequestBodySize (default 10,000,000 bytes); :626-634 answers 413 Request body too large, maximum size is N bytes.
  • MCP application endpoint — since PR #3398 (f0f4e5007, 5.3.1): components/mcp/adapters/harperHttp.ts:68,117-137 refuses a declared Content-Length over the limit before any byte arrives and a streamed body once the running count exceeds it, 413 {"error":"payload_too_large","message":…}.
  • Operations API — Fastify bodyLimit from operationsApi.network.maxRequestBodySize (server/operationsServer.ts:50,368, default 1 GiB), which config/configUtils.ts:1228 fills from http.* whenever the operationsApi.network block exists — and the shipped static/defaultConfig.yaml:62-69 always ships that block. So setting http.maxRequestBodySize also caps the operations API unless operationsApi.network.maxRequestBodySize is set separately.

Measured (SQA-73/SQA-74): with http.maxRequestBodySize: 65536, a REST PUT, an MCP POST on the application port and an MCP POST on the operations port all refuse at 65,537 bytes; with it unset, the operations port accepts up to 1 GiB.

Suggested content

In reference/configuration/options.md, under http: maxRequestBodySize — bytes, default 10000000; applies to REST and custom resources, and to the MCP application endpoint (5.3.1+); exceeding it returns 413. Under operationsApi.network: maxRequestBodySize — default inherits http.maxRequestBodySize when set, otherwise 1 GiB. One line in reference/mcp/overview.md beside the existing note that global rate limiting does not apply to MCP, stating that the body limit does.

Existing work checked

HarperFast/documentation issues and PRs searched for maxRequestBodySize and body size: nothing (open docs PRs #745, #739, #734 are credential masking, full-text paging, MCP subscribe). harper 1,500 issues + 800 PRs and harper-pro 349 + 768 titles: PR #3398 (merged) and harper#3397 (open, discard bound) name the key only in code terms; #3398 cites components/mcp/DESIGN.md, not the docs repo.

What this does not prove

A docs change in flight on a branch other than origin/main as of 34b029d9 (fetched 2026-10-26T04:10Z); the operations-port fallback for a hand-edited config with no operationsApi.network block (source read only, not measured).

Vorherrschende Sprache
MDX
Sterne
9
Forks
9
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
48

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus HarperFast/documentation

Alle Issues in HarperFast/documentation

Ähnliche Issues

Weitere Issues zu Documentation

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.