createMcpHonoApp: JSON body middleware has a size limit but no time limit (stalled body holds the request open)
Maintainer thường phản hồi trong vòng 1 ngày
@Muzzy5150 đang làm issue này rồi.
Từ ngày 31/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Start by locating createMcpHonoApp's JSON body middleware and the readRequestBody helper in @modelcontextprotocol/server, then trace how request-body errors become HTTP responses. The issue suggests adding a body-arrival deadline that returns 408 and closes the connection, but leaves the design open. Done means stalled bodies are bounded while the existing size limit still works; add coverage for both behaviors.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
createMcpHonoApp's JSON body middleware bounds how many bytes it reads (maxRequestBodySize) but not how long the body takes to arrive. A client that sends part of a body and then stalls keeps the request open with no response from the middleware. The only limit is the underlying HTTP server's own timeout (for Node, server.requestTimeout, 300 s by default).
Reproduction
@modelcontextprotocol/hono 2.0.2, @modelcontextprotocol/server 2.3.1, @hono/node-server 2.1.5, Node 24.
import { serve } from '@hono/node-server';
import { createMcpHonoApp } from '@modelcontextprotocol/hono';
import { request } from 'node:http';
const app = createMcpHonoApp({ host: '127.0.0.1' });
app.all('/mcp', (c) => c.text('unreachable while the body is stalled'));
const server = serve({ fetch: app.fetch, port: 0, hostname: '127.0.0.1' }, ({ port }) => {
const req = request(`http://127.0.0.1:${port}/mcp`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Content-Length': '100' },
}, (res) => console.log('responded', res.statusCode));
req.write('{'); // 1 of 100 declared bytes, then nothing
setTimeout(() => { console.log('still open after 3s'); req.destroy(); server.close(); }, 3000);
});
Output: still open after 3s. The request is held until the client leaves or the server's timeout fires.
Expected
An option to bound body arrival time (for example a bodyTimeoutMs), answering 408 and closing the connection when it expires. The readRequestBody helper in @modelcontextprotocol/server could accept an AbortSignal for the same purpose, so adapters can supply their own deadline.
Impact
Low for a loopback development server. For a deployed server, each stalled request holds a connection and a handler slot until the server's timeout.
I am not asking for a particular design, only noting that the size limit has no time counterpart. We document the gap and rely on the server timeout meanwhile.
- Ngôn ngữ chính
- TypeScript
- Star
- 13.8k
- Fork
- 2.5k
- Merge trung bình
- 6 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 2
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 khác của modelcontextprotocol/typescript-sdk
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Có thể đã có người làm @mgoldsborough đã nhận 6 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyCó thể đã có người làm @Tidehyc đã nhận 7 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsCó thể đã có người làm @yunusemrejs đã nhận 12 ngày trước. Đang mởv1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/typescript-sdk
Issue tương tự
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openclaw/openclaw#212827 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Use one constant for the 10,000-character input limitCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởgood first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aniru-dh21/snap-validate#51 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies effort: small good first issue priority: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-review tech-debt testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blamechris/chroxy#9520 ·
Maintainer thường phản hồi trong vòng 1 ngày