Repository navigation
Make the five clients consistent (#269) - #290
Conversation
All clients now take the server as a command plus its arguments, and identify themselves and report usage errors the same way. - Launching: pass the command that starts the server and its arguments, as Go and Rust already did. TypeScript and Ruby no longer start .py servers with bare python3, which failed for the uv-managed Python server - Client info: every client sends mcp-client-<lang> / 1.0.0 - Usage errors: printed to stderr, exit status 1 - Tools: listed once at connect time in every client (Python listed them again on each query) - Python: import sys at the top, drop the unused pathlib import - .env.example: add the missing Rust one, empty Go placeholder - Tests: the mock server rejects clients that don't send the expected client info, the smoke test launches it as a command and checks the usage error - READMEs: run commands updated for the command-plus-args form
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the changes standardizing launch commands, client identity, and usage-error handling across the five tutorial clients.
No open issues 🎉
What changed in this PR
This PR advances #269 by aligning launch commands, client identification, and usage-error handling across the five tutorial clients. Ctrl+C cleanup remains outside this PR’s scope.
Changes:
- Standardizes command-plus-arguments launching, client names and versions, and usage errors.
- Caches Python and Ruby tool lists at connection time and aligns environment-file placeholders.
- Updates launch documentation and extends smoke checks to validate usage errors and client identity.
| File | Description |
|---|---|
| weather-server-typescript/README.md | Adds the explicit server interpreter to the launch example. |
| weather-server-ruby/README.md | Adds the explicit Ruby command to the launch example. |
| weather-server-python/README.md | Documents launching the server through uv. |
| weather-server-go/README.md | Uses go run . for the client. |
| tests/smoke-test.sh | Checks usage errors and passes explicit mock-server commands. |
| tests/README.md | Updates the tool-loop test invocation. |
| tests/helpers/mock-mcp-server.ts | Validates client names and version. |
| README.md | Documents uniform command-plus-arguments launching. |
| mcp-client-typescript/README.md | Updates server launch instructions. |
| mcp-client-typescript/index.ts | Aligns launching, client identity, and usage-error handling. |
| mcp-client-rust/src/main.rs | Aligns usage text and documents existing tool caching. |
| mcp-client-rust/.env.example | Adds an empty API-key placeholder. |
| mcp-client-ruby/README.md | Updates server launch instructions. |
| mcp-client-ruby/client.rb | Aligns launching and identity, caches tools, and sends errors to stderr. |
| mcp-client-python/README.md | Updates Python and TypeScript server launch examples. |
| mcp-client-python/client.py | Aligns launching and identity, caches tools, and updates usage handling. |
| mcp-client-go/README.md | Uses go run . in launch examples. |
| mcp-client-go/main.go | Aligns client version and usage text; documents existing tool caching. |
| mcp-client-go/.env.example | Clears the API-key placeholder value. |
Review effort: Balanced
olaservo
left a comment
There was a problem hiding this comment.
All five clients now take the server as a command plus arguments, send mcp-client-<language> 1.0.0, list tools once at connect time, and put usage errors on stderr with exit 1. The mock server enforcing the client info and the new check_usage step in the smoke test keep that from drifting. I scanned the branch for leftover references to the old script-path form and found none, the five .env.example files match, and the Python SDK docs confirm mode="auto" is the default, so the updated comment is right. CI is green. Merging.
Generated by Claude Code
Motivation and Context
Partially closing #269 (except for Ctrl+C)
All clients now take the server as a command plus its arguments, and identify themselves and report usage errors the same way.
How Has This Been Tested?
Locally.
Breaking Changes
N/a
Types of changes
Checklist
Additional context
Co-Authored-By: Claude Opus 5.5