Skip to content

Conversation

@binaryk
Copy link
Collaborator

@binaryk binaryk commented Oct 22, 2025

New Features:

  • Add configurable MCP mode (direct or wrapper) via RESTIFY_MCP_MODE env variable
  • Create 4 wrapper tools for progressive discovery:
    • discover-repositories: List all MCP-enabled repositories
    • get-repository-operations: Get operations for a specific repository
    • get-operation-details: Get detailed schema for an operation
    • execute-operation: Execute an operation with parameters

Architecture:

  • ToolRegistry service: Centralized registry for repository/operation metadata with caching
  • WrapperToolHelpers trait: Shared utilities for schema formatting and example generation
  • Multi-layer validation ensures only MCP-enabled repositories are accessible

Benefits:

  • Reduces tool count from 50+ to 4 wrapper tools (in wrapper mode)
  • Better token efficiency for AI agents
  • Progressive discovery improves exploration
  • Backward compatible via config (defaults to direct mode)
  • Static tools remain unaffected regardless of mode

Validation:

  • Only repositories with HasMcpTools trait are exposed
  • Each operation validates mcpAllows*() permissions
  • Clear error messages guide missing configuration

binaryk and others added 3 commits October 22, 2025 17:41
Implement a 4-tool wrapper system (inspired by Klavis MCP) that reduces MCP tool explosion by wrapping repository operations through progressive discovery.

**New Features:**
- Add configurable MCP mode (`direct` or `wrapper`) via `RESTIFY_MCP_MODE` env variable
- Create 4 wrapper tools for progressive discovery:
  - `discover-repositories`: List all MCP-enabled repositories
  - `get-repository-operations`: Get operations for a specific repository
  - `get-operation-details`: Get detailed schema for an operation
  - `execute-operation`: Execute an operation with parameters

**Architecture:**
- `ToolRegistry` service: Centralized registry for repository/operation metadata with caching
- `WrapperToolHelpers` trait: Shared utilities for schema formatting and example generation
- Multi-layer validation ensures only MCP-enabled repositories are accessible

**Benefits:**
- Reduces tool count from 50+ to 4 wrapper tools (in wrapper mode)
- Better token efficiency for AI agents
- Progressive discovery improves exploration
- Backward compatible via config (defaults to `direct` mode)
- Static tools remain unaffected regardless of mode

**Validation:**
- Only repositories with `HasMcpTools` trait are exposed
- Each operation validates `mcpAllows*()` permissions
- Clear error messages guide missing configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add WrapperToolsIntegrationTest covering all 4 wrapper tools and their functionality.

**Tests Added:**
- Wrapper mode exposes correct tools (4 wrapper + static tools)
- discover-repositories: Lists only MCP-enabled repositories
- discover-repositories: Search functionality works correctly
- get-repository-operations: Returns complete operations list
- get-repository-operations: Rejects non-MCP repositories with clear error
- get-operation-details: Returns schema with examples
- execute-operation: Creates records via wrapper (store operation)
- execute-operation: Lists records via wrapper (index operation)
- execute-operation: Validates operation permissions
- Complete workflow: Tests entire discover → operations → details → execute flow

**Coverage:**
- 10 test methods
- 74 assertions
- Tests all 4 wrapper tools
- Tests error handling and validation
- Tests end-to-end workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@binaryk binaryk merged commit c0f3c86 into 10.x Oct 22, 2025
14 of 17 checks passed
@binaryk binaryk deleted the feat/group-mcp-tools branch October 22, 2025 15:12
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.

1 participant