How rusiaaman/wcgw works
Project type and purpose
• This is an open‑source Python tool (“wcgw”) that exposes a Model Context Protocol (MCP) server and a lightweight relay server to let LLMs (Claude, ChatGPT) interact with your local shell and filesystem. It provides a CLI entrypoint, a library of “tools” (shell commands, file ops, context saving), and two server modes:
• An MCP server (for Claude) tightly integrated with shell and file‑editing tools.
• A relay server (for ChatGPT) that proxies between ChatGPT webhooks and the same tool set.
• The README confirms it is not a front‑end/backend webapp but a developer‑facing automation/runtime service.
File‑structure analysis
• Top‑level: Dockerfile, CI configs, pyproject.toml, README, LICENSE, static assets, tests, and two src modules:
• src/wcgw: core library
– client/: MCP server implementation, tool definitions (BashCommand, ReadFiles, FileEdit, ContextSave), state management (bash_state, memory), repo‑ops, encoder, prompts
– relay/: HTTP/WebSocket relay service (serve.py) and client stubs
• src/wcgw_cli: CLI wrapper that wires together the core library with OpenAI/Anthropic clients, parses arguments, and launches either the local relay or an interactive “local” mode
• tests/: unit tests covering parser, file ops, server behavior
• config: gpt_action_json_schema.json drives the schema for tool calls
Key README insights
• System runs in three “modes” (architect, code‑writer, wcgw) toggled at initialization.
• Tools are exposed via MCP calls: Initialize, BashCommand, ReadFiles, WriteIfEmpty, FileEdit, ContextSave.
• For ChatGPT, messages flow through a relay server; for Claude, directly via MCP.
• Emphasis on correctness (syntax checks, chunking large files, single shell instance).