More strictly enforce Accept MCP#1025
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: This PR tightens MCP HTTP request/response expectations by enforcing specific request headers and updating the E2E Hurl suite accordingly. Changes:
Technical Notes: Header names are already expected lowercase due to the underlying HTTP server implementation, and the new behavior is validated via schema evaluation in the E2E suite. 🤖 Was this summary useful? React with 👍 or 👎 |
| // type catches integration bugs before SSE lands. | ||
| // https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#sending-messages-to-the-server | ||
| const auto accept{request.header("accept")}; | ||
| if (accept.find("application/json") == std::string_view::npos || |
There was a problem hiding this comment.
src/actions/action_mcp_v1.h:107: The Accept check uses case-sensitive substring matching on the raw header value; since media types are case-insensitive and clients may vary formatting/whitespace, this can incorrectly reject valid Accept headers.
Severity: medium
Other Locations
enterprise/server/include/sourcemeta/one/enterprise_server_actions.h:119
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| // error). The MUST is implicit in MCP's wire spec. Real-world clients | ||
| // send one of two forms. | ||
| const auto content_type{request.header("content-type")}; | ||
| if (content_type != "application/json" && |
There was a problem hiding this comment.
src/actions/action_mcp_v1.h:123: The Content-Type validation only accepts two exact strings, but header values aren’t normalized here (e.g., application/json;charset=utf-8 without the space, or charset=UTF-8), so valid JSON requests may get a 415 unexpectedly.
Severity: medium
Other Locations
enterprise/server/include/sourcemeta/one/enterprise_server_actions.h:135
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
3 issues found across 62 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Benchmark Index (community)
Details
| Benchmark suite | Current: c1d4e29 | Previous: 34152d0 | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
413 ms |
333 ms |
1.24 |
Add one schema (100 existing) |
28 ms |
21 ms |
1.33 |
Add one schema (1000 existing) |
85 ms |
66 ms |
1.29 |
Add one schema (10000 existing) |
694 ms |
548 ms |
1.27 |
Update one schema (1 existing) |
21 ms |
15 ms |
1.40 |
Update one schema (101 existing) |
29 ms |
22 ms |
1.32 |
Update one schema (1001 existing) |
87 ms |
67 ms |
1.30 |
Update one schema (10001 existing) |
712 ms |
554 ms |
1.29 |
Cached rebuild (1 existing) |
6 ms |
4 ms |
1.50 |
Cached rebuild (101 existing) |
9 ms |
5 ms |
1.80 |
Cached rebuild (1001 existing) |
29 ms |
18 ms |
1.61 |
Cached rebuild (10001 existing) |
248 ms |
157 ms |
1.58 |
Index 100 schemas |
620 ms |
591 ms |
1.05 |
Index 1000 schemas |
1543 ms |
1237 ms |
1.25 |
Index 10000 schemas |
13991 ms |
10932 ms |
1.28 |
Index 10000 schemas (custom meta-schema) |
145083 ms |
134807 ms |
1.08 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Benchmark Index (enterprise)
Details
| Benchmark suite | Current: c1d4e29 | Previous: 34152d0 | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
383 ms |
383 ms |
1 |
Add one schema (100 existing) |
33 ms |
34 ms |
0.97 |
Add one schema (1000 existing) |
94 ms |
95 ms |
0.99 |
Add one schema (10000 existing) |
751 ms |
771 ms |
0.97 |
Update one schema (1 existing) |
25 ms |
25 ms |
1 |
Update one schema (101 existing) |
33 ms |
33 ms |
1 |
Update one schema (1001 existing) |
96 ms |
94 ms |
1.02 |
Update one schema (10001 existing) |
763 ms |
782 ms |
0.98 |
Cached rebuild (1 existing) |
8 ms |
8 ms |
1 |
Cached rebuild (101 existing) |
10 ms |
11 ms |
0.91 |
Cached rebuild (1001 existing) |
34 ms |
33 ms |
1.03 |
Cached rebuild (10001 existing) |
275 ms |
282 ms |
0.98 |
Index 100 schemas |
524 ms |
661 ms |
0.79 |
Index 1000 schemas |
1623 ms |
1628 ms |
1.00 |
Index 10000 schemas |
13632 ms |
13558 ms |
1.01 |
Index 10000 schemas (custom meta-schema) |
134788 ms |
134478 ms |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Signed-off-by: Juan Cruz Viotti jv@jviotti.com