wcgw

wcgw

4.3

wcgw is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.

If you are the rightful owner of wcgw and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

wcgw is an MCP server with tightly integrated shell and code editing tools, designed to empower chat applications like Claude to code, build, and run on your local machine.

wcgw is a Model Context Protocol (MCP) server that integrates shell and code editing tools to enhance chat applications such as Claude. It allows users to execute shell commands, edit files, and manage projects directly from chat interfaces. The server supports various modes of operation, including architect and code-writer modes, to tailor its functionality to different development needs. It also includes features for large file handling, syntax checking, and interactive command handling. The server is designed to work on multiple platforms, including Mac, Linux, and Windows (via WSL), and can be integrated with tools like VS Code for enhanced functionality.

Features

  • Create, Execute, Iterate: Automate compiler checks and command status monitoring.
  • Large File Edit: Supports incremental edits to manage token limits.
  • Syntax Checking: Provides feedback on syntax errors for LLM edits.
  • Interactive Command Handling: Supports interactive shell commands.
  • File Protections: Ensures files are read before edits to prevent overwrites.

Tools

  1. Initialize

    • Always call this at the start of the conversation before using any of the shell tools from wcgw.
    • Use any_workspace_path to initialize the shell in the appropriate project directory.
    • If the user has mentioned a workspace or project root or any other file or folder use it to set any_workspace_path.
    • If user has mentioned any files use initial_files_to_read to read, use absolute paths only (~ allowed)
    • By default use mode "wcgw"
    • In "code-writer" mode, set the commands and globs which user asked to set, otherwise use 'all'.
    • Use type="first_call" if it's the first call to this tool.
    • Use type="user_asked_mode_change" if in a conversation user has asked to change mode.
    • Use type="reset_shell" if in a conversation shell is not working after multiple tries.
    • Use type="user_asked_change_workspace" if in a conversation user asked to change workspace
  2. BashCommand

    • Execute a bash command. This is stateful (beware with subsequent calls).
    • Status of the command and the current working directory will always be returned at the end.
    • The first or the last line might be (...truncated) if the output is too long.
    • Always run pwd if you get any file or directory not found error to make sure you're not lost.
    • Run long running commands in background using screen instead of "&".
    • Do not use 'cat' to read files, use ReadFiles tool instead
    • In order to check status of previous command, use status_check with empty command argument.
    • Only command is allowed to run at a time. You need to wait for any previous command to finish before running a new one.
    • Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again.
    • Do not send Ctrl-c before checking for status till 10 minutes or whatever is appropriate for the program to finish.
  3. ReadFiles

    • Read full file content of one or more files.
    • Provide absolute paths only (~ allowed)
    • Only if the task requires line numbers understanding:
      • You may extract a range of lines. E.g., /path/to/file:1-10 for lines 1-10. You can drop start or end like /path/to/file:1- or /path/to/file:-10
  4. ReadImage

    Read an image from the shell.

  5. FileWriteOrEdit

    • Writes or edits a file based on the percentage of changes.
    • Use absolute path only (~ allowed).
    • First write down percentage of lines that need to be replaced in the file (between 0-100) in percentage_to_change
    • percentage_to_change should be low if mostly new code is to be added. It should be high if a lot of things are to be replaced.
    • If percentage_to_change > 50, provide full file content in text_or_search_replace_blocks
    • If percentage_to_change <= 50, text_or_search_replace_blocks should be search/replace blocks.

    Instructions for editing files.

    Example

    Input file

    import numpy as np
    from impls import impl1, impl2
    
    def hello():
        "print a greeting"
    
        print("hello")
    
    def call_hello():
        "call hello"
    
        hello()
        print("Called")
        impl1()
        hello()
        impl2()
    
    

    Edit format on the input file

    <<<<<<< SEARCH
    from impls import impl1, impl2
    =======
    from impls import impl1, impl2
    from hello import hello as hello_renamed
    >>>>>>> REPLACE
    <<<<<<< SEARCH
    def hello():
        "print a greeting"
    
        print("hello")
    =======
    >>>>>>> REPLACE
    <<<<<<< SEARCH
    def call_hello():
        "call hello"
    
        hello()
    =======
    def call_hello_renamed():
        "call hello renamed"
    
        hello_renamed()
    >>>>>>> REPLACE
    <<<<<<< SEARCH
        impl1()
        hello()
        impl2()
    =======
        impl1()
        hello_renamed()
        impl2()
    >>>>>>> REPLACE
    

    SEARCH/REPLACE block Rules:

    • Every "SEARCH" section must EXACTLY MATCH the existing file content, character for character, including all comments, docstrings, whitespaces, etc.
    • Use multiple search/replace blocks in a single FileWriteOrEdit tool call to edit in a single file in multiple places from top to bottom (separate calls are slower).
    • Including multiple unique SEARCH/REPLACE blocks if needed.
    • Include enough and only enough lines in each SEARCH section to uniquely match each set of lines that need to change.
    • Keep SEARCH/REPLACE blocks concise.
    • Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.
    • Include just the changing lines, and a few surrounding lines (0-3 lines) if needed for uniqueness.
    • Other than for uniqueness, avoid including those lines which do not change in search (and replace) blocks. Target 0-3 non trivial extra lines per block.
    • Preserve leading spaces and indentations in both SEARCH and REPLACE blocks.
  6. ContextSave

    Saves provided description and file contents of all the relevant file paths or globs in a single text file.

    • Provide random 3 word unqiue id or whatever user provided.
    • Leave project path as empty string if no project path