Add config to control MCP path appending to backend endpoint URL#14223
Add config to control MCP path appending to backend endpoint URL#14223nisan-abeywickrama wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughAcross four distribution module velocity templates ( ChangesMCP Path Handling and Test Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14223 +/- ##
============================================
- Coverage 11.25% 9.30% -1.95%
+ Complexity 827 763 -64
============================================
Files 361 361
Lines 17719 17719
Branches 1897 1897
============================================
- Hits 1994 1649 -345
- Misses 15691 16043 +352
+ Partials 34 27 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5a5c778 to
d76a859
Compare
d76a859 to
111a76d
Compare
Purpose
When the MCP path append feature flag is enabled,
/mcpwas unconditionally appended to MCP server backend endpoint URLs, causing 404 errors for MCP servers that don't expose a/mcppath segment. This change updates the Velocity templates to conditionally strip the URL postfix for MCP APIs based on themcpPathAppendedmetadata flag.Related issue: wso2/api-manager#5046
Approach
velocity_template.xml(all four distribution profiles:all-in-one-apim,api-control-plane,gateway,traffic-manager) — added a Velocity conditional block that removes theREST_URL_POSTFIXaxis2 property for MCP APIs when$mcpPathAppendedis nottrue. This ensures that when MCP path appending is disabled (the default), the gateway forwards requests to the backend URL as-is without appending/mcp.