Add pre-release example runner and fix examples it surfaced#153
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Add examples/run_all_examples.sh: a pre-release regression runner that boots the right server for each example (Python/Flask/fastmcp/npx MCP), waits for it to listen, runs each Ruby client with a timeout, judges PASS/FAIL from both the exit code and the output (most examples print ✅/❌ but always exit 0), then tears the server down and prints a summary. Secrets load from a gitignored examples/secrets.env (template: examples/secrets.env.example). Set ZAPIER_MCP_TOKEN there to run streamable_http_example.rb against Zapier via `Authorization: Bearer`. Fixes surfaced by running every example end-to-end: - json_input_mcp_servers_example.rb: drop the `browser_install` call — that tool was removed from @playwright/mcp; the browser now auto-launches on first navigation. - streamable_http_example.rb: call the first tool that needs no required arguments instead of blindly calling tools.first, which raised a ValidationError against servers whose first tool requires args. - gemini_ai_mcp.rb: default to gemini-2.5-flash and allow overriding via VERTEX_MODEL; the hardcoded gemini-2.0-flash-001 is retired for some Vertex projects (404 NOT_FOUND). .gitignore: ignore examples/secrets.env, .playwright-mcp/ (Playwright MCP session artifacts), and **/__pycache__/. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeNTP3mpe9RqF4FeScsv9R
4a2ebd7 to
235020c
Compare
….md) Add a "Running the Examples" section to README.md and a new examples/README.md index for the runner: prerequisites, the RUN_AI/RUN_NPX/PYTHON/TIMEOUT/LOG_DIR knobs, the gitignored examples/secrets.env flow (ZAPIER_MCP_TOKEN), and how PASS/FAIL is judged (exit code plus output scan, with the IGNORE_XMARK soft-check). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeNTP3mpe9RqF4FeScsv9R
- oauth_example.rb: authenticate to Zapier with an Authorization: Bearer header from ZAPIER_MCP_TOKEN (the URL ?token= form returns 401), and actually connect + list tools when the token is set; stay illustrative otherwise. - run_all_examples.sh: run oauth_example.rb against Zapier when ZAPIER_MCP_TOKEN is set; run the interactive oauth_browser_auth.rb only when RUN_OAUTH=1 and MCP_SERVER_URL are provided. Pin the elicitation streamable test to MCP_SERVER_URL=http://localhost:8000 so an ngrok URL inherited from secrets.env (via set -a) can no longer redirect it. - secrets.env.example: document MCP_SERVER_URL + the RUN_OAUTH opt-in. - README.md / examples/README.md: document the above. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeNTP3mpe9RqF4FeScsv9R
Merged
simonx1
added a commit
that referenced
this pull request
Jul 4, 2026
## Release 1.1.0 Bumps `MCPClient::VERSION` to **1.1.0** and finalizes `CHANGELOG.md` for everything merged since 1.0.1. (Gemfile.lock reflects the version bump.) ### Highlights **Breaking** - Tasks API rewritten to conform to MCP 2025-11-25 (`create_task` removed → `call_tool_as_task`; `Task` fields/statuses renamed; `get_task`/`cancel_task` now send `taskId`). See the changelog for the full migration notes. (#152) **New** - Task-augmented `tools/call`: `call_tool_as_task`, `get_task_result`, `list_tasks`, tool-level task negotiation, and `notifications/tasks/status` handling (#152) - Automatic pagination for `list_tools` / `list_prompts` (auto-follows `nextCursor`) (#148) **Bug fixes** - Tool annotation defaults per MCP 2025-11-25 (#140) · ping response (#141) · stdio stderr-drain deadlock (#142) · `notifications/initialized` lifecycle (#143) · stdio pending-response memory leak (#144) · logger formatter (#145) · `base64` runtime dep for Ruby 3.4+ (#146) · non-idempotent retry safety (#149) · SSE auto-reconnect (#150) · RFC 8414/9728 OAuth discovery (#151) **Examples & tooling** - `examples/run_all_examples.sh` pre-release runner + `examples/README.md`; fixes to `json_input`, `streamable_http`, `gemini`, and the Zapier/OAuth examples via a gitignored `examples/secrets.env` (#153) ### Verification - Full suite: **1320 examples, 0 failures** - RuboCop: clean (110 files) - `gem build` produces `ruby-mcp-client-1.1.0.gem` After merge: tag `1.1.0` and publish the gem / GitHub release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KeNTP3mpe9RqF4FeScsv9R Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a pre-release example regression runner and fixes the examples it surfaced as broken/stale, so everything under
examples/can be exercised in one command before cutting a release.examples/run_all_examples.shFor each example it boots the right server (Python / Flask / fastmcp, or an npx MCP server), waits for the port to listen, runs the Ruby client with a timeout, and judges PASS/FAIL from the exit code and the output — most examples print ✅/❌ but always exit 0, so output scanning is required. It prints a grouped summary and logs to a fresh temp dir (nothing written into the repo).
RUN_AI=0skips the paid-LLM examples;RUN_NPX=0skips the npx-based ones.examples/secrets.env(template committed asexamples/secrets.env.example). SetZAPIER_MCP_TOKENthere to runstreamable_http_example.rbagainst Zapier viaAuthorization: Bearer <token>.Example fixes surfaced by running them
json_input_mcp_servers_example.rbbrowser_install, removed from current@playwright/mcp→ToolNotFoundstreamable_http_example.rbtools.firstwith{}→ValidationErrorwhen the first tool requires argsgemini_ai_mcp.rbgemini-2.0-flash-001, retired for some Vertex projects →404 NOT_FOUNDgemini-2.5-flash, overridable viaVERTEX_MODEL.gitignore: ignoreexamples/secrets.env,.playwright-mcp/(Playwright MCP session artifacts), and**/__pycache__/.Verification
Every runnable example was executed end-to-end:
json_input(fixed);ruby_anthropic_mcp;ruby_llm_mcp;ruby_openai_mcp;gemini_ai_mcp(fixed,gemini-2.5-flash); andstreamable_http_example→ Zapier (live,Authorization: Bearer).tasks_example(needs a task-capable remote HTTP MCP server),oauth_browser_auth(interactive browser OAuth),oauth_example(illustrative placeholder).openai_ruby_mcp.rbleft unchanged — pre-existingopenaivsruby-openaigem-name conflict, intentionally out of scope.No changes to
lib/— the library itself passed every example.🤖 Generated with Claude Code
https://claude.ai/code/session_01KeNTP3mpe9RqF4FeScsv9R