nodejs-executor
Skill1 starsChanged 4 days agoMITView on GitHub
Use when the user asks to "run nodejs code", "execute javascript", "execute typescript", "run js snippet", "run node script", "evaluate expression", "execute node file", "run package script", "test node snippet", or wants to execute JavaScript/TypeScript code safely using the nodejs-executor MCP server with multi-layered sandbox security.
- Reads credentials
- Installs packages
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-orchestratorSkill
- algorithmic-complexity-analyzerSkill
- api-securitySkill
- architectural-planningSkill
- caching-queues-reviewerSkill
- code-reviewerSkill
- csharp-developerSkill
- design-pattern-detectorSkill
- detect-overengineeringSkill
- github-security-scanner-hookSkill
- java-developerSkill
- legacy-code-modernizationSkill
- llm-as-judgeSkill
- load-memorySkill
- playwright-bdd-testerSkill
- powershell-writerSkill
- python-api-writerSkill
- python-developerSkill
- python-linterSkill
- react-developerSkill
- remote-pod-log-analyzerSkill
- save-memorySkill
- scan-halucinated-testsSkill
- scan-repo-readmeSkill
- skill-creatorSkill
- sql-connectorSkill
- sql-executorSkill
- sync-github-forksSkill
- trace-code-contextSkill
- troubleshoot-and-fixSkill
- typescript-developerSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
execute_file: Run an existing .js, .mjs, .cjs, or .ts file on disk with command-line arguments. - Very specific: line 25
Every execution defaults to strict mode for defense-in-depth protection:
- Very specific: line 47
Use execute_file with filePath: "path/to/script.ts"
- Very specific: line 50
Use run_package_script with script: "build" or script: "test"
- Very specific: line 51
Ensure arguments do not contain shell metacharacters (&, |, ;, >, $).
- Very specific: line 58
When connected to the nodejs-executor MCP server in Claude Code, Claude Desktop, Cursor, Copilot, or Antigravity:
- Distinctive: line 91
If code attempts an unauthorized operation:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Node.js Executor Skill
Execute JavaScript and TypeScript code, evaluate expressions, run script files, and automate package scripts using the nodejs-executor MCP server with multi-layered security sandboxing.
Capabilities
execute_code: Execute multi-line JavaScript (ESM) or TypeScript snippets with top-level await and Node standard modules.evaluate_expression: Evaluate a single expression or async expression with deep object introspection and type detection.execute_file: Run an existing.js,.mjs,.cjs, or.tsfile on disk with command-line arguments.run_package_script: Executenpm,pnpm, oryarnrun scripts from anypackage.jsonwith argument injection protections.get_runtime_info: Inspect Node.js version, V8 version, platform, architecture, memory usage, CPU count, and permission model support.
Security Sandbox Policies
Every execution defaults to strict mode for defense-in-depth protection:
| Mode | Filesystem Permissions | Process Spawning | Environment Variables | Intended Use |
strict (default) | Writes/deletes locked to OS temp folder (--allow-fs-write=<tempDir>). Host files cannot be modified or deleted. | BLOCKED (child_process disabled). | Sensitive keys scrubbed (*KEY*, *TOKEN*, *SECRET*, AWS_*, GITHUB_*, etc.). | Safe execution of untrusted snippets, calculations, tests, and data parsing. |
workspace-write | Writes/deletes permitted in temp and current working directory. Files outside workspace remain protected. | BLOCKED (child_process disabled). | Sensitive keys scrubbed. | File generation tasks, building artifacts, or transforming project files. |
unrestricted | Full host permissions (Node permission model disabled). | Allowed. | Full host process.env. | Only when user explicitly requests full host system management or shell execution. |
Workflow
Step 1 — Select the Right Tool and Sandbox Mode
- Quick expression inspection (e.g.,
Math.hypot(3, 4),crypto.randomUUID()):- Use
evaluate_expression - Mode:
sandboxMode: "strict"
- Use
- Multi-line code snippet / async algorithm / data processing:
- Use
execute_code - Set
language: "typescript"if type annotations or TypeScript syntax are used (native Node 22+ type stripping). - Mode:
sandboxMode: "strict"(default)
- Use
- Running an existing script file:
- Use
execute_filewithfilePath: "path/to/script.ts" - Pass optional
args: ["arg1", "arg2"]
- Use
- Running npm / pnpm / yarn lifecycle scripts:
- Use
run_package_scriptwithscript: "build"orscript: "test" - Ensure arguments do not contain shell metacharacters (
&,|,;,>,$).
- Use
Step 2 — Invocation Methods
Method A: Direct MCP Tool Invocation (inside AI sessions)
When connected to the nodejs-executor MCP server in Claude Code, Claude Desktop, Cursor, Copilot, or Antigravity:
{
"name": "execute_code",
"arguments": {
"code": "const res = await fetch('https://api.github.com/zen'); console.log(await res.text());",
"language": "javascript",
"sandboxMode": "strict"
}
}Method B: Automated Runner Script
You can trigger execution programmatically from terminal or scripts:
node mcp/nodejs-executor/scripts/invoke.mjsStep 3 — Handling Results and Security Errors
Responses return structured JSON:
success:booleanindicating if the execution succeeded.stdout: Captured standard output stream (capped at 512 KB).stderr: Captured standard error stream.durationMs: Process run duration in milliseconds.timedOut:trueif the 30-second timeout was triggered.sandboxMode: Sandbox policy applied during execution.
Security Policy Errors
If code attempts an unauthorized operation:
- Unauthorized write/delete outside temp:
Error: Access to this API has been restricted (code: 'ERR_ACCESS_DENIED', permission: 'FileSystemWrite') - Unauthorized process spawning:
Error: Access to this API has been restricted (code: 'ERR_ACCESS_DENIED', permission: 'ChildProcess') - Pre-execution safety rejection:
Security policy violation: Blocked by pre-execution safety policy: broad destructive root filesystem operation detected.
Prerequisites & Setup
- Node.js:
>= 20.0.0(Node 22+ recommended for native TypeScript support) - Server build:
cd mcp/nodejs-executor npm install npm run build npm test - MCP Registration:
claude mcp add nodejs-executor node <path-to-repo>/mcp/nodejs-executor/dist/index.js
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

