Skip to content

Add pre-release example runner and fix examples it surfaced#153

Merged
simonx1 merged 3 commits into
mainfrom
examples/regression-runner-and-fixes
Jul 4, 2026
Merged

Add pre-release example runner and fix examples it surfaced#153
simonx1 merged 3 commits into
mainfrom
examples/regression-runner-and-fixes

Conversation

@simonx1

@simonx1 simonx1 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

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.sh

For 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=0 skips the paid-LLM examples; RUN_NPX=0 skips the npx-based ones.
  • Secrets load from a gitignored examples/secrets.env (template committed as examples/secrets.env.example). Set ZAPIER_MCP_TOKEN there to run streamable_http_example.rb against Zapier via Authorization: Bearer <token>.

Example fixes surfaced by running them

Example Problem Fix
json_input_mcp_servers_example.rb Called browser_install, removed from current @playwright/mcpToolNotFound Drop it; the browser auto-launches on first navigation
streamable_http_example.rb Called tools.first with {}ValidationError when the first tool requires args Pick the first tool that needs no required arguments
gemini_ai_mcp.rb Hardcoded gemini-2.0-flash-001, retired for some Vertex projects → 404 NOT_FOUND Default gemini-2.5-flash, overridable via VERTEX_MODEL

.gitignore: ignore examples/secrets.env, .playwright-mcp/ (Playwright MCP session artifacts), and **/__pycache__/.

Verification

Every runnable example was executed end-to-end:

  • 14 PASS — all stdio / SSE / streamable / elicitation examples; json_input (fixed); ruby_anthropic_mcp; ruby_llm_mcp; ruby_openai_mcp; gemini_ai_mcp (fixed, gemini-2.5-flash); and streamable_http_example → Zapier (live, Authorization: Bearer).
  • Skipstasks_example (needs a task-capable remote HTTP MCP server), oauth_browser_auth (interactive browser OAuth), oauth_example (illustrative placeholder).
  • openai_ruby_mcp.rb left unchanged — pre-existing openai vs ruby-openai gem-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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

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
@simonx1 simonx1 force-pushed the examples/regression-runner-and-fixes branch from 4a2ebd7 to 235020c Compare July 4, 2026 11:05
simonx1 and others added 2 commits July 4, 2026 13:47
….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
@simonx1 simonx1 merged commit 49fc89b into main Jul 4, 2026
3 checks passed
@simonx1 simonx1 mentioned this pull request Jul 4, 2026
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]>
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.

1 participant