Fix Resource::Embedded not setting @resource in initialize

The `initialize` method was missing the assignment of `@resource`,
causing the resource method to always return `nil` and `to_h` to return
an incorrect hash with an empty resource value.

Added comprehensive tests to verify the fix and prevent regression.
This commit is contained in:
Koichi ITO 2026-01-26 01:17:04 +09:00
commit 05c0119e53

View file

@ -6,6 +6,7 @@ module MCP
attr_reader :resource, :annotations
def initialize(resource:, annotations: nil)
@resource = resource
@annotations = annotations
end