Skip to main content
Glama

MCP-REPL

by AnEntrypoint

🚀 直接 Node.js REPL 执行器

版本节点执照

🧙‍♂️ 简化的 JavaScript 执行环境

简化的直接 Node.js 执行环境,可实现无缝代码执行,并全面支持:

  • ESM 模块- 原生导入/导出语法
  • 动态导入- 完全支持 await import()
  • CommonJS 兼容性- 通过 createRequire 与 require() 配合使用
  • 原生 Node.js API 访问——直接访问所有 Node.js 功能

🧩 配置

对于 Cursor,更新您的.cursor/mcp.json配置:

{ "mcpServers": { "mcp-repl": { "command": "node", "args": [ "path/to/direct-node-executor.js", "path/to/your/project" ], "env": {}, "disabled": false, "autoApprove": ["execute"] } } }

✨ 特点

  • 🚀直接执行 Node.js :无需虚拟机沙盒,直接在 Node.js 中运行代码
  • 📦完整模块支持:无缝支持 ESM 和 CommonJS 模块
  • ⏱️实时反馈:从代码执行中立即获得结果
  • 🔍增强调试:使用适当的错误处理清理输出
  • 🧠简单的架构:以最小的复杂性简化实施
  • 🔄文件系统访问:完全访问文件系统以进行实际测试

🛠️ 实现细节

此实现:

  1. 每次执行时创建临时.mjs文件
  2. 在单独的进程中直接使用 Node.js 运行代码
  3. 捕获所有控制台输出和执行结果
  4. 自动清理临时文件
  5. 将标准化结果返回给MCP客户端

📝 使用示例

// Dynamic imports const fs = await import('fs/promises'); const path = await import('path'); // Reading files const content = await fs.readFile('package.json', 'utf8'); console.log(JSON.parse(content)); // Using path utilities console.log(path.join('folder', 'file.txt'));

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

安全的 JavaScript REPL 服务器,可以在沙盒环境中执行代码片段,具有内存保护、超时处理和全面的错误报告功能。

  1. 🧙‍♂️ 简化的 JavaScript 执行环境
    1. 🧩 配置
      1. ✨ 特点
        1. 🛠️ 实现细节
          1. 📝 使用示例

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              The sessionless code interpreter. Securely run AI-generated code in stateful sandboxes that run forever.
              Last updated -
              65
              176
              Rust
              MIT License
            • A
              security
              F
              license
              A
              quality
              Provides a secure, isolated JavaScript execution environment with configurable time and memory limits for safely running code from Claude.
              Last updated -
              1
              5
              JavaScript
              • Apple
            • -
              security
              F
              license
              -
              quality
              A server that enables AI assistants to execute JavaScript code with persistent context through stateful REPL sessions, file operations, and package management features.
              Last updated -
              TypeScript
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              Enables mapping JavaScript error stack traces back to original source code, extracting context information to help developers locate and fix issues.
              Last updated -
              2
              150
              2
              TypeScript
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/AnEntrypoint/mcp-repl'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server