Local Workspace Orchestrator
Enables Claude to interact with local workspace files through MCP, including listing files, summarizing CSV datasets, generating plots, executing Python scripts, and running allowlisted shell commands from a chat interface.
README
Local Workspace Orchestrator
An MCP (Model Context Protocol) client-server system that connects Anthropic Claude to your local filesystem through a set of workspace tools. The orchestrator lets Claude read files, analyse CSVs, execute scripts, generate plots, and more — all from an interactive chat interface.
Architecture
┌───────────────────────────┐ 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/* │
└───────────────────────────┘ └──────────────────────────┘
Quick Start
1. Clone & install
git clone <your-repo-url>
cd local-workspace-orchestrator
# Using uv (recommended)
uv sync
# Or using pip
pip install -r requirements.txt
2. Set up your API key
cp .env.example .env
# Edit .env and paste your Anthropic API key
3. Run the orchestrator
# Using uv
uv run orchestrator_client.py
# Or directly
python orchestrator_client.py
You'll see the interactive prompt:
======================================================
Local Workspace Orchestrator Active
Type queries, or /help for commands, 'quit' to exit.
======================================================
Orchestrator >
4. Try some queries
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 Configuration
The orchestrator reads server_config.json to know which MCP servers to launch. The format uses the standard MCP mcpServers structure:
{
"mcpServers": {
"workspace_orchestrator": {
"command": "uv",
"args": ["run", "workspace_server.py"]
}
}
}
Adding more servers
You can connect multiple servers — each will have its tools auto-discovered and registered:
{
"mcpServers": {
"workspace_orchestrator": {
"command": "uv",
"args": ["run", "workspace_server.py"]
},
"my_other_server": {
"command": "python",
"args": ["other_server.py"]
}
}
}
Chat Commands
| Command | Description |
|---|---|
/tools |
List all registered tools by server |
/save [filename] |
Save conversation history to JSON file |
/load [filename] |
Load a saved conversation |
/reconnect <server> |
Reconnect to a dropped server |
/history |
Show conversation message count |
/clear |
Clear conversation history |
/help |
Show all available commands |
quit |
Exit the orchestrator |
Available Tools
Read-only tools
| Tool | Description |
|---|---|
list_workspace_files |
List files and subdirectories in a workspace path |
summarize_csv_dataset |
Return shape, columns, dtypes, and summary statistics for a CSV |
run_shell_command |
Execute an allowlisted shell command (ls, cat, grep, etc.) |
Destructive tools
| Tool | Description |
|---|---|
write_file |
Create or overwrite a file in the workspace |
execute_python_script |
Run a Python script and return stdout/stderr |
plot_column_distribution |
Generate a histogram PNG for a CSV column |
Resources
| URI | Description |
|---|---|
workspace://files |
Lists all files in the workspace root |
workspace://schema/{file_name} |
Column names + dtypes for a CSV file |
Security
- Path traversal protection: All file-accepting tools validate paths using
os.path.realpath()+pathlib.Path.resolve()to prevent directory traversal attacks. - Shell command allowlist:
run_shell_commandonly permits a curated set of read-only commands (ls,cat,grep,head,tail, etc.). - Script sandboxing:
execute_python_scriptruns scripts in a subprocess with a 30-second timeout, restricted to the workspace directory viacwd. Note: this is not a true sandbox — the subprocess has the same OS permissions as the server process. - Tool annotations: Each tool carries
readOnlyHint/destructiveHintannotations so MCP clients can reason about safety.
CLI Options
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
Environment Variables
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key (required) | — |
LOG_LEVEL |
Logging verbosity | INFO |
Project Structure
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
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。