Added new template to detect MCP SSE endpoint #12268
Merged
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.
Template / PR Information
I've been having trouble getting the MCP template to detect the MCP servers I have tested it with. This is because you have to obtain the session_id first before sending the POST requests and those endpoints always returned a 202 response.
This template detects the HTTP with SSE in the old spec, typically on the /sse endpoint. As it is a streaming response I have set the response size to 100 to capture the first message, the spec states "When a client connects, the server MUST send an endpoint event containing a URI for the client to use for sending messages." so the matchers ensure it is an event stream and that the first event is an endpoint, the extractor then extracts the data in that first event which will be the endpoint you may send the JSON-RPC to.
This protocol is depreciated now which is why I have added this as a separate template
Template Validation
I've validated this template locally?
For validation I used the damn-vulnerable-MCP-server and bbot-server
Additional Details (leave it blank if not applicable)
Additional References: