Closed
Description
Had great success before the most recent update.
Error message
Are you sure you wish to continue? (y/N): y
Parsing PRD file: scripts/thisoceanfox-upgrades-mermaidlens-prd.txt
Generating 10 tasks...
[INFO] Parsing PRD file: scripts/thisoceanfox-upgrades-mermaidlens-prd.txt
[INFO] Calling Claude...
[ERROR] Error: Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
[ERROR] Error communicating with Claude: Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
Error communicating with Claude: Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
[ERROR] Error parsing PRD: Error communicating with Claude: Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
Error: Error communicating with Claude: Error communicating with Claude: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
🐞 Bug Report
1. Summary/Title
Authentication failure in Task Master CLI & MCP despite valid API key and environment setup
2. Description
Task Master fails to authenticate against Anthropic API when run from both the CLI and the MCP environment. This issue persists even after multiple key resets and reconfigurations.
Steps to Reproduce:
- Generate a new API key from the Anthropic console.
- Replace the existing key in the
.env
file:(No quotes, no spaces, no trailing newline)ANTHROPIC_API_KEY=sk-ant-api03-your-key-here- Reinstall
taskmaster
globally:npm uninstall -g taskmaster && npm install -g taskmaster
- Attempt to run Task Master from CLI or Cursor's MCP.
- Observe: Authentication error is returned.
Troubleshooting performed:
- Key replaced twice; verified to work via direct Claude API call.
- Verified key is loaded correctly with this test:
node -e "require('dotenv').config(); console.log(process.env.ANTHROPIC_API_KEY)"
- Checked
.env
formatting: no quotes, no newlines, correct prefix.- Confirmed key is active in the Anthropic console.
- Verified file access for PRD file.
- Task Master version is up-to-date.
3. Expected Results
Task Master should authenticate successfully and proceed to process the PRD file using the Anthropic API.
4. Actual Results
Authentication fails consistently. Logs indicate key is sent but rejected, with no error suggesting misformatting or network issues.
5. Environment
- Device: MacBook Pro (14-inch, Nov 2024)
- Chip: Apple M4 Pro
- Memory: 24 GB
- OS: macOS Sequoia 15.3.1
- Startup Disk: Macintosh HD
- Cursor Version: 0.49.4 (Universal)
- VSCode Base: 1.96.2
- Node.js: v18.x
- NPM: v9.x
- Task Master: v0.12.1
- Execution Contexts: CLI, Cursor MCP
Originally posted by @thisoceanfox in #294
Metadata
Metadata
Assignees
Labels
Projects
Status
Done