CodeMCP

The CodeMCP MCP Server transforms Claude Desktop into a powerful pair programming assistant that directly edits files and runs tests on your local codebase.

Features

  • πŸ€– Direct File Editing: Claude can modify files in your codebase without manual copy-paste
  • πŸ”§ Automated Test Execution: Run tests and formatters as part of the development workflow
  • πŸ’° Subscription-Based: Works with Claude Pro’s flat-rate pricing model
  • πŸ”„ Auto-Accept by Default: Agent operates autonomously with minimal interruption
  • πŸ”’ Restricted Shell Access: Predeclared commands in configuration prevent arbitrary execution
  • πŸ“ Git Version Control: All AI edits are automatically committed for easy rollback
  • πŸ› οΈ IDE Agnostic: Compatible with any text editor or IDE
  • 🌐 Remote Operation: Can run on remote servers via Tailscale
  • πŸ”§ Custom Commands: Configure project-specific formatters and test runners

Use Cases

  • Feature Implementation: Ask Claude to implement new features end-to-end, from initial code to passing tests
  • Bug Fixes: Describe failing tests or issues and let Claude diagnose and fix problems automatically
  • Code Refactoring: Request structural changes to improve code organization while maintaining functionality
  • Test-Driven Development: Have Claude write tests first, then implement code to make them pass
  • Code Formatting: Automatically apply consistent formatting across your entire codebase
  • Legacy Code Updates: Modernize old codebases by describing desired improvements

Installation

1. Install Prerequisites

    • Install uv package manager
    • Install Git if not already present

    2. Install Browser Extension

      • Add claude-mcp to your browser
      • This enables SSE MCP server connections directly from the Claude website

      3. Run codemcp Server

           uvx --from git+https://github.com/ezyang/codemcp@prod codemcp serve
        • Add --port 1234 for custom port
        • Use @main instead of @prod for latest development version
        • Use @0.3.0 for specific release versions

        4. Configure Browser Extension

          • Set URL to: http://127.0.0.1:8000/sse
          • Adjust port if you specified a different one

          5. Verify Connection

            • Look for “[MCP codemcp] SSE connection opened” in browser console
            • Ask Claude what tools are available to confirm connection

            Configuration

            Create a codemcp.toml file in your Git repository root:

            project_prompt = """
            Custom instructions for your project go here.
            """
            [commands]
            format = ["./run_format.sh"]
            test = ["./run_test.sh"]

            Configuration Options:

            • project_prompt: Custom instructions loaded when initializing projects
            • commands.format: Runs automatically after every file edit
            • commands.test: Available for Claude to run when needed
            • Custom commands can include detailed documentation:
              [commands.test]
              command = ["./run_test.sh"]
              doc = "Accepts a pytest-style test selector as an argument to run a specific test."

            Usage

            1. Initialize Project: Create a Claude Project with instruction: “Initialize codemcp with $PROJECT_DIR”
            2. Request Changes: Describe what you want Claude to implement or fix
            3. Review Commits: Each chat generates a Git commit that gets amended as work progresses
            4. Iterate: Continue requesting changes or refinements

            Advanced Setup

            Remote Operation (Tailscale users):

            uvx --from git+https://github.com/ezyang/codemcp@prod codemcp serve --host 100.101.102.103

            Replace with your Tailscale IP address.

            Global Configuration (~/.codemcprc):

            [logger]
            verbosity = "INFO"  # DEBUG, INFO, WARNING, ERROR, or CRITICAL

            Troubleshooting

            Development Mode:

            PYTHONPATH=. mcp dev codemcp/__main__.py

            Log Location: ~/.codemcp/codemcp.log

            Verify MCP Connection: Ask Claude “What tools do you have available?” to confirm codemcp tools are loaded.

            FAQs

            Q: How does codemcp differ from Claude Code or Cursor?
            A: codemcp works with Claude Pro’s subscription pricing, operates with auto-accept by default, and remains IDE agnostic. It uses Git versioning for all changes and restricts shell access through predeclared commands.

            Q: Can I use codemcp with Claude Max instead of Claude Pro?
            A: Yes, though Claude Code might be more suitable for Claude Max users.

            Q: What happens if Claude makes unwanted changes?
            A: All edits are Git versioned automatically. You can roll back changes on a fine-grained basis using standard Git commands.

            Q: How do I prevent Claude from running dangerous commands?
            A: Shell access is restricted to commands predeclared in your codemcp.toml file. Claude cannot execute arbitrary shell commands.

            Q: Can I run codemcp on a remote server?
            A: Yes, use Tailscale for secure remote access. Never bind to 0.0.0.0 as this creates security risks.

            Latest MCP Servers

            Notion

            Notion's official MCP Server allows you to interact with Notion workspaces through the Notion API.

            Log Mcp

            An MCP server that provides 7 tools for log analysis, including error fingerprinting, pattern comparison, and ML classification.

            Apple

            An MCP package that provides AI assistants with direct access to Notes, Messages, Mail, Contacts, Reminders, Calendar, and Maps via AppleScript and EventKit.

            View More MCP Servers >>

            Featured MCP Servers

            Notion

            Notion's official MCP Server allows you to interact with Notion workspaces through the Notion API.

            Claude Peers

            An MCP server that enables Claude Code instances to discover each other and exchange messages instantly via a local broker daemon with SQLite persistence.

            Excalidraw

            Excalidraw's official MCP server that streams interactive hand-drawn diagrams to Claude, ChatGPT, and VS Code with smooth camera control and fullscreen editing.

            More Featured MCP Servers >>

            FAQs

            Q: What exactly is the Model Context Protocol (MCP)?

            A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.

            Q: How is MCP different from OpenAI's function calling or plugins?

            A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.

            Q: Can I use MCP with frameworks like LangChain?

            A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.

            Q: Why was MCP created? What problem does it solve?

            A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.

            Q: Is MCP secure? What are the main risks?

            A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.

            Q: Who is behind MCP?

            A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.

            Get the latest & top AI tools sent directly to your email.

            Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!