MCP SDK for Ruby 1.4.0
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
2prompts
- Ruby 4.0124 lines · 4.3K tokens
- MCP SDK for Ruby 1.4.075 lines · 3.5K tokens
Total199 lines · 7.8K tokens
CWE Coverage
- 20
- 23
- 59
- 74
- 78
- 79
- 89
- 95
- 117
- 122
- 134
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 327
- 338
- 346
- 347
- 362
- 367
- 378
- 409
- 416
- 426
- 470
- 502
- 522
- 524
- 532
- 613
- 639
- 770
- 772
- 807
- 829
- 841
- 862
- 863
- 915
- 916
- 918
- 923
- 1333
- 1395
Prompt Preview
Apply the Ruby 4.0 baseline first. These rules cover the mcp gem at 1.4.0 on Ruby 4.0, including its clients, servers, stdio, and Streamable HTTP transports. The gem's Ruby >= 2.7 installation requirement does not establish that an older Ruby runtime still receives security fixes.
Protocol and exposed operations
- Call
MCP::Client#connectbefore using a client. Its default negotiation probesserver/discoverfor the sessionless2026-07-28lifecycle and can fall back to a legacy handshake; requiremode: :modernwhen application policy forbids that fallback. - Treat
MCP::Configuration#protocol_versionas a legacy-handshake pin only. It accepts2025-11-25,2025-06-18,2025-03-26, or2024-11-05; it does not disable modern requests. Enforce any narrower version policy at the endpoint, including requests that arrive without prior discovery or initialization. - Register only necessary tools, prompts, resources, and
define_custom_methodhandlers. Authorize each operation and its target before executing it; hiding an item from a list or advertising a capability does not enforce access control. - Treat peer instructions, descriptions, annotations, prompts, resources, and tool results as untrusted data. Enforce approval policy for destructive or privileged tool actions independently of
read_only_hint,destructive_hint, andidempotent_hint.
Authentication and request identity
- Authenticate every protected HTTP request before
StreamableHTTPTransport#callor#handle_request, covering POST, GET, DELETE, discovery, and both protocol lifecycles.