Internal Release 0.5.2

Added
- Added stdio transport functionality.
Changed
- Added stdio details to the README.
This commit is contained in:
Topher Bullock 2025-04-11 18:01:45 -04:00
commit 6da8bfab1a

View file

@ -28,7 +28,7 @@ module ModelContextProtocol
@tools = tools.to_h { |t| [t.name_value, t] }
@prompts = prompts.to_h { |p| [p.name_value, p] }
@resources = resources
@resource_index = resources.index_by(&:uri)
@resource_index = index_resources_by_uri(resources)
@context = context
@configuration = ModelContextProtocol.configuration.merge(configuration)
@handlers = {
@ -205,5 +205,11 @@ module ModelContextProtocol
def report_exception(exception, context = {})
configuration.exception_reporter.call(exception, context)
end
def index_resources_by_uri(resources)
resources.each_with_object({}) do |resource, hash|
hash[resource.uri] = resource
end
end
end
end