fix(mcp): Stop sending API key as Bearer token in MCP client #12349
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/flow-polling-mechanism #12349 +/- ##
==============================================================
Coverage ? 37.69%
==============================================================
Files ? 1663
Lines ? 83783
Branches ? 12492
==============================================================
Hits ? 31580
Misses ? 50365
Partials ? 1838
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
0d58c76
into
feat/flow-polling-mechanism
* fix(mcp): Stop sending API key as Bearer token in MCP client (#12349) * fix: replace unnecessary dict comprehension with dict() call * Update test_mcp_client.py --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Eric Hare <ericrhare@gmail.com>
* fix(mcp): Stop sending API key as Bearer token in MCP client (#12349) * fix: replace unnecessary dict comprehension with dict() call * Update test_mcp_client.py --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Eric Hare <ericrhare@gmail.com>
* fix(mcp): Stop sending API key as Bearer token in MCP client (#12349) * fix: replace unnecessary dict comprehension with dict() call * Update test_mcp_client.py --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Eric Hare <ericrhare@gmail.com>
Objective
Fix MCP client authentication failing with 401 when using LANGFLOW_API_KEY environment variable.
Changes
Notes
When both Authorization: Bearer <api_key> and x-api-key: <api_key> headers were sent, the backend validated the Bearer token first as a JWT, failed with "Invalid token", and returned 401 before ever checking the x-api-key header. This made LANGFLOW_API_KEY env var auth unusable for the MCP server. The fix ensures each header is used only for its intended auth mechanism: x-api-key for API keys, Authorization: Bearer for JWT tokens from login.