Skip to content

Commit 9e1a9ab

Browse files
committed
docs: fix script cmds and unnecessary content
1 parent 87288eb commit 9e1a9ab

File tree

4 files changed

+59
-31
lines changed

4 files changed

+59
-31
lines changed

docs/authorization-multiprotocol.md

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -465,39 +465,68 @@ See `RequireAuthMiddleware` and PRM handler in `mcp.server.auth` for how these a
465465

466466
## 4. Integration test examples
467467

468-
### 4.1 Phase 2: Multi-protocol (API Key, OAuth, mTLS placeholder)
468+
### 4.1 Multi-protocol (API Key, OAuth, mTLS placeholder)
469469

470-
**Script:** `./scripts/run_phase2_multiprotocol_integration_test.sh` (from repo root).
470+
**Script:** `./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
471471

472-
**Behavior:**
472+
**Quick start (from repo root):**
473473

474-
- Starts the multi-protocol resource server (`simple-auth-multiprotocol-rs`) on port 8002 with `--api-keys=demo-api-key-12345`. For OAuth, also starts the AS (`simple-auth-as`) on port 9000.
475-
- Waits for PRM: `GET http://localhost:8002/.well-known/oauth-protected-resource/mcp`.
476-
- Runs the client based on `MCP_AUTH_PROTOCOL`:
477-
- **api_key** (default): `simple-auth-multiprotocol-client` with `MCP_SERVER_URL=http://localhost:8002/mcp` and `MCP_API_KEY=demo-api-key-12345`. No AS is required.
478-
- **oauth**: `simple-auth-client` against the same RS; the user completes OAuth in the browser, then runs `list`, `call get_time {}`, `quit`.
479-
- **mutual_tls**: the same multiprotocol client without an API key; mTLS is a placeholder (no real client certificate validation).
474+
```bash
475+
# API Key (non-interactive, default)
476+
./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh
477+
478+
# OAuth (interactive — complete authorization in browser)
479+
MCP_AUTH_PROTOCOL=oauth ./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh
480+
481+
# Mutual TLS placeholder (expect "not implemented" error)
482+
MCP_AUTH_PROTOCOL=mutual_tls ./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh
483+
```
484+
485+
The script starts the multi-protocol RS on port 8002 (and AS on 9000 for OAuth), waits for PRM readiness, then runs the client with the selected protocol. For `api_key` and `mutual_tls`, the script is fully automated and prints PASS/FAIL. For `oauth`, the user completes OAuth in the browser, then runs `list`, `call get_time {}`, `quit`.
486+
487+
**Env variables:** `MCP_RS_PORT` (default 8002), `MCP_AS_PORT` (default 9000), `MCP_AUTH_PROTOCOL` (default `api_key`), `MCP_SKIP_OAUTH=1` (skip manual OAuth test).
480488

481489
**Demonstrates:** PRM and optional unified discovery, protocol selection (API Key vs OAuth), and API Key authentication without an AS.
482490

483-
### 4.2 Phase 4: DPoP integration
491+
### 4.2 DPoP integration
492+
493+
**Script:** `./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh`
494+
495+
**Quick start (from repo root):**
496+
497+
```bash
498+
# Automated tests only (no browser)
499+
MCP_SKIP_OAUTH=1 ./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh
484500

485-
**Script:** `./scripts/run_phase4_dpop_integration_test.sh` (from repo root).
501+
# Full test including manual OAuth+DPoP (requires browser)
502+
./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh
503+
```
504+
505+
The script starts AS on port 9000 and RS on port 8002 with `--dpop-enabled`, then runs automated curl tests:
486506

487-
**Behavior:**
507+
- API Key request → 200 (DPoP does not affect API Key).
508+
- Bearer token without DPoP proof → 401 (RS requires DPoP when token is DPoP-bound).
509+
- Negative: fake token, wrong htm/htu, DPoP without Authorization → 401.
488510

