Skip to main content
Glama
aniketmehetre

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/* │
└───────────────────────────┘                      └──────────────────────────┘

クイックスタート

1. クローンとインストール

git clone <your-repo-url>
cd local-workspace-orchestrator

# Using uv (recommended)
uv sync

# Or using pip
pip install -r requirements.txt

2. API キーの設定

cp .env.example .env
# Edit .env and paste your Anthropic API key

3. オーケストレーターの実行

# 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"]
    }
  }
}

チャットコマンド

コマンド

説明

/tools

サーバーごとに登録済みの全ツールを一覧表示

/save [filename]

会話履歴を JSON ファイルに保存

/load [filename]

保存された会話を読み込み

/reconnect <server>

切断されたサーバーに再接続

/history

会話メッセージ数を表示

/clear

会話履歴をクリア

/help

利用可能な全コマンドを表示

quit

オーケストレーターを終了

利用可能なツール

読み取り専用ツール

ツール

説明

list_workspace_files

ワークスペースパス内のファイルとサブディレクトリを一覧表示

summarize_csv_dataset

CSV の形状、列、dtypes、要約統計量を返す

run_shell_command

許可リストに登録されたシェルコマンド(ls、cat、grep など)を実行

破壊的ツール

ツール

説明

write_file

ワークスペース内のファイルを作成または上書き

execute_python_script

Python スクリプトを実行し、stdout/stderr を返す

plot_column_distribution

CSV 列のヒストグラム PNG を生成

リソース

URI

説明

workspace://files

ワークスペースルート内の全ファイルを一覧表示

workspace://schema/{file_name}

CSV ファイルの列名と dtypes

セキュリティ

  • パストラバーサル対策:ファイルを受け取るすべてのツールは、os.path.realpath() + pathlib.Path.resolve() を使用してパスを検証し、ディレクトリトラバーサル攻撃を防ぎます。

  • シェルコマンドの許可リストrun_shell_command は、厳選された読み取り専用コマンド(lscatgrepheadtail など)のみを許可します。

  • スクリプトのサンドボックス化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_KEY

Anthropic API キー(必須

LOG_LEVEL

ログの詳細度

INFO

プロジェクト構造

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

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.

View all MCP Connectors

Latest Blog Posts

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/aniketmehetre/local_workspace_orchestrator-MCP-SERVER'

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