Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 16, 2025

Summary

Adds include_tools and exclude_tools optional fields to MCPServer to allow filtering which tools are exposed from an MCP server. The filtering logic in hydrate_tool_definitions implements: include_tools as a whitelist, exclude_tools as a blacklist, with exclude taking precedence when a tool appears in both lists.

Review & Testing Checklist for Human

  • Verify the filtering logic in hydrate_tool_definitions correctly implements the precedence rule (exclude wins over include)
  • Test with a real MCP server to confirm filtering works end-to-end (unit tests mock the MCP calls)
  • Confirm the serialization format for include_tools/exclude_tools (JSON arrays) is compatible with the UI

Test Plan:

  1. Create an MCPServer with include_tools=["tool-a", "tool-b"] and verify only those tools are returned
  2. Create an MCPServer with exclude_tools=["tool-a"] and verify that tool is filtered out
  3. Create an MCPServer with a tool in both lists and verify it gets excluded

Notes

  • Serialization tests were updated to include the new include_tools and exclude_tools fields in expected outputs
  • 4 new unit tests cover: whitelist filtering, blacklist filtering, precedence rule, and no-filtering baseline
  • Added serialization test (test_serialize_node__tool_calling_node__mcp_server_with_tool_filtering) demonstrating how the fields serialize when populated with actual data (as JSON arrays)

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vincent0426 vincent0426 marked this pull request as ready for review December 16, 2025 19:01
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