MCP SDK for Ruby 1.4.0

Last reviewed Sep 24, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Ruby 4.0124 lines · 4.3K tokens
  2. 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#connect before using a client. Its default negotiation probes server/discover for the sessionless 2026-07-28 lifecycle and can fall back to a legacy handshake; require mode: :modern when application policy forbids that fallback.
  • Treat MCP::Configuration#protocol_version as a legacy-handshake pin only. It accepts 2025-11-25, 2025-06-18, 2025-03-26, or 2024-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_method handlers. 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, and idempotent_hint.

Authentication and request identity

  • Authenticate every protected HTTP request before StreamableHTTPTransport#call or #handle_request, covering POST, GET, DELETE, discovery, and both protocol lifecycles.