ruby-sdk/lib/mcp/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Koichi ITO 0c729d0a2d Use autoload to defer loading of unused subsystems
## Motivation and Context

`lib/mcp.rb` currently declares all `require_relative` statements in one place.
As a result, Server and Client are both loaded, the stdio and Streamable HTTP
transports are both loaded, and Tool, Prompt, and Resource are all loaded,
regardless of which components are actually used.

These components are selected by the user depending on their use case,
so loading everything upfront is unnecessary.

Using `autoload` for selected constants defers loading until the constant
is actually referenced, so only the subsystems required by the user are loaded.

## How Has This Been Tested?

All existing tests pass unchanged.

## Breaking Change

None. This change only defers loading of unused components.
2026-03-12 14:08:27 +09:00
..
transports Use autoload to defer loading of unused subsystems 2026-03-12 14:08:27 +09:00
capabilities.rb Extract server capabilities into dedicated Capabilities class 2025-06-04 22:52:16 +09:00
transports.rb Use autoload to defer loading of unused subsystems 2026-03-12 14:08:27 +09:00