[Client] Extend conformance client.php with scenario context env vars

Open
#329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php

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.

Description

auth Client enhancement

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_CONTEXT as JSON).
  • For each scenario, wire context into Client\Builder:
    • auth/pre-registrationsetOAuthClient(client_id, client_secret).
    • auth/client-credentials-basicsetOAuthClient(...) + force client_credentials grant.
    • auth/client-credentials-jwtsetOAuthClientWithKey(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.php updated.
  • Documented context keys in the test file's docblock.
Dominant language
PHP
Stars
1.6k
Forks
173
Avg merge
2d 49m
Merged PRs (30d)
23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/php-sdk

All issues in modelcontextprotocol/php-sdk

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.