You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate: 400 error on MCP endpoint - empty grantedSkills after SDK upgrade #756
After upgrading @modelcontextprotocol/sdk from 1.22.0 to 1.25.3 (PR #752), Claude Code authentication appeared to fail with a 400 error.
Observed:
400 on POST https://mcp.sentry.dev/mcp/sentry/mcp-server?experimental=1 (2026-01-30 15:59:21 PST)
Likely Cause
The 400 response comes from mcp-handler.ts:149-152:
if(validSkills.size===0){returnnewResponse("Authorization failed: No valid skills were granted. Please re-authorize and select at least one permission.",{status: 400},);}
This suggests the grantedSkills field was either:
Empty or not passed correctly after the SDK upgrade
Skill parsing failed due to format changes
OAuth token didn't include skills due to SDK changes
MCP SDK Changes (1.22.0 → 1.25.3)
Potentially relevant changes:
v1.25.0: "SPEC COMPLIANCE: Remove loose/passthrough types not allowed/defined by MCP spec"
experimental_createMCPClient moved to @ai-sdk/mcp package
LanguageModelV1 type renamed to LanguageModel
maxSteps replaced with stopWhen: stepCountIs(n)
tool() function API changed
Multiple test file updates needed
Estimated Scope
~15 files need modification
Significant testing required for agent functionality
Recommendation
This is a non-trivial upgrade. I recommend:
Create a dedicated branch for the full AI SDK 6 migration
Thoroughly test agent mode functionality after upgrade
Consider phased rollout if possible
@dcramer Let me know if you want me to proceed with the full migration or if you'd like to explore other options (e.g., temporary workaround, coordinating with Cloudflare on agents package).
Activity
fix(cloudflare): Add diagnostic logging for empty grantedSkills errors
fix(cloudflare): Add diagnostic logging for empty grantedSkills errors (
dcramer commentedon Jan 31, 2026
Investigation Summary
Investigated this issue and created #758 with diagnostic logging to help capture future occurrences.
Findings
What we confirmed:
mcp-handler.ts:148-152had no logging, making diagnosis impossiblegrantedSkillsarray correctly triggers the 400 (verified via new test)What we couldn't determine:
grantedSkillswhen the error occurred (empty array? malformed data? type issue?)Potential root causes identified:
[email protected]was designed for SDK 1.22.0, but pnpm hoists SDK 1.25.x when upgrading the cataloggrantedSkillscorrectlyNext Steps
Merge fix(cloudflare): Add diagnostic logging for empty grantedSkills errors #758 — Adds diagnostic logging to capture
grantedSkillsvalue, type, and array status on future 400 errorsBefore retrying SDK upgrade, consider:
agentspackage to0.3.6(designed for SDK 1.25.2) to eliminate version mismatchIf issue recurs, the new logging will show exactly what
grantedSkillscontained, enabling proper diagnosischore: Upgrade @modelcontextprotocol/sdk to ^1.25.3
dcramer commentedon Jan 31, 2026
Update: SDK Upgrade PR Created
Created PR #759 to retry the SDK upgrade (1.21.0 → 1.25.3) with:
agentspackage stays at 0.2.23 to avoid requiring AI SDK v6If this upgrade triggers the same 400 error, we'll now have detailed logging to identify the root cause.
chore: Upgrade @modelcontextprotocol/sdk to ^1.25.3 (#759)
dcramer commentedon Jan 31, 2026
Root Cause Found 🎯
The 400 error is not related to
grantedSkills- it's a protocol version mismatch:What's happening
2025-11-25createMcpHandlerfrom[email protected]only advertises support for2025-03-26and2025-06-18Why this wasn't obvious before
grantedSkillsbeing empty, which was a red herringFix Required
Upgrade the
agentspackage from Cloudflare, which controls the MCP handler. However, this has cascading dependencies:[email protected]requiresai>=5.0.0(we haveai@^4.3.16)[email protected]requiresai>=6.0.0This is now a blocking issue - Claude Code users cannot connect until we upgrade.
Next Steps
RevertPR chore: Upgrade @modelcontextprotocol/sdk to ^1.25.3 #759 was already merged, but it's not the cause - need to upgradeagentspackage[email protected]→[email protected]or[email protected]+ correspondingagentsversiondcramer commentedon Jan 31, 2026
Upgrade Analysis Complete
Root Cause
Claude Code uses MCP protocol version
2025-11-25, but our server (via[email protected]) only supports2025-03-26and2025-06-18.Required Upgrades
To support protocol
2025-11-25, we need:agentsai@ai-sdk/anthropic@ai-sdk/openai@ai-sdk/react@modelcontextprotocol/sdkAI SDK 6 Breaking Changes Requiring Code Updates
experimental_createMCPClientmoved to@ai-sdk/mcppackageLanguageModelV1type renamed toLanguageModelmaxStepsreplaced withstopWhen: stepCountIs(n)tool()function API changedEstimated Scope
Recommendation
This is a non-trivial upgrade. I recommend:
@dcramer Let me know if you want me to proceed with the full migration or if you'd like to explore other options (e.g., temporary workaround, coordinating with Cloudflare on agents package).
Revert MCP SDK upgrade to fix protocol version mismatch (#760)