Skip to content

Conversation

@maxisbey
Copy link
Contributor

This PR fixes issues introduced in PR #1247 that caused CI failures and addresses a code review comment.

Motivation and Context

PR #1247 introduced a new mcp.client.auth.extensions.client_credentials module but did not include an __init__.py file in the extensions directory, causing pyright to fail with a reportMissingTypeStubs error. Additionally, a code review comment from @Kludex requested replacing the wildcard import in auth/__init__.py with explicit imports.

How Has This Been Tested?

  • Verified pyright passes with 0 errors on the test file
  • Ran the client credentials tests successfully (2/2 tests pass)
  • Confirmed all pre-commit hooks pass (Ruff, pyright, etc.)
  • Verified existing imports from mcp.client.auth still work correctly

Breaking Changes

None. This maintains full backward compatibility with existing code.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Changes made:

  1. Created src/mcp/client/auth/extensions/__init__.py to make the extensions directory a proper Python package
  2. Replaced wildcard import in src/mcp/client/auth/__init__.py with explicit imports of all public APIs:
    • OAuthClientProvider
    • OAuthFlowError
    • OAuthRegistrationError
    • OAuthTokenError
    • PKCEParameters
    • TokenStorage
  3. Added __all__ declaration for clear public API definition

Fixes the CI failure in PR #1247.

This addresses issues introduced in PR #1247:

1. Fixed pyright reportMissingTypeStubs error by adding __init__.py to the
   extensions directory, making it a proper Python package
2. Replaced wildcard import in auth/__init__.py with explicit imports as
   requested in code review

The changes ensure type checking passes and maintain backward compatibility
with existing code that imports from mcp.client.auth.
@felixweinberger felixweinberger merged commit 8cdac3d into main Oct 29, 2025
21 checks passed
@felixweinberger felixweinberger deleted the fix-pyright-error-and-explicit-imports branch October 29, 2025 18:32
@maxisbey maxisbey mentioned this pull request Oct 29, 2025
9 tasks
@LucaButBoring LucaButBoring mentioned this pull request Oct 29, 2025
9 tasks
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.

4 participants