Skip to content

Commit fabf732

Browse files
committed
READMEs: capture the server PID instead of relying on job control
`kill %1` assumes the server is the only background job; `SERVER_PID=$!` plus `kill "$SERVER_PID"` is the same one-line recipe but immune to whatever else the shell has running.
1 parent 707cbaa commit fabf732

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

examples/stories/bearer_auth/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ authorization server; see `../oauth/` for the full grant flow.
1515
```bash
1616
# start the bearer-gated server (real uvicorn on :8000)
1717
uv run python -m stories.bearer_auth.server --port 8000 &
18+
SERVER_PID=$!
1819

1920
# connect with the demo bearer token
2021
uv run python -m stories.bearer_auth.client --http http://127.0.0.1:8000/mcp
2122

2223
# lowlevel server variant — same port, so stop the first server
23-
kill %1
24+
kill "$SERVER_PID"
2425
uv run python -m stories.bearer_auth.server_lowlevel --port 8000 &
2526
uv run python -m stories.bearer_auth.client --http http://127.0.0.1:8000/mcp
2627
```

examples/stories/dual_era/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ stays era-agnostic.
1212
```bash
1313
# over HTTP — the same /mcp endpoint serves both eras
1414
uv run python -m stories.dual_era.server --http --port 8000 &
15+
SERVER_PID=$!
1516
uv run python -m stories.dual_era.client --http http://127.0.0.1:8000/mcp
1617

1718
# lowlevel server variant — same port, so stop the first server
18-
kill %1
19+
kill "$SERVER_PID"
1920
uv run python -m stories.dual_era.server_lowlevel --http --port 8000 &
2021
uv run python -m stories.dual_era.client --http http://127.0.0.1:8000/mcp
2122
```

examples/stories/legacy_routing/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ browser-based MCP clients need.
1717
```bash
1818
# HTTP only — the predicate is an HTTP-transport concern
1919
uv run python -m stories.legacy_routing.server --port 8000 &
20+
SERVER_PID=$!
2021
uv run python -m stories.legacy_routing.client --http http://127.0.0.1:8000/mcp
2122

2223
# lowlevel server variant — same port, so stop the first server
23-
kill %1
24+
kill "$SERVER_PID"
2425
uv run python -m stories.legacy_routing.server_lowlevel --port 8000 &
2526
uv run python -m stories.legacy_routing.client --http http://127.0.0.1:8000/mcp
2627
```

examples/stories/oauth_client_credentials/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ discovery → token POST → Bearer attachment automatically.
1111
```bash
1212
# start the server (real uvicorn on :8000 — auth is HTTP-only)
1313
uv run python -m stories.oauth_client_credentials.server --port 8000 &
14+
SERVER_PID=$!
1415
uv run python -m stories.oauth_client_credentials.client --http http://127.0.0.1:8000/mcp
1516

1617
# lowlevel server variant — same port, so stop the first server
17-
kill %1
18+
kill "$SERVER_PID"
1819
uv run python -m stories.oauth_client_credentials.server_lowlevel --port 8000 &
1920
uv run python -m stories.oauth_client_credentials.client --http http://127.0.0.1:8000/mcp
2021
```

examples/stories/reconnect/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ traffic and has `server_info` / `server_capabilities` available immediately.
1111
```bash
1212
# over HTTP — Streamable HTTP only; in-memory has no "round-trip" to skip
1313
uv run python -m stories.reconnect.server --http --port 8000 &
14+
SERVER_PID=$!
1415
uv run python -m stories.reconnect.client --http http://127.0.0.1:8000/mcp
1516

1617
# lowlevel server variant — same port, so stop the first server
17-
kill %1
18+
kill "$SERVER_PID"
1819
uv run python -m stories.reconnect.server_lowlevel --http --port 8000 &
1920
uv run python -m stories.reconnect.client --http http://127.0.0.1:8000/mcp
2021
```

examples/stories/stateless_legacy/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ wiring, no era flag. The client connects once per era and asserts the same
1313
```bash
1414
# start the server (real uvicorn on :8000)
1515
uv run python -m stories.stateless_legacy.server --port 8000 &
16+
SERVER_PID=$!
1617

1718
# connect once as a modern client and once as a legacy client
1819
uv run python -m stories.stateless_legacy.client --http http://127.0.0.1:8000/mcp
1920

2021
# lowlevel server variant — same port, so stop the first server
21-
kill %1
22+
kill "$SERVER_PID"
2223
uv run python -m stories.stateless_legacy.server_lowlevel --port 8000 &
2324
uv run python -m stories.stateless_legacy.client --http http://127.0.0.1:8000/mcp
2425
```

0 commit comments

Comments
 (0)