freshcrate
Skin:/
Home > MCP Servers > wcgw

wcgw

Shell and coding agent on mcp clients

Why this rank:Strong adoptionRelease freshnessHealthy release cadence

Description

Shell and coding agent on mcp clients

README

Shell and Coding agent for Claude and other mcp clients

Empowering chat applications to code, build and run on your local machine.

wcgw is an MCP server with tightly integrated shell and code editing tools.

⚠️ Warning: This MCP server provides unfiltered access to your machine's shell and files. It does not restrict LLMs from executing arbitrary commands or making unintended changes. This tool can be misused by attackers or run dangerous commands if the AI hallucinates. Run this repository only if you fully understand and accept the risks associated with running AI agents with no restrictions.

As of 2026 the reason you could use wcgw is that it provides fully interactive shell experience that you and the agent both can control (including sending key-strokes). Combined with the wcgw vscode extension that attaches the agent's shell in your editor, you can get the best agentic shell experience that is out there. The file editing tricks and the general minimalism also helps agent be more productive.

Tests Mypy strict Build codecov

Demo

Workflow Demo

Updates

  • [6 Oct 2025] Model can now run multiple commands in background. ZSH is now a supported shell. Multiplexing improvements.

  • [27 Apr 2025] Removed support for GPTs over relay server. Only MCP server is supported in version >= 5.

  • [24 Mar 2025] Improved writing and editing experience for sonnet 3.7, CLAUDE.md gets loaded automatically.

  • [16 Feb 2025] You can now attach to the working terminal that the AI uses. See the "attach-to-terminal" section below.

  • [15 Jan 2025] Modes introduced: architect, code-writer, and all powerful wcgw mode.

  • [8 Jan 2025] Context saving tool for saving relevant file paths along with a description in a single file. Can be used as a task checkpoint or for knowledge transfer.

  • [29 Dec 2024] Syntax checking on file writing and edits is now stable. Made initialize tool call useful; sending smart repo structure to claude if any repo is referenced. Large file handling is also now improved.

  • [9 Dec 2024] Vscode extension to paste context on Claude app

🚀 Highlights

  • Create, Execute, Iterate: Ask claude to keep running compiler checks till all errors are fixed, or ask it to keep checking for the status of a long running command till it's done.
  • Large file edit: Supports large file incremental edits to avoid token limit issues. Smartly selects when to do small edits or large rewrite based on % of change needed.
  • Syntax checking on edits: Reports feedback to the LLM if its edits have any syntax errors, so that it can redo it.
  • Interactive Command Handling: Supports interactive commands using arrow keys, interrupt, and ansi escape sequences.
  • File protections:
    • The AI needs to read a file at least once before it's allowed to edit or rewrite it. This avoids accidental overwrites.
    • Avoids context filling up while reading very large files. Files get chunked based on token length.
    • On initialisation the provided workspace's directory structure is returned after selecting important files (based on .gitignore as well as a statistical approach)
    • File edit based on search-replace tries to find correct search block if it has multiple matches based on previous search blocks. Fails otherwise (for correctness).
    • File edit has spacing tolerant matching, with warning on issues like indentation mismatch. If there's no match, the closest match is returned to the AI to fix its mistakes.
    • Using Aider-like search and replace, which has better performance than tool call based search and replace.
  • Shell optimizations:
    • Current working directory is always returned after any shell command to prevent AI from getting lost.
    • Command polling exits after a quick timeout to avoid slow feedback. However, status checking has wait tolerance based on fresh output streaming from a command. Both of these approach combined provides a good shell interaction experience.
    • Supports multiple concurrent background commands alongside the main interactive shell.
  • Saving repo context in a single file: Task checkpointing using "ContextSave" tool saves detailed context in a single file. Tasks can later be resumed in a new chat asking "Resume task id". The saved file can be used to do other kinds of knowledge transfer, such as taking help from another AI.
  • Easily switch between various modes:
    • Ask it to run in 'architect' mode for planning. Inspired by adier's architect mode, work with Claude to come up with a plan first. Leads to better accuracy and prevents premature file editing.
    • Ask it to run in 'code-writer' mode for code editing and project building. You can provide specific paths with wild card support to prevent other files getting edited.
    • By default it runs in 'wcgw' mode that has no restrictions and full authorisation.
    • More details in Modes section
  • Runs in multiplex terminal Use vscode extension or run screen -x to attach to the terminal that the AI runs commands on. See history or interrupt process or interact with the same terminal that AI uses.
  • Automatically load CLAUDE.md/AGENTS.md Loads "CLAUDE.md" or "AGENTS.md" file in project root and sends as instructions during initialisation. Instructions in a global "/.wcgw/CLAUDE.md" or "/.wcgw/AGENTS.md" file are loaded and added along with project specific CLAUDE.md. The file name is case sensitive. CLAUDE.md is attached if it's present otherwise AGENTS.md is attached.

