Back to Home
takanoriyanagitani icon

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

Run Command
./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

Stats

Interest Score0
Security Score7
Cost ClassMedium
Stars0
Forks0
Last Update2025-12-10

Tags

JavaScriptWASMGoMCPCode Evaluation