489-
- Starts AS on 9000 and RS on 8002 with `--dpop-enabled` and an API key.
490-
- Runs **automated** curl tests:
491-
- **B2:** API Key request → 200 (DPoP does not affect API Key).
492-
- **A2:** Bearer token without DPoP proof → 401 (RS requires DPoP when token is DPoP-bound).
493-
- Negative: fake token, wrong htm/htu, DPoP without Authorization → 401.
494-
- Optionally runs a **manual** OAuth+DPoP client test: `MCP_USE_OAUTH=1 MCP_DPOP_ENABLED=1` with the multiprotocol client; the user completes OAuth in the browser, then runs `list`, `call get_time {}`, `quit`. Server logs should show "Authentication successful with DPoP".
511+
When `MCP_SKIP_OAUTH` is not set, the script also runs a manual OAuth+DPoP client test: the user completes OAuth in the browser, then runs `list`, `call get_time {}`, `quit`. Server logs should show "Authentication successful with DPoP".
495512

496-
**Env:** `MCP_SKIP_OAUTH=1` skips the manual client step and runs only the automated curl tests.
513+
**Env variables:** `MCP_RS_PORT` (default 8002), `MCP_AS_PORT` (default 9000), `MCP_SKIP_OAUTH=1` (skip manual OAuth+DPoP test).
497514

498515
**Demonstrates:** DPoP proof verification on the server, rejection of Bearer tokens without a proof when DPoP is required, and a successful OAuth+DPoP flow with the example client.
499516

500-
### 4.3 Test matrix (reference)
517+
### 4.3 OAuth2 backward compatibility
518+
519+
**Script:** `./examples/clients/simple-auth-multiprotocol-client/run_oauth2_test.sh`
520+
521+
**Quick start (from repo root):**
522+
523+
```bash
524+
./examples/clients/simple-auth-multiprotocol-client/run_oauth2_test.sh
525+
```
526+
527+
Starts the `simple-auth` AS and RS (OAuth-only, no multi-protocol), then runs `simple-auth-client`. The user completes OAuth in the browser, then runs `list`, `call get_time {}`, `quit`. Verifies that the existing OAuth-only path still works unchanged.
528+
529+
### 4.4 Test matrix (reference)
501530

502531
| Case | Auth type | Expected result |
503532
|------|------------------|-----------------|

examples/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ for real-world servers.
1111
### API Key
1212

1313
- Use `MCP_API_KEY` on the client; start RS with `--api-keys=...` (no AS required).
14-
- One-command test (from repo root): `MCP_AUTH_PROTOCOL=api_key ./scripts/run_phase2_multiprotocol_integration_test.sh`
14+
- One-command test (from repo root): `./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
1515

1616
### OAuth + DPoP
1717

1818
- Start AS and RS with `--dpop-enabled`; client: `MCP_USE_OAUTH=1 MCP_DPOP_ENABLED=1`.
19-
- One-command test (from repo root): `./scripts/run_phase4_dpop_integration_test.sh` (use `MCP_SKIP_OAUTH=1` to skip manual OAuth step).
19+
- One-command test (from repo root): `./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh` (use `MCP_SKIP_OAUTH=1` to skip manual OAuth step).
2020

2121
### Mutual TLS (placeholder)
2222

23-
- mTLS is a placeholder (no client cert validation). Script: `MCP_AUTH_PROTOCOL=mutual_tls ./scripts/run_phase2_multiprotocol_integration_test.sh`
24-
- mTLS is a placeholder (no client cert validation). Script: `MCP_AUTH_PROTOCOL=mutual_tls ./scripts/run_phase2_multiprotocol_integration_test.sh`
23+
- mTLS is a placeholder (no client cert validation). Script: `MCP_AUTH_PROTOCOL=mutual_tls ./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
2524

2625
**Client**: [simple-auth-multiprotocol-client](clients/simple-auth-multiprotocol-client/) — supports API Key (`MCP_API_KEY`), OAuth+DPoP (`MCP_USE_OAUTH=1`, `MCP_DPOP_ENABLED=1`), and mTLS placeholder.

examples/clients/simple-auth-multiprotocol-client/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ MCP_SERVER_URL=http://localhost:8002/mcp MCP_API_KEY=demo-api-key-12345 uv run m
2626
```
2727

2828
**One-command test** from repo root:
29-
`MCP_AUTH_PROTOCOL=api_key ./scripts/run_phase2_multiprotocol_integration_test.sh`
29+
`./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
3030
starts the resource server and this client with API Key; at `mcp>` run `list`, `call get_time {}`, `quit`.
3131

