modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Extend conformance client.php with scenario context env vars
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Description
Context
The conformance runner ships per-scenario context via --context JSON which it passes to the client command. The current tests/Conformance/client.php only reads MCP_CONFORMANCE_SCENARIO and the server URL — it ignores client_id, client_secret, private_key_pem, signing_algorithm, idp_id_token, idp_issuer, idp_token_endpoint, idp_client_id. Without these, auth scenarios cannot exercise the SDK even after auth flows are implemented.
Scope
- Read context from the env var the runner sets (verify exact name; commonly
MCP_CONFORMANCE_CONTEXTas JSON). - For each scenario, wire context into
Client\Builder:auth/pre-registration→setOAuthClient(client_id, client_secret).auth/client-credentials-basic→setOAuthClient(...)+ forceclient_credentialsgrant.auth/client-credentials-jwt→setOAuthClientWithKey(client_id, private_key_pem, signing_algorithm).auth/cross-app-access-complete-flow→ supply IdP id_token + IdP discovery params.
- Land this before or in parallel with auth flow implementation so each PR can be validated against conformance immediately.
Conformance scenarios unblocked
Prerequisite for all auth scenarios requiring context.
Dependencies
Independent — can land first (harness-only).
Acceptance
tests/Conformance/client.phpupdated.- Documented context keys in the test file's docblock.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/Conformance/client.php and inspect the conformance runner to verify the exact context environment variable and JSON keys. Read the available Client\Builder methods, then trace the listed auth scenarios to wire their context; done means the file documents the keys and auth scenarios receive the required context for conformance validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100