### Installing Python and uv in WSL Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md These bash commands are used to install Python 3.12 and the `uv` package manager within a Windows Subsystem for Linux (WSL) distribution. `sudo apt update` refreshes package lists, `sudo apt install python3.12` installs Python, and the `curl` command downloads and executes the `uv` installer script. ```bash # Install Python 3.12 (if not already installed) sudo apt update sudo apt install python3.12 # Install uv curl -sSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Configuring codemcp for Windows in Claude Desktop Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This JSON configuration snippet sets up the 'codemcp' server for Claude Desktop on Windows. It specifies the command to execute `uvx.exe` from the user's local bin directory, along with arguments to install `codemcp` from the `prod` branch of its GitHub repository. ```json { "mcpServers": { "codemcp": { "command": "C:\\Users\\\\.local\\bin\\uvx.exe", "args": [ "--from", "git+https://github.com/ezyang/codemcp@prod", "codemcp" ] } } } ``` -------------------------------- ### Example Grep Command for LLM Affordance - JSON Source: https://github.com/ezyang/codemcp/blob/main/TODO.md This JSON object defines an example `Grep` command structure intended for LLM (Large Language Model) integration. It specifies the command type, a regex pattern to search for, and the file path where the search should be executed. This demonstrates how the LLM can be instructed to perform specific file operations. ```JSON { "command": "Grep", "pattern": "self\\.assertIn.*normalized_result", "path": "/Users/ezyang/Dev/codemcp/test/test_mcp_e2e.py" } ``` -------------------------------- ### Configuring codemcp for macOS/Linux in Claude Desktop Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This JSON configuration snippet sets up the 'codemcp' server for Claude Desktop on macOS or Linux. It specifies the command to execute `uvx` from the user's local bin directory, along with arguments to install `codemcp` from the `prod` branch of its GitHub repository. ```json { "mcpServers": { "codemcp": { "command": "/Users//.local/bin/uvx", "args": [ "--from", "git+https://github.com/ezyang/codemcp@prod", "codemcp" ] } } } ``` -------------------------------- ### Running codemcp Server Source: https://github.com/ezyang/codemcp/blob/main/README.md These commands demonstrate how to start the codemcp server using `uvx`, fetching the `prod` branch from the GitHub repository. Variations include specifying a custom port or binding to a specific host for remote access, enabling Claude Desktop or the `claude-mcp` extension to connect and interact with your local codebase. ```Shell uvx --from git+https://github.com/ezyang/codemcp@prod codemcp serve ``` ```Shell uvx --from git+https://github.com/ezyang/codemcp@prod codemcp serve --port 1234 ``` ```Shell uvx --from git+https://github.com/ezyang/codemcp@prod codemcp serve --host 100.101.102.103 ``` -------------------------------- ### Globally Installing codemcp with pip Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This command globally installs the latest `codemcp` version using `pip` directly from its GitHub repository's `prod` branch. This method requires a Python 3.12+ environment and should be used with caution to avoid dependency conflicts. ```bash pip install git+https://github.com/ezyang/codemcp@prod ``` -------------------------------- ### Upgrading Global pip codemcp Installation Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This command upgrades a globally installed `codemcp` to its latest version from the `prod` branch of its GitHub repository using `pip install --upgrade`. This is necessary to receive updates when using the global pip installation method. ```bash pip install --upgrade git+https://github.com/ezyang/codemcp@prod ``` -------------------------------- ### Configuring codemcp Command for Local Development (JSON) Source: https://github.com/ezyang/codemcp/blob/main/CONTRIBUTING.md This JSON snippet defines a configuration for running the `codemcp` project using a specific Python virtual environment. It specifies the path to the Python interpreter within a `uv` virtual environment and passes `-m codemcp` as arguments to run the `codemcp` module. This setup is recommended for local development to connect to the project. ```JSON "codemcp": { "command": "/Users/ezyang/Dev/codemcp-prod/.venv/bin/python", "args": [ "-m", "codemcp" ] } ``` -------------------------------- ### Configuring Project Prompt in codemcp.toml (TOML) Source: https://github.com/ezyang/codemcp/blob/main/ARCHITECTURE.md This snippet defines the `project_prompt` string within the `codemcp.toml` file. This string is included in system prompts to provide project-specific instructions to Claude, guiding its behavior based on the project's requirements. ```TOML project_prompt = """ Project-specific instructions for Claude go here. """ ``` -------------------------------- ### Configuring Project Prompt and Commands in codemcp.toml Source: https://github.com/ezyang/codemcp/blob/main/README.md This TOML configuration demonstrates how to set a `project_prompt` which is loaded during project initialization, and defines the `commands` section for `format` and `test` tools. The `project_prompt` can guide the LLM's initial behavior, while `commands` specify external scripts for automated tasks. ```toml project_prompt = """ Before beginning work on this feature, write a short haiku. Do this only once. """ [commands] format = ["./run_format.sh"] test = ["./run_test.sh"] ``` -------------------------------- ### Configuring Claude Desktop for Global pip codemcp Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This JSON configuration snippet integrates a globally installed `codemcp` with Claude Desktop. It sets the `command` to `python` and uses the `-m codemcp` argument to run `codemcp` as a Python module, assuming it's accessible in the global Python environment. ```json { "mcpServers": { "codemcp": { "command": "python", "args": ["-m", "codemcp"] } } } ``` -------------------------------- ### Running codemcp Server with Inspector Source: https://github.com/ezyang/codemcp/blob/main/README.md This shell command starts the `codemcp` server in development mode with an inspector. It sets the `PYTHONPATH` to the current directory, allowing Python to find the `mcp` module, and then executes the main `codemcp` script, enabling debugging and inspection capabilities. ```bash PYTHONPATH=. mcp dev codemcp/__main__.py ``` -------------------------------- ### Initializing codemcp with WSL Project Path Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This command demonstrates how to initialize codemcp within Claude Desktop when using a WSL configuration. It specifies a path to a project located directly within the WSL filesystem, allowing codemcp to access Linux-based project files. ```plaintext Initialize codemcp with /home/NameOfWSLUser/project_in_wsl_to_work_on ``` -------------------------------- ### Detailed Command Configuration with Documentation in codemcp.toml Source: https://github.com/ezyang/codemcp/blob/main/README.md This TOML snippet illustrates a verbose syntax for configuring a specific command, `test`, within `codemcp.toml`. It defines the `command` to execute (`./run_test.sh`) and provides a `doc` string, which can be used to inform the LLM about the command's usage and accepted arguments, such as a pytest-style test selector. ```toml [commands.test] command = ["./run_test.sh"] doc = "Accepts a pytest-style test selector as an argument to run a specific test." ``` -------------------------------- ### Configuring codemcp for WSL in Claude Desktop Source: https://github.com/ezyang/codemcp/blob/main/INSTALL.md This JSON configuration snippet enables Claude Desktop to run the 'codemcp' server within a Windows Subsystem for Linux (WSL) environment. It uses `wsl.exe` to execute a bash command that launches `uvx` from the WSL user's home directory, pulling `codemcp` from its `prod` branch. ```json { "mcpServers": { "codemcp": { "command": "wsl.exe", "args": [ "bash", "-c", "/home/NameOfWSLUser/.local/bin/uvx --from git+https://github.com/ezyang/codemcp@prod codemcp" ] } } } ``` -------------------------------- ### Initializing codemcp in Claude Desktop Project Instructions Source: https://github.com/ezyang/codemcp/blob/main/README.md This instruction is to be placed in the Project Instructions within Claude Desktop. It tells `codemcp` to initialize itself with the specified project directory, `$PROJECT_DIR`, allowing the agent to begin interacting with the Git repository. ```bash Initialize codemcp with $PROJECT_DIR ``` -------------------------------- ### Configuring Basic Commands in codemcp.toml Source: https://github.com/ezyang/codemcp/blob/main/README.md This TOML snippet configures the `format` and `test` commands within the `codemcp.toml` file. These commands specify shell scripts (`./run_format.sh`, `./run_test.sh`) that `codemcp` can execute for code formatting and testing, respectively. They are run automatically by the agent when relevant actions are performed. ```toml format = ["./run_format.sh"] test = ["./run_test.sh"] ``` -------------------------------- ### Configuring claude-mcp Extension URL Source: https://github.com/ezyang/codemcp/blob/main/README.md This URL is used to configure the `claude-mcp` browser extension, allowing it to establish a connection with the locally running codemcp SSE server. It's crucial to ensure the port in the URL matches the port codemcp is listening on for successful communication. ```URL http://127.0.0.1:8000/sse ``` -------------------------------- ### Defining Format Command in codemcp.toml (TOML) Source: https://github.com/ezyang/codemcp/blob/main/ARCHITECTURE.md This snippet illustrates how to define a `format` command within the `commands` section of `codemcp.toml`. Commands are specified as arrays of strings that are joined and executed in a shell, allowing codemcp to run external scripts like `./run_format.sh` for code formatting. ```TOML [commands] format = ["./run_format.sh"] ``` -------------------------------- ### Running Type Checking with pyright (Shell) Source: https://github.com/ezyang/codemcp/blob/main/CONTRIBUTING.md This shell command executes the `run_typecheck.sh` script to perform type checking on the project. It ensures that all code changes adhere to the strict type safety rules enforced by `pyright`, as configured in `pyproject.toml`. This step is crucial for maintaining code quality and preventing type-related errors. ```Shell ./run_typecheck.sh ``` -------------------------------- ### Configuring Global Logging Verbosity for codemcp Source: https://github.com/ezyang/codemcp/blob/main/README.md This TOML snippet configures the global logging verbosity for `codemcp` in the `~/.codemcprc` file. It sets the `verbosity` level for the `logger` section, allowing users to control the detail of logs written to `~/.codemcp/codemcp.log`. Valid levels include DEBUG, INFO, WARNING, ERROR, or CRITICAL. ```toml [logger] verbosity = "INFO" # Can be DEBUG, INFO, WARNING, ERROR, or CRITICAL ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.