fix(mcp): add API key auth support for Context7 server#232
Open
mvanhorn wants to merge 1 commit intoEveryInc:mainfrom
Open
fix(mcp): add API key auth support for Context7 server#232mvanhorn wants to merge 1 commit intoEveryInc:mainfrom
mvanhorn wants to merge 1 commit intoEveryInc:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-api-keyheader to Context7 MCP server config in.mcp.json, reading fromCONTEXT7_API_KEYenv var with an empty default (${CONTEXT7_API_KEY:-}) so it remains optionalCloses #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.jsonheaders, so users just need to setCONTEXT7_API_KEYin 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
.mcp.jsonis valid JSON after the change${CONTEXT7_API_KEY:-}when the env var is setCo-Authored-By: Claude Opus 4.6 noreply@anthropic.com