Claude setup (using mcp)

Mac and linux

First install uv using homebrew brew install uv

(Important: use homebrew to install uv. Otherwise make sure uv is present in a global location like /usr/bin/)

Then create or update claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json) with following json.

{
  "mcpServers": {
    "wcgw": {
      "command": "uvx",
      "args": ["--python", "3.12", "wcgw@latest"]
    }
  }
}

Then restart claude app.

Optional: Force a specific shell

To use a specific shell (bash or zsh), add the --shell argument:

{
  "mcpServers": {
    "wcgw": {
      "command": "uvx",
      "args": ["--python", "3.12", "wcgw@latest", "--shell", "/bin/bash"]
    }
  }
}

If there's an error in setting up

  • If there's an error like "uv ENOENT", make sure uv is installed. Then run 'which uv' in the terminal, and use its output in place of "uv" in the configuration.
  • If there's still an issue, check that uv tool run --python 3.12 wcgw runs in your terminal. It should have no output and shouldn't exit.
  • Try removing ~/.cache/uv folder
  • Try using uv version 0.6.0 for which this tool was tested.
  • Debug the mcp server using npx @modelcontextprotocol/inspector@0.1.7 uv tool run --python 3.12 wcgw

Windows on wsl

This mcp server works only on wsl on windows.

To set it up, install uv

Then add or update the claude config file %APPDATA%\Claude\claude_desktop_config.json with the following

{
  "mcpServers": {
    "wcgw": {
      "command": "wsl.exe",
      "args": ["uvx", "--python", "3.12", "wcgw@latest"]
    }
  }
}

When you encounter an error, execute the command wsl uv --python 3.12 wcgw in command prompt. If you get the error /bin/bash: line 1: uv: command not found, it means uv was not installed globally and you need to point to the correct path of uv.

  1. Find where uv is installed:
whereis uv

Example output: uv: /home/mywsl/.local/bin/uv

  1. Test the full path works:
wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw
  1. Update the config with the full path:
{
  "mcpServers": {
    "wcgw": {
      "command": "wsl.exe",
      "args": ["/home/mywsl/.local/bin/uv", "tool", "run", "--python", "3.12", "wcgw"]
    }
  }
}

Replace /home/mywsl/.local/bin/uv with your actual uv path from step 1.

Usage

Wait for a few seconds. You should be able to see this icon if everything goes right.

mcp icon over here

mcp icon

Then ask claude to execute shell commands, read files, edit files, run your code, etc.

Task checkpoint or knowledge transfer

  • You can do a task checkpoint or a knowledge transfer by attaching "KnowledgeTransfer" prompt using "Attach from MCP" button.
  • On running "KnowledgeTransfer" prompt, the "ContextSave" tool will be called saving the task description and all file content together in a single file. An id for the task will be generated.
  • You can in a new chat say "Resume ''", the AI should then call "Initialize" with the task id and load the context from there.
  • Or you can directly open the file generated and share it with another AI for help.

Modes

There are three built-in modes. You may ask Claude to run in one of the modes, like "Use 'architect' mode"

Mode Description Allows Denies Invoke prompt
Architect Designed for you to work with Claude to investigate and understand your repo. Read-only commands FileEdit and Write tool Run in mode='architect'
Code-writer For code writing and development Specified path globs for editing or writing, specified commands FileEdit for paths not matching specified glob, Write for paths not matching specified glob Run in code writer mode, only 'tests/**' allowed, only uv command allowed
**wcgw** Default mode with everything allowed Everything Nothing No prompt, or "Run in wcgw mode"

Note: in code-writer mode either all commands are allowed or none are allowed for now. If you give a list of allowed commands, Claude is instructed to run only those commands, but no actual check happens. (WIP)

Attach to the working terminal to investigate

NEW: the vscode extension now automatically attach the running terminal if workspace path matches.

If you've screen command installed, wcgw runs on a screen instance automatically. If you've started wcgw mcp server, you can list the screen sessions:

screen -ls

And note down the wcgw screen name which will be something like 93358.wcgw.235521 where the last number is in the hour-minute-second format.

You can then attach to the session using screen -x 93358.wcgw.235521

You may interrupt any running command safely.

