Skip to content

shanejonas/javascript-sandbox-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Sandbox MCP Server

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

Features

Tools

  • 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

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Usage

You can run the server directly:

npm start

Or use the built binary:

node build/index.js

Installation

To 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"]
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:

npm run inspector

The 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.

About

Provides a javascript sandbox via SES (Secure Ecmascript)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published