Skip to content

Relax default MCP auth enforcement#45

Merged
speterkins merged 4 commits into
mainfrom
speterkins/mcp-sdk-auth-default-open
Mar 31, 2026
Merged

Relax default MCP auth enforcement#45
speterkins merged 4 commits into
mainfrom
speterkins/mcp-sdk-auth-default-open

Conversation

@speterkins
Copy link
Copy Markdown
Contributor

@speterkins speterkins commented Mar 27, 2026

Summary

  • stop requiring auth by default when no auth configuration is present
  • continue to parse and expose North auth context when headers are provided
  • preserve get_authenticated_user() semantics for truly unauthenticated requests
  • remove the trusted_jwks_urls direction from the SDK

Testing

  • uv run pytest -q tests/test_north_token_verifier.py tests/test_trusted_issuers.py tests/test_x_north_trusted_issuers.py

Note

Medium Risk
Changes the default authentication posture for MCP endpoints, which can unintentionally expose servers if deployers relied on implicit auth enforcement. Signature verification behavior is also refactored around trusted_issuers, so misconfiguration could cause unexpected 401s.

Overview
Relaxes default MCP auth enforcement. When neither server_secret nor trusted_issuers are configured, NorthAuthBackend.authenticate() now returns an empty AuthenticatedUser (instead of raising) and only validates headers if X-North-* or legacy Authorization data is actually provided.

Preserves explicit auth when configured. If server_secret/trusted_issuers are set, requests without auth headers still 401, and token signature verification now explicitly rejects missing/untrusted iss and routes verification through a new _verify_token_signature_from_issuer() helper.

Tests are updated to cover the new “open by default” behavior (including whitespace/absent headers), and the package version is bumped to 0.3.2.

Written by Cursor Bugbot for commit 709395d. This will update automatically on new commits. Configure here.

Comment thread src/north_mcp_python_sdk/auth.py
@speterkins speterkins marked this pull request as ready for review March 30, 2026 20:42
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread src/north_mcp_python_sdk/auth.py
@speterkins speterkins force-pushed the speterkins/mcp-sdk-auth-default-open branch from 4446944 to c85f96d Compare March 31, 2026 17:22
@speterkins speterkins added this pull request to the merge queue Mar 31, 2026
Merged via the queue into main with commit 1a8dd0b Mar 31, 2026
4 checks passed
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.

2 participants