Local Workspace Orchestrator
ローカルワークスペースオーケストレーター
MCP (Model Context Protocol) クライアント・サーバーシステムで、Anthropic Claude を一連のワークスペースツールを通じてローカルファイルシステムに接続します。このオーケストレーターにより、Claude はファイルの読み取り、CSV の分析、スクリプトの実行、プロットの生成など、すべてをインタラクティブなチャットインターフェースから実行できます。
アーキテクチャ
┌───────────────────────────┐ stdio ┌──────────────────────────┐
│ orchestrator_client.py │ ◄──────────────────► │ workspace_server.py │
│ (MCP Client + Anthropic) │ MCP protocol │ (FastMCP Server) │
│ │ │ │
│ • Connects to 1+ servers │ │ Tools: │
│ • Streams Claude output │ │ • list_workspace_files │
│ • Retries failed calls │ │ • summarize_csv_dataset│
│ • Saves chat history │ │ • execute_python_script│
│ │ │ • write_file │
│ │ │ • run_shell_command │
│ │ │ • plot_column_distrib. │
│ │ │ │
│ │ │ Resources: │
│ │ │ • workspace://files │
│ │ │ • workspace://schema/* │
└───────────────────────────┘ └──────────────────────────┘Related MCP server: ai-distiller-mcp
クイックスタート
1. クローンとインストール
git clone <your-repo-url>
cd local-workspace-orchestrator
# Using uv (recommended)
uv sync
# Or using pip
pip install -r requirements.txt2. API キーの設定
cp .env.example .env
# Edit .env and paste your Anthropic API key3. オーケストレーターの実行
# Using uv
uv run orchestrator_client.py
# Or directly
python orchestrator_client.pyインタラクティブプロンプトが表示されます:
======================================================
Local Workspace Orchestrator Active
Type queries, or /help for commands, 'quit' to exit.
======================================================
Orchestrator >4. クエリを試す
Orchestrator > list all files in this workspace
Orchestrator > summarize the sample_consumer.csv dataset
Orchestrator > plot the distribution of SpendingScore in sample_consumer.csv
Orchestrator > run the run_analysis.py scriptサーバー設定
オーケストレーターは server_config.json を読み取り、起動する MCP サーバーを決定します。形式は標準の MCP mcpServers 構造を使用します:
{
"mcpServers": {
"workspace_orchestrator": {
"command": "uv",
"args": ["run", "workspace_server.py"]
}
}
}サーバーの追加
複数のサーバーを接続できます。各サーバーのツールは自動的に検出され登録されます:
{
"mcpServers": {
"workspace_orchestrator": {
"command": "uv",
"args": ["run", "workspace_server.py"]
},
"my_other_server": {
"command": "python",
"args": ["other_server.py"]
}
}
}チャットコマンド
コマンド | 説明 |
| サーバーごとに登録済みの全ツールを一覧表示 |
| 会話履歴を JSON ファイルに保存 |
| 保存された会話を読み込み |
| 切断されたサーバーに再接続 |
| 会話メッセージ数を表示 |
| 会話履歴をクリア |
| 利用可能な全コマンドを表示 |
| オーケストレーターを終了 |
利用可能なツール
読み取り専用ツール
ツール | 説明 |
| ワークスペースパス内のファイルとサブディレクトリを一覧表示 |
| CSV の形状、列、dtypes、要約統計量を返す |
| 許可リストに登録されたシェルコマンド(ls、cat、grep など)を実行 |
破壊的ツール
ツール | 説明 |
| ワークスペース内のファイルを作成または上書き |
| Python スクリプトを実行し、stdout/stderr を返す |
| CSV 列のヒストグラム PNG を生成 |
リソース
URI | 説明 |
| ワークスペースルート内の全ファイルを一覧表示 |
| CSV ファイルの列名と dtypes |
セキュリティ
パストラバーサル対策:ファイルを受け取るすべてのツールは、
os.path.realpath()+pathlib.Path.resolve()を使用してパスを検証し、ディレクトリトラバーサル攻撃を防ぎます。シェルコマンドの許可リスト:
run_shell_commandは、厳選された読み取り専用コマンド(ls、cat、grep、head、tailなど)のみを許可します。スクリプトのサンドボックス化:
execute_python_scriptは、30 秒のタイムアウト付きでサブプロセス内でスクリプトを実行し、cwdを介してワークスペースディレクトリに制限します。注意:これは真のサンドボックスではありません。サブプロセスはサーバープロセスと同じ OS 権限を持ちます。ツールアノテーション:各ツールには
readOnlyHint/destructiveHintアノテーションが付与され、MCP クライアントが安全性を判断できるようにします。
CLI オプション
python orchestrator_client.py --help
options:
--log-level {DEBUG,INFO,WARNING,ERROR} Set logging verbosity (default: INFO)
--system-prompt TEXT Custom system prompt for Claude
--config PATH Path to server_config.json環境変数
変数 | 説明 | デフォルト |
| Anthropic API キー(必須) | — |
| ログの詳細度 |
|
プロジェクト構造
local-workspace-orchestrator/
├── orchestrator_client.py # MCP client + Anthropic integration
├── workspace_server.py # FastMCP server with workspace tools
├── server_config.json # MCP server connection configuration
├── main.py # Stub entry point
├── run_analysis.py # Example analysis script
├── sample_consumer.csv # Sample dataset
├── pyproject.toml # Project metadata + dependencies
├── requirements.txt # Pinned pip dependencies
├── .env.example # API key template
├── .gitignore # Git ignore rules
└── README.md # This fileライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Creative workspace. Public MCP: outline previews for Codex and Claude Code; media in the web app.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseBqualityBmaintenanceAllows 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.251,287,096 npm10,299MIT
- FlicenseNot gradedqualityDmaintenanceProvides filesystem access to Claude via the MCP protocol, enabling local file operations through natural language.-
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to inspect and edit local projects through a secure MCP interface, offering workspace management, file operations, git integration, and safe command execution.6MIT
- FlicenseNot gradedqualityBmaintenanceEnables Claude Desktop or other MCP clients to execute shell commands, read/write files, and list directories on the local machine. Includes basic safety guardrails to block obviously destructive operations.-