DISCOVER THE FUTURE OF AI AGENTS

Claude Code MCP Server

Added Feb 22, 2026
Agent & Tooling
Open Source
TypeScriptNode.jsModel Context ProtocolAI AgentsCLIAgent & ToolingDeveloper Tools & CodingProtocol, API & Integration

An MCP server that wraps Claude Code CLI as a tool, enabling clients like Cursor/Windsurf/Claude Desktop to invoke Claude Code in one-shot mode with permissions bypassed automatically.

Overview#

Claude Code MCP Server is an MCP (Model Context Protocol) server that wraps Anthropic's official Claude Code CLI as an MCP tool (claude_code), enabling any MCP-compatible client to leverage Claude Code's full capabilities. It runs Claude Code with the --dangerously-skip-permissions flag, eliminating interactive permission confirmation interruptions.

Core Capabilities#

Exposed Tool: claude_code#

Parameters:

  • prompt (string, required): The complete prompt to send to Claude Code
  • options (object, optional):
    • tools (array of strings, optional): Specific Claude tools to enable, e.g., Bash, Read, Write

Key Features#

FeatureDescription
Auto Permission BypassUses --dangerously-skip-permissions flag to execute all operations without interactive confirmation
Working Directory ParsingAutomatically extracts "Your work folder is..." instructions from prompt to set CWD
Extended Timeout30-minute default timeout, suitable for complex tasks
Custom CLI PathSupports specifying Claude CLI binary name or absolute path via environment variables
Debug ModeEnable verbose logging via MCP_CLAUDE_DEBUG environment variable

Problems Solved#

  1. Poor File Editing Quality: Claude/Windsurf/Cursor often make mistakes when editing files; Claude Code is faster and more accurate
  2. Context Waste: Complex operations can be batched through Claude Code, reducing main agent compaction frequency
  3. Cost Optimization: Basic tasks like file operations and Git don't consume expensive model tokens from main conversation
  4. Capability Boundary: Claude Code can perform system-level operations that Cursor/Windsurf cannot

Use Cases#

  • Code generation, analysis, and refactoring
  • File system operations (create, read, edit, manage)
  • Version control (Git)
  • Terminal command execution
  • Web search and summarization
  • Complex multi-step workflows (releases, changelog updates)
  • Fixing syntax error files
  • GitHub interactions (create PRs, check CI status)

Environment Variables#

VariableDefaultDescription
CLAUDE_CLI_NAMEclaudeOverride Claude CLI binary name
CLAUDE_CLI_PATHAuto-detectedAbsolute path to Claude CLI executable
MCP_CLAUDE_DEBUGfalseEnable debug logging

Quick Start#

Prerequisites#

  • Node.js v20 or higher
  • Claude CLI installed locally

Install Claude CLI#

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

⚠️ Important: You must manually run claude --dangerously-skip-permissions once to accept the usage terms

MCP Client Configuration#

Add to mcp.json or mcp_config.json:

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

Configuration File Paths#

ClientmacOSWindowsLinux
Cursor~/.cursor/mcp.json%APPDATA%\Cursor\mcp.json~/.config/cursor/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json%APPDATA%\Codeium\windsurf\mcp_config.json~/.config/.codeium/windsurf/mcp_config.json

Example Usage#

{
  "toolName": "claude_code:claude_code",
  "arguments": {
    "prompt": "Your work folder is /Users/dev/myproject\n\nRefactor the function foo in main.py to be async.",
    "options": {
      "tools": ["Bash", "Read", "Write"]
    }
  }
}

Prompt Examples#

Code Generation:

"Generate a Python script to parse CSV data and output JSON."

File Operations:

"Your work folder is /Users/steipete/my_project
Create a new file named 'config.yml' in the 'app/settings' directory..."

Git Operations:

"Your work folder is /Users/steipete/my_project
1. Stage 'src/main.java'.
2. Commit with message 'feat: Implement user authentication'.
3. Push to 'develop' branch."

Related Projects

View All

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.