MCPBlox is a programmable proxy for MCP servers that enables transformation through natural language commands. Modify tools, hide outputs, and compose new synthetic tools without touching the original server. Effortlessly streamline workflows and enhance server interactions with this innovative solution.
mcpblox is a versatile and programmable proxy for any existing Model Context Protocol (MCP) server, allowing users to reshape and enhance server tools through natural language prompts. This project enables seamless manipulation of MCP servers without modifying the original setup, empowering developers and users to customize their interaction with the MCP tools effectively.
At its core, mcpblox connects to an upstream MCP server to discover available tools, processes transform prompts, and generates a tailored transform plan using an LLM (Large Language Model). The plan dictates how tools should be modified, hidden, or combined into new synthetic tools. The execution environment for the generated code is securely sandboxed to prevent any unintended access to filesystem or network resources, ensuring safety while manipulating data.
Here’s a glimpse of how mcpblox can be used effectively:
# Proxy an MCP server unchanged (transparent pass-through)
mcpblox --upstream "npx @modelcontextprotocol/server-filesystem /tmp" --api-key $ANTHROPIC_API_KEY
# Preview transformations without starting the server
mcpblox \
--upstream "npx @modelcontextprotocol/server-filesystem /tmp" \
--prompt "Rename read_file to cat and hide write_file" \
--api-key $ANTHROPIC_API_KEY \
--dry-run
# Implement transformations on-the-fly
mcpblox \
--upstream "npx @modelcontextprotocol/server-filesystem /tmp" \
--prompt "Rename read_file to cat and hide write_file" \
--api-key $ANTHROPIC_API_KEY
# Chain transformations using Unix pipes
mcpblox --upstream "npx @modelcontextprotocol/server-filesystem /tmp" --prompt "Hide write_file" \
| mcpblox --prompt "Rename read_file to cat" \
| mcpblox --prompt "Format outputs as markdown"
Transforms are cached for improved performance. If the same prompt and tool schemas are used in subsequent calls, mcpblox skips the LLM processing, allowing for quicker responses. Users can manage cache settings through command flags to fit their workflow requirements.
mcpblox runs LLM-generated code in a secured Node.js virtual machine context, ensuring limited access to system resources and maintaining integrity during execution. It is designed to execute safely within trusted user contexts, though caution should be exercised when dealing with untrusted inputs.
With mcpblox, developers can leverage the power of natural language processing to efficiently customize and enhance their interactions with MCP servers, making it a valuable tool for creating adapted and user-friendly interfaces.
No comments yet.
Sign in to be the first to comment.