Skip to content

fix(mcp/github): resolve undefined input_tokens error in GitHub MCP plugin #108

@kianwoon

Description

@kianwoon

Problem

The GitHub MCP plugin crashes with an undefined input_tokens error. This occurs when the plugin internal API calls return responses that lack billing/usage token data.

Expected Behavior

MCP plugin should gracefully handle responses without input_tokens in usage metadata.

Steps to Reproduce

  1. Use any GitHub MCP plugin operation
  2. Plugin attempts to read input_tokens from its own response usage data
  3. If usage data is absent or malformed, crashes with undefined error

Environment

  • Claude Code CLI
  • GitHub MCP plugin

Additional Context

The input_tokens field appears in MCP plugin internals. It should use optional chaining or null coalescing for defensive access. Error appears as toast or alert in Claude Code CLI output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions