A Model Context Protocol (MCP) server that executes JavaScript code securely in a sandboxed environment using SES (Secure ECMAScript).
Screen.Recording.2025-05-24.at.7.43.06.PM.mov
run_javascript- Execute arbitrary JavaScript code in a secure SES compartment- Accepts a string of JavaScript code
- Returns the result and all console logs as JSON-formatted text
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchYou can run the server directly:
npm startOr use the built binary:
node build/index.jsTo use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"run-javascript-sandbox": {
"command": "npx",
"args": ["-y", "javascript-sandbox-mcp"]
}
}
}Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser.
Security Note:
This server uses SES to sandbox code execution, but running untrusted code always carries risk. Use with caution and only in trusted environments.