claude-terminal-mcp
Terminal — Linux用Claude Desktop拡張機能
Claude Desktop用の拡張機能で、ローカルのLinuxマシン上のターミナル、ファイルシステム、バックグラウンドジョブへのアクセス権をClaudeに付与します。
Linux版Claude Desktopではclaude_desktop_config.json形式のMCPサーバーが読み込まれない(この仕組みはmacOS/Windows専用です)という問題を解決します。Linuxでは、ツールを追加する唯一の方法はインストール可能な拡張機能を経由することです。
⚠️ セキュリティ — 最初に必ずお読みください
この拡張機能をインストールすると、ユーザーアカウントに対してClaudeに無制限のシェルアクセス権が与えられます。 ターミナルからユーザーが実行できることはすべて、Claudeもこのツールを通じて実行可能です。ユーザーが読み取れるあらゆるファイルの読み取り、変更可能なあらゆるものの変更、ソフトウェアのインストール、ネットワーク接続の開始などが含まれます。
このインストールは、誰かに自分のマシンへのSSHセッションを許可するのと同じことだと考えてください。Claudeに見られたくない機密データがあるマシンや、共有システムにはインストールしないでください。
明らかに破壊的なワンライナー(rm -rf /、rm -rf ~、フォーク爆弾、生のディスクデバイスに対するdd/mkfs、shutdown/reboot)を拒否する最小限の組み込み安全拒否リストが存在します。これは最後の手段としての安全策であり、サンドボックスではありません。 悪意のあるコマンドであれば、簡単に回避可能です。これは、一瞬の不注意でホームディレクトリが消去されるのを防ぐために存在します。
制限を強化するには、server.jsの先頭にあるDENYLIST配列を編集して再ビルドしてください。完全に削除するには、DENYLIST = []に設定して再ビルドしてください。
Related MCP server: claude-linux-mcp
機能
Claudeに対して8つのツールを公開します:
ツール | 目的 |
|
|
| オプションの行範囲指定でテキストファイルを読み取ります。 |
| タイプ(ファイル/ディレクトリ)、サイズ、mtimeを含むエントリを一覧表示します。 |
| テキストファイルを作成または上書きします。親ディレクトリも作成されます。 |
| デタッチされたサブプロセスを生成し、 |
| バックグラウンドジョブのステータスと、stdout/stderrの最後のN行を読み取ります。 |
| すべてのジョブ(実行中、終了、強制終了)を一覧表示します。 |
| ジョブにSIGTERMを送信します。5秒経過しても生存している場合はSIGKILLを送信します。 |
実行状態(トランスクリプト、ジョブの一時ファイル)は/tmp/claude-term-mcp/以下に保存され、再起動時に消去されます。
インストール
Releasesページから最新の
Terminal.mcpbをダウンロードします。Claude Desktop → Settings → Extensions を開きます。
下部にある Extension Developer セクションまでスクロールします。Install Extension をクリックし、ダウンロードした
Terminal.mcpbファイルを選択します。Claude Desktopに「開発者情報がAnthropicによって検証されていません」という赤い警告とともに拡張機能の詳細が表示されます。ソースを信頼できることを確認し、Install をクリックします。
インストール時にClaude Desktopから Default working directory(デフォルトの作業ディレクトリ)を尋ねられます。これは、Claudeが指定しなかった場合にシェルコマンドが実行される場所です。メインのプロジェクトフォルダを選択するか、空のままにしてホームディレクトリをデフォルトにします。
All extensions に戻り、Terminal がオンになっていることを確認します。
チャット内でコネクタ/ツールピッカーを開き、その会話で Terminal を有効にします。
デフォルトの作業ディレクトリは、後から Settings → Extensions → Terminal で変更できます。
要件
Linux上のClaude Desktop ≥ 0.10.0(macOSでもテスト済み)
Node.js ≥ 16(Claude Desktopには拡張機能実行用のNodeが同梱されているため、システム側のNodeは不要です)
PATH上の
bash
npm installの手順は不要です。この拡張機能は依存関係ゼロの純粋なNode.jsで構成されています。
設定
すべての設定は、インストール時または Settings → Extensions → Terminal からClaude DesktopのUIを通じて行います。
フィールド | 型 | 目的 |
Default working directory | ディレクトリ | Claudeが指定しなかった場合にシェルコマンドが実行される場所。空欄にすると |
拒否リストやその他の動作をカスタマイズするには、server.jsを編集して再ビルドしてください(下記参照)。
既知の問題
黄色いバナー: "Tool result could not be submitted. The request may have expired or the connection was interrupted." これは、Claudeの動的なツール読み込みステップをトリガーするすべてのターンで発生します。この404エラーはAnthropicバックエンドへのツール検索結果送信に関するもので、MCPツール自体に対するものではありません。ツール呼び出しは実行され、バナーの直後に正しく結果が返されます。これは見た目上の問題です。同様の問題は標準のFilesystem拡張機能でも発生します。将来のClaude Desktopリリースで修正される予定の、クライアントとバックエンド間のプロトコルの不一致である可能性が高いです。
ソースからのビルド
git clone https://github.com/LukeLamb/claude-terminal-mcp
cd claude-terminal-mcp
# Edit whatever you want in server.js / manifest.json.
# If you change the tool surface, update both places.
# Bump the version in manifest.json so Claude Desktop treats the install as an update.
# Build the bundle:
zip -j Terminal.mcpb manifest.json package.json server.js
# Then install Terminal.mcpb via Claude Desktop → Settings → Extensions → Install Extension.アンインストール
Settings → Extensions → All extensions → Terminal → Remove。
プライバシーポリシー
データがマシンから外部へ送信されることはありません。 この拡張機能は完全にローカルで動作します:
データ収集: なし。この拡張機能は外部への通信、テレメトリの送信、独自のネットワークリクエストの実行を行いません。観測されるすべてのネットワーク呼び出しは、ユーザーがClaudeに実行を依頼したもの(例:
curl、wget、git push)です。データの使用と保存: コマンドのトランスクリプト(stdinは除外、stdout + stderr + 終了コード)は
/tmp/claude-term-mcp/runs/<timestamp>.logに書き込まれ、Claudeが同じ会話内で後から参照できるようにします。バックグラウンドジョブの状態(コマンド、pid、stdout/stderrログファイル、終了コード、ステータス)は/tmp/claude-term-mcp/jobs/<job-id>/に書き込まれます。第三者への共有: なし。この拡張機能によってAnthropic、拡張機能の作成者、または第三者にデータが送信されることはありません。(Claude Desktop自体は、通常のチャットフローの一部としてツールへの入力/出力をAnthropicに送信しますが、これはAnthropicとユーザー間の関係であり、この拡張機能とは無関係です。)
保持:
/tmp/claude-term-mcp/は再起動のたびにクリアされます。手動でクリアするにはrm -rf /tmp/claude-term-mcpを実行してください。権限の範囲: コマンドはユーザー自身の権限で実行されます。ターミナルに直接入力した場合と同じです。
連絡先 / 質問: https://github.com/LukeLamb/claude-terminal-mcp/issues でIssueを作成してください。
ライセンス
MIT。自由に使用してください。帰属表示を歓迎しますが、保証はありません。
Available Tools
8 toolskill_backgroundADestructive
Terminate a running background job (SIGTERM, then SIGKILL after 5s).
Inputs: job_id (required).
list_backgroundARead-only
List all background jobs (running, exited, killed).
Inputs: no named parameters.
list_directoryARead-only
List entries in a directory with type, size, and mtime.
Inputs: path (required).
read_backgroundARead-only
Read status and last N lines of stdout/stderr for a background job. tail=0 returns full logs.
Inputs: job_id (required), tail.
read_fileARead-only
Read a text file with optional line-range slicing.
Inputs: path (required), offset, limit.
run_backgroundADestructive
Start a long-running command in the background. Returns a job_id you can poll with read_background.
Inputs: command (required), cwd.
run_commandADestructive
Run a shell command via bash -lc on the user's machine. Returns stdout/stderr/exit_code. Default cwd is the user-configured default working directory (or $HOME if unset). Output capped at 100KB per stream; full transcript saved to log_path.
Inputs: command (required), cwd, timeout, env.
write_fileADestructive
Create or overwrite a text file. Parent directories are created.
Inputs: path (required), content (required), overwrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a distinct purpose: run_command for synchronous commands, run_background for long-running, and separate tools for file operations and background job management. No overlap.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., kill_background, list_directory, read_file), making the set predictable.
With 8 tools, the server covers essential terminal operations (command execution, file read/write, listing, background jobs) without excessive tool count.
Core operations are present, but missing file deletion, rename, and persistent directory change tools; however, these can be accomplished via run_command, so only minor gaps.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseAqualityBmaintenanceAllows Claude desktop app to execute terminal commands and edit files on your computer through MCP, with features including command execution, process management, and diff-based file editing.2510,411MIT
- AlicenseAqualityCmaintenanceGive Claude Desktop full desktop control on Linux/X11: screenshot, mouse, keyboard, windows, clipboard, app launch. Zero-dependency MCP extension, MIT-licensed.15MIT
- FlicenseNot gradedqualityDmaintenanceProvides filesystem access to Claude via the MCP protocol, enabling local file operations through natural language.-
- AlicenseNot gradedqualityDmaintenanceExposes an interactive terminal over MCP, enabling remote shell command execution, file operations, and directory management via ChatGPT or Claude Desktop.2MIT