examples/clients/conformance-auth-client/README.md
A Python OAuth client designed for use with the MCP conformance test framework.
This client implements OAuth authentication for MCP and is designed to work automatically with the conformance test framework without requiring user interaction. It programmatically fetches authorization URLs and extracts auth codes from redirects.
cd examples/clients/conformance-auth-client
uv sync
Run the auth conformance tests against this Python client:
# From the conformance repository
npx @modelcontextprotocol/conformance client \
--command "uv run --directory /path/to/python-sdk/examples/clients/conformance-auth-client python -m mcp_conformance_auth_client" \
--scenario auth/basic-dcr
Available auth test scenarios:
auth/basic-dcr - Tests OAuth Dynamic Client Registration flowauth/basic-metadata-var1 - Tests OAuth with authorization metadataUnlike interactive OAuth clients that open a browser for user authentication, this client:
This allows the conformance test framework's mock OAuth server to automatically provide auth codes without human interaction.
You can also run the client directly:
uv run python -m mcp_conformance_auth_client http://localhost:3000/mcp