Bound binary response size in generated clients
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Nixtla/mlforecast#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 82/100
madenvel/KalinkaPlayer#503 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
EleutherAI/lm-evaluation-harness#4508 ·
Maintainer thường phản hồi trong vòng 1 ngày