-
Notifications
You must be signed in to change notification settings - Fork 616
Fix conformance test failures: SEP-1330 enums and DNS rebinding protection #1175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
tests/ModelContextProtocol.ConformanceServer/Tools/ConformanceTools.cs
Outdated
Show resolved
Hide resolved
Copilot
AI
changed the title
[WIP] Fix ErrorHandling method to return string instead of throwing exception
Fix ConformanceServer ErrorHandling tool to return response instead of throwing
Jan 26, 2026
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Copilot
AI
changed the title
Fix ConformanceServer ErrorHandling tool to return response instead of throwing
Revert: ErrorHandling tool changes - original behavior was correct
Jan 26, 2026
Implement all 5 enum variants required by SEP-1330: - Untitled single-select (simple enum) - Titled single-select (oneOf with const+title) - Legacy titled (enum + enumNames, with pragma) - Untitled multi-select (array with items.enum) - Titled multi-select (array with items.anyOf) This addresses the elicitation-sep1330-enums conformance test failures. Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Implement Host header validation middleware to prevent DNS rebinding attacks: - Validates Host header against allowed hosts (localhost, 127.0.0.1) - Returns 421 Misdirected Request for invalid hosts - Configured for conformance testing environment This addresses the dns-rebinding-protection conformance test. Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
- Tighten DNS rebinding protection to only exact matches for localhost and 127.0.0.1 - Improve pragma comment to explain SEP-1330 backward compatibility requirement Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Copilot
AI
changed the title
Revert: ErrorHandling tool changes - original behavior was correct
Fix conformance test failures: SEP-1330 enums and DNS rebinding protection
Jan 26, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the two failing conformance tests identified in CI run #21354654074.
Investigation Results
The original problem statement incorrectly attributed CI failures to the
ErrorHandlingtool. Investigation revealed:tools-call-errorconformance test passes with the original implementationelicitation-sep1330-enums(5 failures) anddns-rebinding-protection(1 failure)McpServerImpl.cslines 566-579)Changes
1. Fixed elicitation-sep1330-enums Test (5 failures → 0 failures)
Updated
ElicitationSep1330Enumstool to implement all 5 enum schema variants required by SEP-1330 specification:{ type: "string", enum: [...] }{ type: "string", oneOf: [{ const, title }, ...] }{ type: "string", enum: [...], enumNames: [...] }{ type: "array", items: { type: "string", enum: [...] } }{ type: "array", items: { anyOf: [{ const, title }, ...] } }2. Fixed dns-rebinding-protection Test (1 failure → 0 failures)
Added DNS rebinding protection middleware to prevent DNS rebinding attacks:
Hostheader against allowed hosts (exact match for localhost, 127.0.0.1)3. Housekeeping
Testing
The changes are minimal and focused on fixing the specific conformance test requirements.
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.