You can interact with the terminal safely, for example for entering passwords, or entering some text. (Warning: If you run a new command, any new LLM command will interrupt it.)

You shouldn't exit the session using exit or Ctrl-d, instead you should use ctrl+a+d to safely detach without destroying the screen session.

Include the following in ~/.screenrc for better scrolling experience

defscrollback 10000
termcapinfo xterm* ti@:te@

[Optional] Vs code extension

https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw

Commands:

  • Select a text and press cmd+' and then enter instructions. This will switch the app to Claude and paste a text containing your instructions, file path, workspace dir, and the selected text.

Examples

example

Using mcp server over docker

First build the docker image docker build -t wcgw https://github.com/rusiaaman/wcgw.git

Then you can update /Users/username/Library/Application Support/Claude/claude_desktop_config.json to have

{
  "mcpServers": {
    "wcgw": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=/Users/username/Desktop,dst=/workspace/Desktop",
        "wcgw"
      ]
    }
  }
}

Tools

The server provides the following MCP tools:

Shell Operations:

  • Initialize: Reset shell and set up workspace environment
    • Parameters: any_workspace_path (string), initial_files_to_read (string[]), mode_name ("wcgw"|"architect"|"code_writer"), task_id_to_resume (string)
  • BashCommand: Execute shell commands with timeout control
    • Parameters: command (string), wait_for_seconds (int, optional)
    • Parameters: send_text (string) or send_specials (["Enter"|"Key-up"|...]) or send_ascii (int[]), wait_for_seconds (int, optional)

File Operations:

  • ReadFiles: Read content from one or more files
    • Parameters: file_paths (string[])
  • WriteIfEmpty: Create new files or write to empty files
    • Parameters: file_path (string), file_content (string)
  • FileEdit: Edit existing files using search/replace blocks
    • Parameters: file_path (string), file_edit_using_search_replace_blocks (string)
  • ReadImage: Read image files for display/processing
    • Parameters: file_path (string)

Project Management:

  • ContextSave: Save project context and files for Knowledge Transfer or saving task checkpoints to be resumed later
    • Parameters: id (string), project_root_path (string), description (string), relevant_file_globs (string[])

All tools support absolute paths and include built-in protections against common errors. See the MCP specification for detailed protocol information.

Release History

