feat: add eryx wrap command for MCP server wrapping - #145
Draft
sd2k wants to merge 1 commit into
Draft
Conversation
Prior to this commit, eryx only exposed itself as an MCP server via `eryx serve`. There was no way to wrap other MCP servers behind a simplified meta-tool interface. This commit adds `eryx wrap`, which wraps one or more MCP servers and presents three meta-tools to LLM clients: `list_tools`, `call_tool`, and `execute_python`. This lets an LLM see 3 tools instead of N, and orchestrate across multiple servers via Python code in a single call. Key changes: - Add `call_tool()` method to Rust MCPManager for direct tool invocation with both dot notation (server.tool) and bracket notation (mcp["server"].tool) support - Extract `parse_tool_name()` and `mcp_result_to_value()` helpers - New `eryx/wrap.py` module with CLI parsing, server connection from inline commands (--), config files (--config), and IDE discovery (--mcp) - Add `wrap` subcommand dispatch in `__main__.py` - 14 integration tests covering all three meta-tools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
eryx wrap— a new CLI subcommand that wraps other MCP servers behind a simplified 3-tool meta-interface (list_tools,call_tool,execute_python)execute_pythoncall--), config files (--config), and IDE discovery (--mcp)Changes
crates/eryx-python/src/mcp.rs: Addcall_tool()pymethod to MCPManager with dot/bracket notation parsing, plusparse_tool_name()andmcp_result_to_value()helperscrates/eryx-python/python/eryx/wrap.py: New module with CLI parsing, multi-source server connection, and three FastMCP tool registrationscrates/eryx-python/python/eryx/__main__.py: Addwrapsubcommand dispatchcrates/eryx-python/tests/test_wrap.py: 14 integration tests covering tool discovery, list_tools filtering, call_tool routing, execute_python with MCP access, and custom server namesTesting
test_serve.pytests still pass (no regressions)cargo clippy -p eryx-python -- -D warningspasses clean🤖 Generated with Claude Code