Skip to content

Client polish and consistency #269

Closed

Description

@a-akimov

Problem

The clients differ in small things that readers will copy: how they identify themselves, how they launch a server, and how they handle unusual input. None of this breaks the demo, but it makes the five examples look like five different programs.

Tasks

  • Send explicit client info, mcp-client-<lang> / 1.0.0, from all five clients. Rust already does (Rust: negotiate 2026-07-28, call the Messages API directly, and bump rmcp to 3.4 #205). The others don't yet:
    • Python and Ruby pass nothing, so the SDK default is used.
    • Go sends version 0.1.0.
    • TypeScript sends the name mcp-client-cli.
  • Skip empty input. Python and TypeScript currently send "" to the API and get a 400.
  • Match quit after trimming whitespace and ignoring case, in every client. TypeScript doesn't trim.
  • Print usage errors to stderr and exit with status 1, in every client. TypeScript exits 0, and Python and Ruby print to stdout.
  • Run cleanup on Ctrl-C in Go, Rust and Ruby. In Ruby, rescue Interrupt, which isn't a StandardError. In Go, use signal.NotifyContext.
  • Use one way to launch the server. My recommendation is command + args in all five clients, as Go and Rust already do. That matches the claim that the client "connects to any stdio server". It also avoids a trap in TypeScript and Ruby: they launch .py files with bare python3, which doesn't work for the uv-managed Python server. If the file-path form stays instead, map .py to uv --directory ... run everywhere and support the same set of extensions in every client.
  • Add mcp-client-rust/.env.example, and make the Go placeholder match the others (an empty value).
  • Python: move import sys out of the __main__ block (client.py:176). main() already uses it at lines 155-157.
  • Python: mode="auto" is already the SDK default. Either remove it or add a comment saying it's set explicitly for teaching.
  • Choose one approach to tool caching. Python lists the tools again on every query, while the others cache them when they connect. Pick one and explain it in a comment.

Tool-result handling is covered separately in Clients: fix what goes into a tool_result.

Acceptance criteria

  • initialize from all five clients uses the same client-name pattern and version.
  • ./tests/smoke-test.sh passes, and the launch command documented in each README works as written.

Activity

  1. added
    enhancement
    javascript
    rust
    python:uv
    go
    ruby
    on Nov 1, 2026
  2. self-assigned this
    on Nov 1, 2026
  3. added a commit that references this issue on Nov 11, 2026
  4. a-akimov commented on Nov 15, 2026

    @a-akimov
    ContributorAuthor

    Closing: #290 did everything here except Ctrl-C. Testing that part showed the clients are less consistent than this issue assumed (Python hangs at the prompt, and TypeScript waits out a pending query), and it raised the question of how much Ctrl-C handling a quickstart should have.

    That's now tracked in #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgojavascriptpython:uvrubyrust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions