OAuth is only available for remote HTTP connections. For local MCP connections using stdio
transport, use API key authentication instead.
Why Use OAuth?
Two Endpoints
Both endpoints ask for sign-in up front. That is deliberate: MCP clients run the OAuth
flow natively at connect time, so you get your editor’s own sign-in prompt instead of a
failed request part-way through a conversation.
Self-hosted deployments can set
CONTEXT7_MCP_AUTH_MODE=lazy on the MCP server to let
anonymous callers connect and spend their free monthly requests before being asked to
sign in. That trades a natively handled prompt for a frictionless trial.
How It Works
- Your MCP client connects and receives an OAuth challenge pointing at Context7
- Your client shows a sign-in prompt or an authorization link
- You’re redirected to Context7 to sign in
- After signing in, your client stores the token and connects
- Your client automatically handles token refresh from then on
lazy mode the challenge arrives later — on the tool call that crosses your free
monthly limit — and steps 2 to 5 are otherwise identical.