Skip to main content
Glama

JavaScript MCP Server

by yannbam

JavaScript MCP サーバー (js-mcp)

AI アシスタントがステートフル REPL セッションで JavaScript コードを実行できるようにするモデル コンテキスト プロトコル (MCP) サーバー。

特徴

コア機能

  • 1回限りのJavaScript実行: Node.jsで直接JavaScriptコードを実行する
  • ステートフル REPL セッション: 複数の実行にわたって変数とコンテキストを維持する
  • ファイルシステム操作: ファイルの読み取り、書き込み、操作
  • パッケージ管理: モジュールをインポートし、npm パッケージを管理する

高度な機能

  • 安全なサンドボックス実行
  • 非同期コードのサポート
  • フォーマットされたスタックトレースによるエラー処理
  • 自動クリーンアップによるセッション管理

インストール

# Clone the repository git clone https://github.com/yourusername/js-mcp.git cd js-mcp # Install dependencies npm install # Build the project npm run build

使用法

stdio トランスポートで実行 (Claude Desktop で使用するため)

npm start # or node dist/index.js --stdio

HTTPトランスポートで実行

node dist/index.js --http # Default port is 3000, or specify with PORT environment variable PORT=3456 node dist/index.js --http

利用可能なツール

JavaScript実行

  • execute_javascript : 基本的なサンドボックスで JavaScript コードを実行する
  • execute_javascript_with_modules : モジュールインポートでJavaScriptを実行する
  • execute_javascript_async : 非同期JavaScriptコードを実行する

REPLセッション

  • repl_create_session : 新しいREPLセッションを作成する
  • repl_execute : REPLセッションでコードを実行する
  • repl_get_context : セッション内の変数の値を取得する
  • repl_delete_session : セッションを削除する
  • repl_list_sessions : すべてのアクティブなセッションを一覧表示する

ファイル操作

  • file_read : ファイルの内容を読み取る
  • file_write : ファイルにコンテンツを書き込む
  • file_list : ディレクトリ内のファイルを一覧表示する
  • file_delete : ファイルまたはディレクトリを削除する
  • file_exists : ファイルが存在するかどうかを確認する

パッケージ管理

  • package_check : モジュールが利用可能かどうかを確認する
  • package_install : npm パッケージをインストールする
  • package_list : インストールされているパッケージを一覧表示する

安全

サーバーは、安全機能を備えた直接的な JavaScript 実行を使用します。

  • コード実行のタイムアウト制限
  • ファイルシステムへのアクセスは作業ディレクトリに制限されます
  • 危険な操作を防ぐためのパス検証

構成

環境変数を設定してサーバーを構成します。

  • PORT : HTTPサーバーポート(デフォルト: 3000)
  • WORKING_DIRECTORY : ファイル操作のベースディレクトリ(デフォルト: 現在のディレクトリ)
  • SESSION_TIMEOUT : REPLセッションのタイムアウト(分)(デフォルト: 30)

発達

# Start in development mode npm run dev # Run tests npm test # Lint code npm run lint # Format code npm run format

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

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

ステートフル REPL セッション、ファイル操作、パッケージ管理機能を通じて、AI アシスタントが永続的なコンテキストで JavaScript コードを実行できるようにするサーバー。

  1. 特徴
    1. コア機能
    2. 高度な機能
  2. インストール
    1. 使用法
      1. stdio トランスポートで実行 (Claude Desktop で使用するため)
      2. HTTPトランスポートで実行
    2. 利用可能なツール
      1. JavaScript実行
      2. REPLセッション
      3. ファイル操作
      4. パッケージ管理
    3. 安全
      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
              A
              license
              A
              quality
              A server that enhances AI assistants with the ability to update your JSON Resume by analyzing your coding projects, automatically extracting skills and generating professional descriptions.
              Last updated -
              3
              32
              39
              TypeScript
              The Unlicense
              • Apple
              • Linux
            • -
              security
              A
              license
              -
              quality
              A server that enables AI assistants to understand and interact with Unity projects in real-time, providing access to scene hierarchy, project settings, and the ability to execute code directly in the Unity Editor.
              Last updated -
              40
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              A web browser automation server that allows AI assistants to control Chrome with persistent state management, enabling complex browsing tasks through asynchronous browser operations.
              Last updated -
              1
              Python
              • Apple

            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/yannbam/js-mcp'

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