Claude Code MCP server

Provides a streamlined interface for executing complex coding tasks including file operations, Git commands, and web searches without permission interruptions by automatically bypassing constraints.
Back to servers
Setup instructions
Provider
Peter Steinberger
Release date
May 14, 2025
Language
Python
Stats
710 stars

The Claude Code MCP Server is a specialized tool that allows running Claude Code in one-shot mode with automatically bypassed permissions. It provides a streamlined interface for Claude AI models to directly execute code editing tasks, file operations, and other system commands without permission interruptions.

Installation

Prerequisites

  • Node.js v20 or later
  • Claude CLI already installed and working

Setting Up the MCP Server

The simplest way to install and use the server is via npx:

{
  "claude-code-mcp": {
    "command": "npx",
    "args": [
      "-y",
      "@steipete/claude-code-mcp@latest"
    ]
  }
}

If you need to use a custom Claude CLI binary, specify it with an environment variable:

{
  "claude-code-mcp": {
    "command": "npx",
    "args": [
      "-y",
      "@steipete/claude-code-mcp@latest"
    ],
    "env": {
      "CLAUDE_CLI_NAME": "claude-custom"
    }
  }
}

Important First-Time Setup

Before using the MCP server, you must run the Claude CLI manually once with the skip permissions flag:

npm install -g @anthropic-ai/claude-code
claude --dangerously-skip-permissions

Follow the prompts to accept the terms. This is a one-time requirement that enables the MCP server to use the flag non-interactively afterward.

Note: macOS might request folder permissions the first time the tool runs. The first run may fail, but subsequent runs should work correctly.

Configuration

Environment Variables

  • CLAUDE_CLI_NAME: Override the Claude CLI binary name or provide an absolute path (default: claude)
  • MCP_CLAUDE_DEBUG: Enable debug logging (set to true for verbose output)

Client Configuration Files

Cursor

Cursor uses mcp.json:

  • macOS: ~/.cursor/mcp.json
  • Windows: %APPDATA%\\Cursor\\mcp.json
  • Linux: ~/.config/cursor/mcp.json

Windsurf

Windsurf uses mcp_config.json:

  • macOS: ~/.codeium/windsurf/mcp_config.json
  • Windows: %APPDATA%\\Codeium\\windsurf\\mcp_config.json
  • Linux: ~/.config/.codeium/windsurf/mcp_config.json

Using the Claude Code Tool

The MCP server provides one main tool:

claude_code

Executes prompts directly using the Claude Code CLI with permissions bypassed.

Arguments:

  • prompt (string, required): The prompt to send to Claude Code
  • options (object, optional):
    • tools (array of strings, optional): Specific Claude tools to enable

Example MCP Request:

{
  "toolName": "claude_code:claude_code",
  "arguments": {
    "prompt": "Refactor the function foo in main.py to be async."
  }
}

Key Use Cases

Code Generation and Refactoring

"Generate a Python script to parse CSV data and output JSON."
"Analyze my_script.py for potential bugs and suggest improvements."

File System Operations

"Your work folder is /Users/username/my_project

Create a new file named 'config.yml' in the 'app/settings' directory with the following content:
port: 8080
database: main_db"

Version Control

"Your work folder is /Users/username/my_project

1. Stage the file 'src/main.java'.
2. Commit the changes with the message 'feat: Implement user authentication'.
3. Push the commit to the 'develop' branch on origin."

Running Terminal Commands

"Your work folder is /Users/username/my_project/frontend

Run the command 'npm run build'."

Complex Multi-Step Workflows

"Your work folder is /Users/username/my_project

Follow these steps:
1. Update the version in package.json to 2.5.0.
2. Add a new section to CHANGELOG.md for version 2.5.0 with the heading '### Added' and list 'New feature X'.
3. Stage package.json and CHANGELOG.md.
4. Commit with message 'release: version 2.5.0'.
5. Push the commit.
6. Create and push a git tag v2.5.0."

IMPORTANT: Always include the current working directory context in your prompts for file system or git operations (e.g., "Your work folder is /path/to/project").

Troubleshooting

  • "Command not found" (claude-code-mcp): Ensure npm global bin directory is in your PATH or use npx
  • "Command not found" (claude): Verify Claude CLI is installed correctly with claude/doctor
  • Permissions Issues: Confirm you've completed the "Important First-Time Setup" step
  • JSON Errors: If MCP_CLAUDE_DEBUG is true, try setting it to false for normal operation
  • ESM/Import Errors: Update to Node.js v20 or later

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "claude-code-mcp" '{"command":"npx","args":["-y","@steipete/claude-code-mcp@latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "claude-code-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@steipete/claude-code-mcp@latest"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "claude-code-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@steipete/claude-code-mcp@latest"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later