fix: Add explicit type checks for MCP servers (http/sse)#487
Merged
benbrandt merged 1 commit intoagentclientprotocol:mainfrom Mar 27, 2026
Merged
fix: Add explicit type checks for MCP servers (http/sse)#487benbrandt merged 1 commit intoagentclientprotocol:mainfrom
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
Conversation
benbrandt
pushed a commit
that referenced
this pull request
Mar 27, 2026
🤖 I have created a release *beep* *boop* --- ## [0.24.2](v0.24.1...v0.24.2) (2026-03-27) ### Bug Fixes * Add explicit type checks for MCP servers (http/sse) ([#487](#487)) ([e00a439](e00a439)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
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
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.
As mentioned in #468 (comment)
IDEA always explicitly passes the MCP server type; for example, even if the type is
stdio, IDEA will still passtype: 'stdio'.This causes the following code to enter the http or sse branch due to the presence of the 'type' field
As part of defensive programming, change this line to a more robust check:
if ("type" in server && (server.type === "http" || server.type === "sse"))