Bound binary response size in generated clients
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start with client.request_bytes in the generated servers and review PR #84 for the earlier streaming approach. Then inspect mcp-scope.yaml and the response_kind contract before deciding where the response limit belongs. Done means the project has a documented size-limit design that avoids the rejected environment-variable override without changing response_kind.
Written by the indexing model from the issue text.
Description
Follow-up to PR #84 review.
Context
client.request_bytes (in generated servers) currently reads the full
response body via response.content with no upper bound. For the "help
people build MCP servers fast" default that is the right choice, but a
truly large upstream body (multi-GB PDF, tarball, archive) will OOM
the generated server.
An earlier iteration of PR #84 streamed the body via
httpx.AsyncClient.stream(...) + aiter_bytes() with a 32 MiB cap
configurable via MCP_MAX_BINARY_RESPONSE_BYTES. That shape was
reverted as too complex for a scaffolding repo, but the underlying
concern remains.
Open questions
- Where should the cap live — scope YAML (per-tool), server-level
config, or a hard default baked into the renderer? - Do we want in-memory reads with an early fail, or stream-to-tempfile
so the caller can hand MCP a path instead of bytes? - Avoid the env-var override pattern from the reverted version — if
configurable, prefer something declared inmcp-scope.yaml.
Non-goals
- Re-introducing
MCP_MAX_BINARY_RESPONSE_BYTESas-is. - Any change to the
response_kindcontract.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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.
More from stacklok/mcp-builder
-
Expand ai-scoping auth gate: external URL shape, public/confidential client, IdP authorize-params notesPossibly taken @lorr1 claimed this 170 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stacklok/mcp-builder#100 ·
-
Dependency DashboardOpen
Difficulty 1/5 Under an hour Newbie friendliness 15/100
stacklok/mcp-builder#61 ·
All issues in stacklok/mcp-builder
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
darnitdevorg/darnit#587 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
accessibility good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
llm translation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug bug-hunt
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day