Skip to content

fix(mcp): documented GITHUB/LOOPOVER token env-var precedence contradicts the actual implementation #6262

Description

@JSONbored

Context

packages/loopover-mcp/README.md:218 and printHelp() (packages/loopover-mcp/bin/loopover-mcp.js:2686) both document the env-token precedence as: LOOPOVER_API_TOKEN, LOOPOVER_MCP_TOKEN, LOOPOVER_TOKEN. The actual implementation, getEnvApiToken() (line 3296-3298): process.env.LOOPOVER_API_TOKEN ?? process.env.LOOPOVER_TOKEN ?? process.env.LOOPOVER_MCP_TOKEN. If both LOOPOVER_MCP_TOKEN and LOOPOVER_TOKEN are set, the code picks LOOPOVER_TOKEN first — the opposite of the documented order.

Requirements

  • Determine which is actually correct (was the doc written first and the code has a bug, or was the code intentional and the doc never updated?) by checking git history/any linked issue for context.
  • Fix whichever side is wrong so the documented and actual precedence match exactly.

Test Coverage Requirements

99%+ Codecov patch coverage on getEnvApiToken if the code changes; add/update a test asserting the exact precedence order matches the (corrected) documentation.

Deliverables

  • Documented precedence and actual code precedence match.
  • Test asserting the exact order.

Expected Outcome

A user setting multiple token env vars gets the behavior the docs actually promise.

Links & Resources

  • packages/loopover-mcp/README.md:218
  • packages/loopover-mcp/bin/loopover-mcp.js:2686,3296-3298

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions