Skip to content

Fix cascade behavior: denying mcp tool calls should return exit code 2#4

Merged
ashwin-corridor merged 4 commits into
mainfrom
fix-cascade
Feb 23, 2026
Merged

Fix cascade behavior: denying mcp tool calls should return exit code 2#4
ashwin-corridor merged 4 commits into
mainfrom
fix-cascade

Conversation

@ashwin-corridor

@ashwin-corridor ashwin-corridor commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Fix cascade behavior: denying mcp tool calls should return exit code 2. This is a difference in behavior than other platforms, which just have exit code 0 with the deny response.

See https://docs.windsurf.com/windsurf/cascade/hooks

image
Open with Devin

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

Comment thread unified.go
Comment thread unified.go
ServerURL: input.ToolInfo.ServerURL,
ToolName: input.ToolInfo.MCPToolName,
ToolInput: input.ToolInfo.MCPToolArguments,
ServerURL: input.ToolInfo.MCPServerName,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Cascade MCP server name assigned to ServerURL field, misleading consumers

The MCPServerName (a server name like "my-server") is assigned to the ServerURL field of ExecutionContext, which is documented as "MCP server URL".

Detailed Explanation

At unified.go:412, the Cascade MCP tool handler maps input.ToolInfo.MCPServerName to ctx.ServerURL. The ExecutionContext.ServerURL field is documented at unified.go:175 as "MCP server URL (Cursor/Cascade only, for URL-based servers)" and in docs/reference-unified.md:119 as "MCP server URL (Cursor/Cascade only, for URL-based servers)".

For Cursor, ServerURL is populated from input.URL which is an actual URL (e.g., "https://mcp.example.com"). For Cascade, it's now populated with a server name (e.g., "my-mcp-server"). Any unified handler code that checks ServerURL expecting URL format (e.g., strings.Contains(ctx.ServerURL, "blocked.com") as shown in the old Cascade docs) will silently fail to match because the value is now a name, not a URL.

Impact: Users writing unified handlers that inspect ServerURL for Cascade MCP hooks will get a server name instead of a URL, causing URL-based filtering logic to silently fail.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ashwin-corridor
ashwin-corridor merged commit a489330 into main Feb 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants