Conversation
MCP::ServerDiscovery.select(query, from:, threshold:) scores each server's name+description against the user query and returns only the relevant subset. mcp_discovery: true on Robot enables automatic filtering before the first MCP connection. MCP::Server gains a :description field. Falls back to all servers when no descriptions are present, the classifier gem is unavailable, the query is blank, or nothing scores above DEFAULT_THRESHOLD (0.05). 1081 tests, 0 failures, 98.39% coverage. Demo: examples/28_mcp_discovery.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MCP::ServerDiscovery— TF cosine similarity selection of MCP servers by query relevanceMCP::Servergains a:descriptionfield used as the topic text for scoringRobotgainsmcp_discovery: true— filters servers before the firstensure_mcp_clientscallWhat ships
lib/robot_lab/mcp/server_discovery.rbServerDiscoverymodulelib/robot_lab/mcp/server.rbdescriptionattr reader + constructor param +to_hlib/robot_lab/robot.rbmcp_discovery: falseconstructor param + run-time filter hooktest/robot_lab/mcp/server_discovery_test.rbexamples/28_mcp_discovery.rbdocs/guides/mcp-integration.mdexamples/README.mdimprovements.mdTest plan
bundle exec rake test→ 1081 runs, 0 failures, 0 errors, 0 skips, 98.39% coverageruby examples/28_mcp_discovery.rb— correct server selected for each query🤖 Generated with Claude Code