Commit a3a3026
committed
[Doc] Update Ruby client example to use explicit connect
## Motivation and Context
Follow-up to modelcontextprotocol/ruby-sdk#336 and
modelcontextprotocol/quickstart-resources#133.
The Ruby example in `docs/docs/develop/build-client.mdx` constructed `MCP::Client`
with a stdio transport and immediately called `client.tools`, relying on the implicit
`initialize_session` that the stdio transport performed on the first request.
ruby-sdk PR modelcontextprotocol#336 added `MCP::Client#connect` for the stdio transport so that
the explicit `initialize` plus `notifications/initialized` handshake is exposed
at the public API level, matching the Python SDK (`ClientSession.initialize()`)
and the TypeScript SDK (`Client.connect(transport)`). The implicit-init path is
preserved as a backwards-compatible shim, but new code is expected to call `connect` explicitly.
This change updates the Ruby example so readers learn the explicit `@mcp_client.connect`
pattern from the start, consistent with how the Python and TypeScript examples present
the handshake.
## How Has This Been Tested?
- Re-read the surrounding `connect_to_server` example in
`docs/docs/develop/build-client.mdx` to confirm `@mcp_client.connect`
fits naturally between the client construction and the subsequent
`@mcp_client.tools` call.
- Ran `npm run prep` to confirm there are no documentation warnings or
errors introduced by the change.
## Breaking Changes
None. This is a documentation-only change that adds a single explicit `connect` call to
the Ruby client example. No schema, navigation, or runtime behavior is affected.1 parent 8bf5b7d commit a3a3026
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1791 | 1791 | | |
1792 | 1792 | | |
1793 | 1793 | | |
| 1794 | + | |
1794 | 1795 | | |
1795 | 1796 | | |
1796 | 1797 | | |
| |||
0 commit comments