[BUG] Wrike remote MCP OAuth fails — complete_authentication says no flow in progress despite authenticate succeeding.

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Wrike MCP OAuth Bug Report Summary

---
Goal

Connect the Wrike MCP server (https://mcp.wrike.com/app/mcp/stream) to Claude Code CLI so that Wrike tools (tasks, projects, etc.)
are accessible within Claude Code sessions.

---
Environment

---
What Was Tried

The two-step OAuth flow was attempted 3 times:

Step 1 — mcp__wrike__authenticate
Called to initiate the OAuth flow. Each time it successfully returned a valid Wrike authorization URL.

Step 2 — User authorizes in browser
User visited the URL, logged into Wrike, and approved access. The browser redirected to
http://localhost:8080/callback?code=...&state=... (page failed to load as expected for CLI). User copied the full callback URL from
the address bar and pasted it back immediately.

Step 3 — mcp__wrike__complete_authentication
Called with the full callback URL. Failed every time.

What Should Happen?

Expected Behavior

After mcp__wrike__authenticate initiates the flow and the user completes browser authorization, mcp__wrike__complete_authentication
should:

  1. Retrieve the stored PKCE code verifier from the active session
  2. Exchange the authorization code for an access token with Wrike's OAuth server
  3. Store the token and make Wrike MCP tools available in the CLI session

Actual Behavior

mcp__wrike__complete_authentication consistently returns:

▎ No OAuth flow is in progress for wrike. Call mcp__wrike__authenticate first, then retry with the callback URL.

This occurs even when the callback URL is pasted back within seconds of authorization.

Root Cause Hypothesis

Claude Code's MCP client stores the PKCE code_verifier (and session state) locally when mcp__wrike__authenticate is called. By the
time mcp__wrike__complete_authentication is called — even immediately — that local OAuth session state has been lost or is not
accessible. This is an internal Claude Code state management bug; Wrike's server is functioning correctly throughout.

---
Workaround

Connecting Wrike via the Claude web app (claude.ai) works successfully. The web app's browser-native OAuth flow does not have this
state persistence issue.

Error Messages/Logs

Session 1 — invalid_request / Redirect URI error                                                                                    
  Before the current session, a prior attempt produced a different error directly in the browser callback:                            
  {                                                                                                                                   
    "error": "invalid_request",                                                                                                       
    "error_description": "Redirect uri is missing or invalid",                                                                        
    "state": "XnUI-in9ZuexAwU7ZVJIpHJ5pg5TXeIKpanTB8EhVqU"                                                                          
  }                                                       
  This occurred when Wrike was added via:                                                                                             
  claude mcp add --transport http --client-id FUNwxKsL --client-secret <redacted> --callback-port 8080 wrike
  https://mcp.wrike.com/app/mcp/stream                                                                                                
                                                                                                                                      
  Session 2 — Same invalid_request error on retry                                                                                     
  {                                                                                                                                   
    "error": "invalid_request",                                                                                                     
    "error_description": "Redirect uri is missing or invalid",                                                                        
    "state": "CiSbGx0wJz3GC5MpfN8DqGzkMRY8nBK7KaOc7MN4NQg"                                                                          
  }                                                       
                                                                                                                                      
  Session 3 (current session) — No OAuth flow is in progress
  After the redirect URI issue was resolved, the error changed to:                                                                    
  No OAuth flow is in progress for wrike. Call `mcp__wrike__authenticate` first, then retry with the callback URL.                  
  This occurred on 3 consecutive attempts.                                                                                            
                                                                                                                                      
  ---                                                                                                                                 
  Summary of Error Progression                                                                                                        
                                                                                                                                      
  ┌───────────────┬─────────────────────────────────────────────────────┐                                                           
  │     Stage     │                        Error                        │                                                             
  ├───────────────┼─────────────────────────────────────────────────────┤                                                           
  │ Initial setup │ invalid_request: Redirect uri is missing or invalid │
  ├───────────────┼─────────────────────────────────────────────────────┤
  │ After fix     │ No OAuth flow is in progress for wrike (3x)         │
  └───────────────┴─────────────────────────────────────────────────────┘                                                             
   
The error shifted from a redirect URI configuration issue to an OAuth session state persistence bug — suggesting the redirect URI was eventually resolved but a deeper issue in Claude Code's OAuth state management remains.

Steps to Reproduce

Steps to Reproduce

  1. Open Claude Code CLI
  2. Start a conversation and call mcp__wrike__authenticate (or trigger it via /mcp)
  3. Copy the authorization URL returned and open it in a browser
  4. Log into Wrike if prompted
  5. Approve/authorize the Wrike OAuth request
  6. The browser redirects to http://localhost:8080/callback?code=...&state=... — copy the full URL from the address bar
  7. Call mcp__wrike__complete_authentication with that callback URL

---
Expected Result

Wrike MCP tools become available in the CLI session.

Actual Result

No OAuth flow is in progress for wrike. Call mcp__wrike__authenticate first, then retry with the callback URL.

---
Note: This is reproducible 100% of the time (failed on 3 consecutive attempts). The time between steps 2 and 7 does not appear to
matter — even when the callback URL is pasted back within seconds, the error occurs.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

4.6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