MCP-REPL

by AnEntrypoint
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides a secure JavaScript REPL (Read-Eval-Print-Loop) environment to execute code snippets with error handling, memory management, and output formatting.

  • Enables secure access to Node.js built-in modules and execution of JavaScript code in a sandboxed VM context with working directory support.

  • Allows running the REPL directly via npx without installation or installing it globally through npm for repeated usage.

🚀 直接 Node.js REPL エグゼキューター

🧙‍♂️ 簡素化された JavaScript 実行環境

以下を完全にサポートし、シームレスなコード実行を可能にする、合理化された直接 Node.js 実行環境:

  • ESMモジュール- ネイティブのインポート/エクスポート構文
  • 動的インポート- await import() の完全サポート
  • CommonJS 互換性- require() から createRequire まで動作します
  • ネイティブ Node.js API アクセス- すべての Node.js 機能への直接アクセス

🧩 設定

カーソルの場合は、 .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 の直接実行: VM サンドボックスなしで 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

メモリ保護、タイムアウト処理、包括的なエラー レポートを備えたサンドボックス環境でコード スニペットを実行できる安全な JavaScript REPL サーバーです。

  1. 🧙‍♂️ Simplified JavaScript Execution Environment
    1. 🧩 Configuration
      1. ✨ Features
        1. 🛠️ Implementation Details
          1. 📝 Usage Examples
            ID: qxzhferyl6