Back to MCP Catalog

Claude Code MCP Server

Developer ToolsPython
A powerful code assistant with file operations, code analysis, and command execution capabilities
Available Tools

read

Read file contents with line numbers, offset, and limit capabilities

write

Create or overwrite files

edit

Make line-based edits to text files

directory_tree

Get a recursive tree view of directories

get_file_info

Get metadata about a file or directory

grep

Fast pattern search in files with ripgrep integration for best performance

grep_ast

AST-aware code search showing matches within functions, classes and other code structures

shell

Execute shell commands with proper security controls

dispatch_agent

Delegate complex tasks to specialized sub-agents that can work concurrently

Claude Code is an MCP implementation that provides Claude with capabilities similar to Claude Code. It enables seamless code understanding, modification, and execution through a comprehensive set of tools. With features like file operations, code discovery, and enhanced command execution, Claude can effectively analyze codebases, make targeted edits, and run commands with proper security controls.

Installation

To install the Claude Code MCP server, follow these steps:

  1. Ensure you have Python 3.13 or later installed on your system.

  2. Install the package using pip:

    pip install mcp-claude-code
    
  3. Configure your MCP client (like Claude Desktop) by adding the following to your configuration:

    "mcpServers": {
      "claude-code": {
        "command": "python",
        "args": [
          "-m",
          "mcp_claude_code",
          "--directory",
          "PATH_TO_YOUR_PROJECT_DIRECTORY"
        ]
      }
    }
    

    Replace PATH_TO_YOUR_PROJECT_DIRECTORY with the absolute path to the project directory you want Claude to work with.

Usage

Once installed, you can use Claude Code through any compatible MCP client. The server provides Claude with capabilities to:

  1. Analyze Code: Claude can read files, search for patterns, and understand code structure to provide insights and recommendations.

  2. Modify Code: Claude can make targeted edits to files, create new files, and implement requested changes with proper permission handling.

  3. Execute Commands: Run shell commands, scripts, and programs with enhanced error handling and security controls.

  4. Discover Code: Find relevant files and code patterns across your project using high-performance search tools.

  5. Delegate Tasks: Complex operations can be delegated to specialized sub-agents that work concurrently.

Configuration

Claude Code can be configured through command-line arguments when starting the server:

  • --directory: Specify the project directory (required)
  • --host: Host address to bind the server (default: 127.0.0.1)
  • --port: Port to run the server on (default: 8000)
  • --model: LLM model to use for agent operations (default: claude-3-opus-20240229)
  • --api-key: API key for the LLM provider
  • --api-base: API base URL for the LLM provider
  • --debug: Enable debug logging

Example:

python -m mcp_claude_code --directory /path/to/project --port 8080 --model claude-3-sonnet-20240229 --debug

Security Considerations

Claude Code implements several security measures:

  1. Permission Management: File operations require explicit permissions.
  2. Input Validation: All inputs are validated to prevent command injection.
  3. Path Restrictions: File operations are restricted to the specified project directory.
  4. Execution Controls: Command execution is controlled and monitored.

Always review code changes suggested by Claude before implementing them in production environments.

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.