Skip to content

fix(mcp): add API key auth support for Context7 server#232

Open
mvanhorn wants to merge 1 commit intoEveryInc:mainfrom
mvanhorn:fix/context7-api-key-auth
Open

fix(mcp): add API key auth support for Context7 server#232
mvanhorn wants to merge 1 commit intoEveryInc:mainfrom
mvanhorn:fix/context7-api-key-auth

Conversation

@mvanhorn
Copy link

@mvanhorn mvanhorn commented Mar 8, 2026

Summary

  • Add x-api-key header to Context7 MCP server config in .mcp.json, reading from CONTEXT7_API_KEY env var with an empty default (${CONTEXT7_API_KEY:-}) so it remains optional
  • Update README Context7 section to document the authentication setup
  • Update Known Issues workaround snippet to include the headers config

Closes #153

Details

Without authentication, all Context7 MCP requests go unauthenticated and immediately hit the anonymous rate limit ("Monthly quota exceeded"). Claude Code supports ${VAR:-default} environment variable interpolation in .mcp.json headers, so users just need to set CONTEXT7_API_KEY in their environment to authenticate.

The empty default (:-) means the config still parses correctly for users who haven't set the key yet - they'll just continue to use anonymous access.

Test plan

  • Verify .mcp.json is valid JSON after the change
  • Confirm Claude Code resolves ${CONTEXT7_API_KEY:-} when the env var is set
  • Confirm Claude Code resolves to empty string when the env var is not set (no parse error)
  • With a valid API key, verify Context7 requests succeed without rate limiting

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Add x-api-key header to Context7 MCP config using CONTEXT7_API_KEY env
var with empty default so it remains optional. Without auth, all requests
hit the anonymous rate limit ("Monthly quota exceeded"). Also update
README to document the API key setup and the Known Issues workaround.

Closes EveryInc#153

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context7 MCP server missing API key auth — all requests hit anonymous rate limit when using PLAN

1 participant