Skip to content

Make the five clients consistent (#269) - #290

Open
a-akimov wants to merge 1 commit into
mainfrom
fix/client-consistency
Open

a-akimov wants to merge 1 commit into
mainfrom
fix/client-consistency

Conversation

@a-akimov

@a-akimov a-akimov commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

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.

  • 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- / 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

How Has This Been Tested?

Locally.

Breaking Changes

N/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Co-Authored-By: Claude Opus 5.5

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
Copilot AI balanced review requested due to automatic review settings November 7, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@a-akimov a-akimov mentioned this pull request Nov 7, 2026
8 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants