Skip to content

feat: add eryx wrap command for MCP server wrapping - #145

Draft
sd2k wants to merge 1 commit into
mainfrom
feat/wrap-command
Draft

feat: add eryx wrap command for MCP server wrapping#145
sd2k wants to merge 1 commit into
mainfrom
feat/wrap-command

Conversation

@sd2k

@sd2k sd2k commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds eryx wrap — a new CLI subcommand that wraps other MCP servers behind a simplified 3-tool meta-interface (list_tools, call_tool, execute_python)
  • An LLM client sees 3 tools instead of N, and can orchestrate across multiple servers via Python code in a single execute_python call
  • Supports inline servers (--), config files (--config), and IDE discovery (--mcp)

Changes

  • crates/eryx-python/src/mcp.rs: Add call_tool() pymethod to MCPManager with dot/bracket notation parsing, plus parse_tool_name() and mcp_result_to_value() helpers
  • crates/eryx-python/python/eryx/wrap.py: New module with CLI parsing, multi-source server connection, and three FastMCP tool registrations
  • crates/eryx-python/python/eryx/__main__.py: Add wrap subcommand dispatch
  • crates/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 names

Testing

  • All 14 new tests pass locally
  • All 6 existing test_serve.py tests still pass (no regressions)
  • cargo clippy -p eryx-python -- -D warnings passes clean

🤖 Generated with Claude Code

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>
@sd2k sd2k closed this Feb 20, 2026
@sd2k sd2k reopened this Feb 20, 2026
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