Skip to content

Add resource_templates to MCP::Client#225

Open
sjrct wants to merge 3 commits intomodelcontextprotocol:mainfrom
sjrct:add-client-resource-templates
Open

Add resource_templates to MCP::Client#225
sjrct wants to merge 3 commits intomodelcontextprotocol:mainfrom
sjrct:add-client-resource-templates

Conversation

@sjrct
Copy link

@sjrct sjrct commented Feb 4, 2026

This adds support for querying resource templates to the MCP::Client

I also removed an unused require from logging_message_notification.rb

Motivation and Context

Prior there was no MCP::Client interface for listing resource templates

How Has This Been Tested?

I tested it with the following script with an mcp server I have:

require_relative 'lib/mcp'

transport = MCP::Client::HTTP.new(url: "http://localhost:8080/mcp")
client = MCP::Client.new(transport: transport)

templates = client.resource_templates

templates.each do |template|
  puts JSON.pretty_generate(template)
end

And added tests to test/mcp/client_test.rb

Breaking Changes

No breaking changes, just the new method

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@koic
Copy link
Member

koic commented Feb 5, 2026

Looks good to me. Can you squash your commits into one?

I also removed an unused require from logging_message_notification.rb

Good catch. This removal is outside the scope of the changes intended in this PR, so it would be better to split it into a separate PR if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants