mcp-sandbox
Turn any JavaScript module into a sandboxed MCP (Model Context Protocol) server with automatic reflection and type inference.
claude mcp add --transport stdio rocket-connect-mcp-sandbox npx -y @mcp-sandbox/cli start ./path/to/your-module.js
How to use
MCP Sandbox automatically converts a JavaScript module into an MCP (Model Context Protocol) server. It analyzes the module to reflect available functions, infers parameter types, and exposes the functions as MCP tools with endpoints for JSON-RPC, REST, and Server-Sent Events. You can start the server via the provided CLI and then interact with the generated MCP endpoints to discover tools, execute them, and retrieve an MCP configuration file. The server exposes a JSON-RPC endpoint at /mcp/jsonrpc, a REST tool explorer at /tools, and a separate /mcp-config endpoint for the generated configuration. Use the MCP Inspector as needed to test streams and tool calls through the configured transport. Tools are discovered automatically with names and docstrings derived from the module, and you can call them with the appropriate arguments via the REST or JSON-RPC interfaces.
How to install
Prerequisites
- Node.js and npm (or pnpm) installed on your machine
- Access to install global CLI or use npx to run the CLI
Install options
-
Global CLI installation (recommended for persistent access)
- npm install -g @mcp-sandbox/cli
- Then start a module server with: mcp-sandbox start ./path/to/your-module.js
-
Use via npx (no global install required)
- npx -y @mcp-sandbox/cli start ./path/to/your-module.js
-
In a project (local usage)
- npm install @mcp-sandbox/core @mcp-sandbox/cli
- Use the CLI locally: npx @mcp-sandbox/cli start ./path/to/your-module.js
Notes
- Replace ./path/to/your-module.js with the actual module you want to expose. The module should export functions you want accessible via MCP.
- Ensure your module’s functions have clear JSDoc comments and sensible default parameters to improve reflection and type inference.
Additional notes
Tips and common issues:
- Port conflicts: The server defaults to port 3000. If you have another service on that port, specify a different port via the CLI options (e.g., mcp-sandbox start ./module.js --port 4000).
- Timeouts and memory: Adjust the execution timeout and memory limits if your functions are heavy or long-running. Use the CLI or programmatic options to configure these values.
- Security: VM isolation helps, but avoid exposing sensitive operations. Use restricted modules and validate inputs; rely on the sandbox’s input validation and controlled requires.
- MCP Inspector: For testing with the inspector, point it to http://localhost:3000/mcp/jsonrpc and use the Streamable HTTP transport.
- Configuration file: The server can emit an mcp-config.json which clients can consume to integrate with your MCP ecosystem.
Related MCP Servers
neurolink
Universal AI Development Platform with MCP server integration, multi-provider support, and professional CLI. Build, test, and deploy AI applications with multiple ai providers.
lc2mcp
Convert LangChain tools to FastMCP tools
evernote
Evernote MCP server - allows LLMs that support MCP (like Claude Desktop) to query your notes in Evernote
IoT-Edge
MCP server for Industrial IoT, SCADA and PLC systems. Unifies MQTT sensors, Modbus devices and industrial equipment into a single AI-orchestrable API. Features real-time monitoring, alarms, time-series storage and actuator control.
grok-faf
First MCP server for Grok | FAST⚡️AF • URL-based AI context • Vercel-deployed
local -gateway
Aggregate multiple MCP servers into a single endpoint with web UI, OAuth 2.1, and profile-based tool management