claude-code - 💡(How to fix) Fix [Bug] Excessive API calls causing unexpected billing on failed requests [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54899Fetched 2026-05-01 05:51:31
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

Error Message

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:08.677Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.091Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.092Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.216Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.217Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n at _Q1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n at async ec1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.704Z"}]

Code Example

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:08.677Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.091Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.092Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.216Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.217Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at _Q1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n    at async ec1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.704Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description you just cost me $100 of extra usage on failed API calls

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.123
  • Feedback ID: 16995ef1-09c9-4612-97a6-7a2162a02326

Errors

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:08.677Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.091Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.092Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async k (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.216Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at o0H (/$bunfs/root/src/entrypoints/cli.js:2769:32776)\n    at async N (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.217Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at _Q1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n    at async ec1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T02:29:09.704Z"}]

extent analysis

TL;DR

Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable to resolve the mcp-config-invalid error.

Guidance

  • The error messages indicate a missing GITHUB_PERSONAL_ACCESS_TOKEN environment variable, which is required for the MCP server to function correctly.
  • To mitigate the issue, set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable in your terminal or vscode settings before running the API calls.
  • Verify that the environment variable is set correctly by checking the output of the echo $GITHUB_PERSONAL_ACCESS_TOKEN command in your terminal.
  • If you are using vscode, you can set the environment variable in the launch.json file or in the vscode settings.

Notes

The provided error messages suggest that the issue is related to a missing environment variable, but the root cause of the ERR_STREAM_PREMATURE_CLOSE error is unclear and may require further investigation.

Recommendation

Apply workaround: Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable to resolve the mcp-config-invalid error, as this is the most direct solution to the problem described in the error messages.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Excessive API calls causing unexpected billing on failed requests [2 comments, 2 participants]