VersionChangesUrgencyDate
5.6.2Latest release: 5.6.2High4/29/2026
5.6.1## Security Updates This release addresses all 14 Dependabot security alerts by updating vulnerable dependencies. ### Security Fixes | Package | Previous | Updated | Vulnerabilities Fixed | |---------|----------|---------|----------------------| | mcp | 1.9.2 | 1.26.0 | DNS rebinding (high), DoS vulnerabilities (high) | | filelock | 3.18.0 | 3.20.3 | TOCTOU symlink vulnerabilities (medium) | | starlette | 0.46.2 | 0.50.0 | Range header DoS (high), multipart DoS (medium) | | python-Low1/27/2026
5.6.0Flattening of BashCommand schema for wider MCP client compatibilityLow1/23/2026
5.5.6Release 5.5.6Low1/16/2026
5.5.5- Comments before bash commands would cause issues in bash outputLow12/18/2025
5.5.4**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.5.3...5.5.4Low12/13/2025
5.5.3- Revert initialize schema change - Normalising thread id for llama et al Low12/4/2025
5.5.2## What's Changed * Improvements to file editing. Commonly confused characters fix. Throw… by @rusiaaman in https://github.com/rusiaaman/wcgw/pull/83 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.5.1...5.5.2Low12/2/2025
5.5.1- Large command bug fixLow10/9/2025
5.5.0*New features* - Support background commands. Multiple commands can run in parallel. Each command runs in multiplex screen. - ZSH support. You can now configure the shell to be either zsh or bash. If you use ZSH it's automatically selected. - Multiplex improvements. You now see your default pretty prompt instead of "wcgw ->". The experience to interact with the running terminal is now much better and safer (no more overwriting by LLM). - wcgw-vscode extension now attaches to running shellLow10/6/2025
5.4.5**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.4.4...5.4.5Low10/5/2025
5.4.4Release 5.4.4Low9/23/2025
5.4.3Release 5.4.3Low8/29/2025
5.4.2## What's Changed - Do not init in ~ by default, use temp dir - Other minor optimisations **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.4.1...5.4.2Low7/19/2025
5.4.1- Prompt changes for multiple blocks per edit call for speed and status check syntax issue. - Dockerfile fixLow6/28/2025
5.4.0## Features - WCGW_SERVER_INSTRUCTIONS environment variable to add a instructions during initialisation at top. ## Fixes - BashCommand failing due to Claude desktop update. Simplified the schema. - "Screen" startup would cause fatal failure due to timeout error. - Percentage to change <=50 but no search replace block. Put a hard check ## What's Changed * feat(mcp-server): add customizable server instructions via environment variable by @murich in https://github.com/rusiaaman/wcgw/pullLow6/27/2025
5.3.2- Claude uses grep by default even if ripgrep `rg` is available which is much faster, asking LLM to use `rg` (if available)Low6/18/2025
5.3.1Release 5.3.1Low6/17/2025
5.3.0- "~/.wcgw/CLAUDE.md" if exists is automatically sent as instructions to LLM during init. Create the folder and the file and add prompts that's loaded everytime across projects during Initialisation calls. - Show line numbers by default in read files. Trading off line number out of sync issue with redundant call to see the line numbers. - Diff prompt improvement that mentions the order sensitivity of search replace blocks. ## What's Changed * Feat/improvements by @rusiaaman in https://githLow6/15/2025
5.2.0- Should fix reset shell behavior - Supports `<<<<< SEARCH>` behaviour - Removes false positive tree sitter warnings. ## What's Changed * Update README.md by @jprrabanal in https://github.com/rusiaaman/wcgw/pull/64 ## New Contributors * @jprrabanal made their first contribution in https://github.com/rusiaaman/wcgw/pull/64 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.1.3...5.2.0Low6/5/2025
5.1.3- Due to some upstream changes in Claude it wasn't using percentage_to_edit before file content, effectively making the parameter useless and causing it to write more than edit. Made the parameters ordered by alphabetical name sorting, and also explicitly mentioning the order. - Fixed chat id not being shown in case a very large file is read during initialisation. Low5/15/2025
5.1.2**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.1.1...5.1.2Low5/13/2025
5.1.1Release 5.1.1Low5/11/2025
5.1.0# Notes 1. Increased file truncation limit from 8k tokens to 24k tokens for coding files. For non coding files it's still 8k. This should reduce reading in chunks. 2. Removed custom fork of python mcp sdk, using latest python mcp sdk since the cancellation issue seems to be fixed. 3. Bug fix in file edit when too many warnings are generated.Low5/4/2025
5.0.2- In some cases it should improve the file edit by reducing the size of the search/replace blocks. - It wasn't reading the rest of the lines correctly when file was truncated in some cases, improved the prompt. **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.0.1...5.0.2Low5/1/2025
5.0.1**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/5.0.0...5.0.1Low4/28/2025
5.0.0# Adds ## "chat_id" feature to avoid re-initialisation. If you restarted claude app previously, the 'initialisation' server would need to be called again in the same conversation, often leading to large amount of wasted tokens. It's also annoying since claude app has to be restarted often. # Removes - Deprecate and remove chatgpt support using relay server. It's clear open-ai is not interested in improving custom-gpts to have newer and better models. Additionally, openai will likely suppLow4/27/2025
4.1.2- Last release was crashing due to missing dependency - Pushed immediate fix, need to check why tests were passingLow4/2/2025
4.1.1* BashCommand allow multiline single statements. Useful for large commit messages * Automatically cleanup orphaned wcgw screens on startup ## What's Changed * Feature/orphaned screen cleanup by @rusiaaman in https://github.com/rusiaaman/wcgw/pull/49 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/4.1.0...4.1.1Low4/1/2025
4.1.0- Fixed: screen instances not getting cleaned up - Fixed: search replace not working when disambiguating based on future search replace blocks. - Feature: dynamically scaling up number of files shown in init - Feature: CLAUDE.md file automatically gets included from project root. - Prompt improvements, particularly for using search replace blocks more and read files multiple files more. ## What's Changed * 4.0.1: bug fixes and improvements by @rusiaaman in https://github.com/rusiaaman/wcLow3/25/2025
4.0.0* New improved writing and editing - Merged writing and editing tools for auto selection - Prevent larger edits * If a file updates in background LLM is informed to prevent overwriting * Line number ranges display in ReadFiles. But only when asked for (to save tokens) * Read files now supports reading a range of lines to leverage sonnet 3.7's natural behaviour * Smarter repo tree shown in initialisation. Uses recent git commits and files opened from previous chats. Low3/20/2025
3.0.7- Syntax checker false positive when styled divs are used in tsx due to tree-sitter. Added a note in the output. - WriteFile wasn't taking "~" home directory symbol. - Wording change for reading continuation file. - uvx wcgw_relay was erroring out due to static directory being absolute path. - Dockerfile fixes **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/3.0.6...3.0.7Low3/7/2025
3.0.6- Screen was not being attached to in some cases. - On newer screen versions the output had lot of white spaces. Low2/28/2025
3.0.5Release 3.0.5Low2/25/2025
3.0.4**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/3.0.3...3.0.4Low2/24/2025
3.0.3# Features * Now on context save tool call the file where the context is saved is automatically opened. * Support relative paths using "~" for home directory in the first message. # Bug fix * Bug fix on cwd status had unncessary "pwd\n" prefix **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/3.0.2...3.0.3Low2/20/2025
3.0.2Release 3.0.2Low2/15/2025
3.0.1# 🚀 Release Notes ## New Features * 🖥️ Terminal Magic: Now you can attach to the working terminal, see history and interact directly * wcgw terminal uses `screen` by default - connect anytime with `screen -x $name` * Smart indentation correction when it's safe to do so * Smoother mode switching experience * ⚡ Improved command status monitoring for better user experience ## Efficiency Improvements * Reduced token usage: reduced amount of information shared during initialisation aLow2/15/2025
3.0.1rc3## What's Changed * Feat/bash ux by @rusiaaman in https://github.com/rusiaaman/wcgw/pull/30 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/3.0.1rc2...3.0.1rc3Low2/13/2025
3.0.1rc2- Automated indentation fix - Runs Bash lazily so that it doesn't block. Initialisation should be faster.Low2/10/2025
3.0.1rc1* Major fix: networking issues and slow command execution. * Attaches to screen session so that you can investigate the terminal and interrupt if required. * Speed improvements and token optimisations. * Better mode switching experience; reduced token count while changing mode. * Merged BashInteraction and BashCommand to minimise authorisations in Claude. * Dedicated status checking instead of Enter based status checking. Low2/9/2025
2.8.10* Setting TMPDIR explicitly, fixes ocrmypdf * MCP timeout fixLow2/5/2025
2.8.8Release 2.8.8Low2/4/2025
2.8.7**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/2.8.6...2.8.7Low2/1/2025
2.8.6## What's Changed * Bugfixes/2.8.6: proper malformed search-replace blocks validation, update repl followed by reset shell doesn't work. by @rusiaaman in https://github.com/rusiaaman/wcgw/pull/25 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/2.8.5...2.8.6Low2/1/2025
2.8.5## What's Changed * All logs now get written ~/Library/Logs/Claude/mcp-server-wcgw.log file, including tool calls * Deployment: Dockerfile by @calclavia in https://github.com/rusiaaman/wcgw/pull/24 * Refactored out cli utilities to a new folder. More tests ## New Contributors * @calclavia made their first contribution in https://github.com/rusiaaman/wcgw/pull/24 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/2.8.4...2.8.5Low1/23/2025
2.8.4Release 2.8.4Low1/21/2025
2.8.3Release 2.8.3Low1/20/2025
2.8.2**Full Changelog**: https://github.com/rusiaaman/wcgw/compare/2.8.1...2.8.2Low1/17/2025
2.8.1## What's Changed * fix mcp on linux by @nick1udwig in https://github.com/rusiaaman/wcgw/pull/23 ## New Contributors * @nick1udwig made their first contribution in https://github.com/rusiaaman/wcgw/pull/23 **Full Changelog**: https://github.com/rusiaaman/wcgw/compare/2.8.0...2.8.1Low1/17/2025
2.8.0Release 2.8.0Low1/15/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

hermes-gate🏛️ Hermes Gate — Terminal TUI for managing remote Hermes Agent sessions with auto-reconnect, detach support, and zero config0.0.0
linkedin-mcp-serverOpen-source MCP server for LinkedIn. Give Claude and any MCP-compatible AI assistant access to profiles, companies, jobs, and messages.v4.13.2
hermes-agentThe agent that grows with youv2026.6.5
claude-code-tipsProvide ready-to-use plugins, hooks, and commands to enhance Claude Code sessions with data mining, automation, and integration tools.main@2026-06-04
crab-code🦀 Open-source alternative to Claude Code, built from scratch in Rust. Agentic coding CLI — thinks, plans, and executes with any LLM. Compatible with Claude Code workflows.main@2026-06-03

More in MCP Servers

AstrBotAgentic IM Chatbot infrastructure that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative. ✨
agentscopeBuild and run agents you can see, understand and trust.
claude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins.
langchain4jLangChain4j is an open-source Java library that simplifies the integration of LLMs into Java applications through a unified API, providing access to popular LLMs and vector databases. It makes impleme