go-mcp-js-eval-wasi
by takanoriyanagitani
Overview
Provides a Model Context Protocol (MCP) server for securely evaluating JavaScript code within a WASM sandbox.
Installation
./mcp-js-eval-wasi -port 12098 -mem 32 -timeout 200 -path2engine "${HOME}/.cargo/bin/js-eval-boa.wasm"Security Notes
The server's core function is to evaluate arbitrary JavaScript code, which is inherently a high-risk operation. However, it implements significant security measures: * Execution occurs within a WebAssembly (WASM) sandbox using `wazero`. * WASM memory limits are enforced (`WithMemoryLimitPages`). * Execution timeouts are applied (`context.WithTimeout`). * Standard HTTP server hardening (body size limit, read/write timeouts, max header bytes) is used. * Input/output is explicitly handled for JSON. The primary remaining risk lies in potential vulnerabilities within the `wazero` runtime or WASI implementation, or in the supplied WASM JavaScript engine itself (e.g., `js-eval-boa.wasm`). The `example.sh` explicitly warns about supply chain attacks for the WASM bytecode, highlighting this dependency as a critical trust boundary.
Similar Servers
hyper-mcp
A fast, secure Model Context Protocol (MCP) server that extends its capabilities through WebAssembly plugins, enabling AI agents to access tools, resources, and prompts.
wasmcp
Build and run composable Model Context Protocol (MCP) servers using WebAssembly components for AI-assisted development.
compound-mcp-server
Provides a Model Context Protocol (MCP) server for interacting with Groq models, including compound/meta models, exposing tools for real-time information and code execution capabilities from the Groq AI.
mcp-mock-server
Provides a mock server for the Model Context Protocol (MCP) to aid in the development and testing of MCP clients.