3232
## Running with OAuth + DPoP
@@ -45,16 +45,16 @@ MCP_SERVER_URL=http://localhost:8002/mcp MCP_USE_OAUTH=1 MCP_DPOP_ENABLED=1 uv r
4545
Complete OAuth in the browser; then at `mcp>` run `list`, `call get_time {}`, `quit`. Server logs should show "Authentication successful with DPoP".
4646

4747
**One-command test** from repo root:
48-
`./scripts/run_phase4_dpop_integration_test.sh` — starts AS and RS with DPoP, then runs this client (OAuth+DPoP). Use `MCP_SKIP_OAUTH=1` to run only the automated curl tests and skip the manual client step.
48+
`./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh` — starts AS and RS with DPoP, then runs this client (OAuth+DPoP). Use `MCP_SKIP_OAUTH=1` to run only the automated curl tests and skip the manual client step.
4949

5050
## Running with Mutual TLS (placeholder)
5151

5252
Mutual TLS is a **placeholder** in this example: the client registers the `mutual_tls` protocol but does **not** perform client certificate authentication. Selecting mTLS will show a "not implemented" style message.
5353

54-
- **`MCP_AUTH_PROTOCOL=mutual_tls`** (with the phase2 script) runs this client in mTLS mode; the client will start but mTLS auth is not implemented.
54+
- **`MCP_AUTH_PROTOCOL=mutual_tls`** runs this client in mTLS mode; the client will start but mTLS auth is not implemented.
5555

5656
**One-command test** from repo root:
57-
`MCP_AUTH_PROTOCOL=mutual_tls ./scripts/run_phase2_multiprotocol_integration_test.sh`
57+
`MCP_AUTH_PROTOCOL=mutual_tls ./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
5858

5959
## Commands
6060

examples/servers/simple-auth-multiprotocol/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can run the Resource Server **without** the Authorization Server when using
3838
3. At the `mcp>` prompt, run `list`, `call get_time {}`, then `quit`.
3939

4040
**One-command verification** (from repo root):
41-
`MCP_AUTH_PROTOCOL=api_key ./scripts/run_phase2_multiprotocol_integration_test.sh`
41+
`./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
4242
This starts the RS, then the client with API Key; complete the session with `list`, `call get_time {}`, `quit`.
4343

4444
## Running with DPoP (OAuth + DPoP)
@@ -63,15 +63,15 @@ DPoP (Demonstrating Proof-of-Possession, RFC 9449) binds the access token to a c
6363
Complete OAuth in the browser, then at `mcp>` run `list`, `call get_time {}`, `quit`. Server logs should show "Authentication successful with DPoP".
6464

6565
**One-command verification** (from repo root):
66-
`./scripts/run_phase4_dpop_integration_test.sh` — starts AS and RS (with `--dpop-enabled`), runs automated DPoP tests, then optionally the OAuth+DPoP client (use `MCP_SKIP_OAUTH=1` to skip the manual OAuth step).
66+
`./examples/clients/simple-auth-multiprotocol-client/run_dpop_test.sh` — starts AS and RS (with `--dpop-enabled`), runs automated DPoP tests, then optionally the OAuth+DPoP client (use `MCP_SKIP_OAUTH=1` to skip the manual OAuth step).
6767

6868
## Running with Mutual TLS (placeholder)
6969

7070
Mutual TLS is a **placeholder** in this example: the server accepts the `mutual_tls` protocol in PRM/discovery but does **not** perform client certificate validation. Selecting mTLS in the client will show a "not implemented" style message.
7171

7272
- **Server**: No extra flags; `auth_protocols` already includes `mutual_tls`.
7373
- **Client** (from repo root):
74-
`MCP_AUTH_PROTOCOL=mutual_tls ./scripts/run_phase2_multiprotocol_integration_test.sh`
74+
`MCP_AUTH_PROTOCOL=mutual_tls ./examples/clients/simple-auth-multiprotocol-client/run_multiprotocol_test.sh`
7575
The client will start but mTLS authentication is not implemented in this example.
7676

7777
## Options

0 commit comments

Comments
 (0)