Applies to:
- Plan -
- Deployment -
Summary
Issue: Cursor Cloud agents throw[401] Failed to validate Cognito JWT: JWT string does not consist of exactly 3 parts when connecting to the Braintrust MCP server.
Cause: Cursor Cloud runs in a remote environment with no interactive browser session, so the default OAuth flow cannot complete — resulting in a malformed token that fails all validation checks, including Cognito JWT verification.
Resolution: Configure .cursor/mcp.json with an explicit Authorization header using a Braintrust API key to bypass OAuth entirely.
Resolution steps
Configure explicit API key auth in .cursor/mcp.json
Step 1: Create or update .cursor/mcp.json
Add the headers field with your Braintrust API key. Place this file at the project root for project-level config, or in your home directory for global config.
YOUR_BRAINTRUST_API_KEY with a key from Settings > API keys in the Braintrust app.
Step 2: Verify the connection
Restart Cursor and confirm the MCP server connects without a 401 error.Note:BRAINTRUST_API_KEYset in your local environment does not carry over to Cursor Cloud agents. The explicitheadersconfig is required.