@upstash/context7-mcp@4.2.0

upstash/context7@upstash/context7-mcp@4.2.0Oct 7, 2026by github-actions[bot]

Upgrading?

AI Summary

This minor release enforces authentication for the HTTP `/mcp` endpoint and introduces new configuration options for observing authentication events. It also improves the handling of OAuth access tokens.

Key Highlights

  • Credentials are now required on the HTTP `/mcp` endpoint by default.
  • Added `MCP_AUTH_ENFORCEMENT=observe` mode for anonymous access with privacy-safe logging.
  • OAuth access tokens now trigger an HTTP 401 with a `WWW-Authenticate` challenge when expired or revoked.
  • CORS responses now expose `WWW-Authenticate` and `MCP-Session-Id` headers.

Breaking Changes

  • Credentials are now required on the HTTP `/mcp` endpoint by default.

New Features

  • New `MCP_AUTH_ENFORCEMENT` environment variable.
  • New `MCP_OAUTH_TOKEN_VALIDATION` environment variable.
  • Immediate 401 challenge response for invalid OAuth tokens.
  • Improved error messages indicating sign-in expiration.

Full Release Notes

### Minor Changes

- 48eb9f0: Require credentials on the HTTP `/mcp` endpoint by default. Set `MCP_AUTH_ENFORCEMENT=observe` to keep anonymous `/mcp` access and record privacy-safe authentication migration events; `/mcp/oauth` and Claude Code plugin requests keep their challenge in both modes. `/mcp/oauth` stays as a compatibility alias, each endpoint publishes its own OAuth protected-resource metadata, an empty or scheme-only `Authorization: Bearer` header counts as a missing credential, and CORS responses expose `WWW-Authenticate` and `MCP-Session-Id`.

### Patch Changes

- 126379b: Answer an expired or revoked OAuth access token (`oat_…`) on the hosted HTTP transport with an HTTP 401 and a `WWW-Authenticate: Bearer error="invalid_token"` challenge, so MCP clients refresh the token instead of showing a tool error. The server checks the token against the Context7 API before serving the request, caches the verdict in memory per token hash for about a minute on each replica, and fails open when the check is unavailable. Set `MCP_OAUTH_TOKEN_VALIDATION=off` to disable the check. When the Context7 API still rejects an OAuth token on a tool call, the tool text now says the sign-in expired instead of describing API keys.

Related Repositories