Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables AI agents to interact programmatically with Claude Code CLI, managing sessions, streaming outputs, and handling permission requests.

README.md

Claude Code MCP

An MCP (Model Context Protocol) server that wraps the Claude Code CLI, enabling other AI agents to interact with Claude Code programmatically.

![npm version](https://www.npmjs.com/package/@jawkjiang/claude-code-mcp)

Features

  • Session Management: Start, continue, and manage multiple conversation sessions
  • Streaming Output: Real-time output from Claude Code tasks
  • Interrupt Support: Stop running tasks at any time (like Ctrl+C)
  • Permission Delegation: When Claude Code needs permission, the outer agent can approve, deny, or redirect
  • Progress Monitoring: Check task progress and get partial outputs

Installation

From npm (Recommended)

npm install -g @jawkjiang/claude-code-mcp

From source

git clone https://github.com/jawkjiang/claude-code-mcp.git
cd claude-code-mcp
npm install
npm run build

Prerequisites

Configuration

Add to your ~/.mcp.json:

Using npx (Recommended)

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

Using global install

{
  "mcpServers": {
    "claude-code": {
      "command": "claude-code-mcp"
    }
  }
}

Using local build

{
  "mcpServers": {
    "claude-code": {
      "command": "node",
      "args": ["/path/to/claude-code-mcp/dist/index.js"]
    }
  }
}

Available Tools

| Tool | Description | |------|-------------| | chat | Start a new conversation or continue an existing session | | respond | Respond to permission requests: approve, deny, or redirect with new instructions | | interrupt | Stop a running task (like Ctrl+C) | | get_output | Get current output/progress from a session | | list_sessions | List all active sessions | | close_session | Close and cleanup a session | | get_version | Get Claude Code CLI version |

Usage Examples

Basic Chat

{
  "tool": "chat",
  "params": {
    "message": "Create a hello world Python script",
    "workingDirectory": "/path/to/project"
  }
}

Permission Handling

When Claude Code needs permission, you'll receive:

{
  "status": "awaiting_permission",
  "sessionId": "abc-123",
  "pendingPermission": {
    "tool": "Bash",
    "action": "rm -rf /tmp/test",
    "description": "Delete temporary directory"
  },
  "currentOutput": "I need to clean up the temp directory...",
  "message": "Use 'respond' tool to approve, deny, or redirect."
}

You can then respond with:

Approve: ``json { "tool": "respond", "params": { "sessionId": "abc-123", "action": "approve" } } ``

Deny: ``json { "tool": "respond", "params": { "sessionId": "abc-123", "action": "deny" } } ``

Redirect (provide alternative instructions): ``json { "tool": "respond", "params": { "sessionId": "abc-123", "action": "redirect", "message": "Don't delete the directory. Instead, just remove the .tmp files inside it." } } ``

Interrupt a Task

{
  "tool": "interrupt",
  "params": {
    "sessionId": "abc-123"
  }
}

Architecture

Outer Agent                    claude-code-mcp                Claude Code CLI
    │                              │                              │
    │── chat(message) ────────────>│                              │
    │                              │──── spawn process ──────────>│
    │                              │                              │
    │<── awaiting_permission ─────│<── permission request ───────│
    │                              │                              │
    │── respond(action) ──────────>│                              │
    │   - approve                  │──── send response ──────────>│
    │   - deny                     │                              │
    │   - redirect(new_message)    │                              │
    │                              │                              │
    │<── completed ───────────────│<── task complete ────────────│

Permission Checkpoint Philosophy

Permission requests are not just approve/deny gates - they are audit and steering points where the outer agent can:

  1. Review what Claude Code is doing
  2. Approve and let it continue
  3. Deny and stop the current operation
  4. Redirect with new instructions ("No, do this instead...")

This gives the outer agent the same level of control a human would have when using Claude Code interactively.

License

MIT

Author

Created with Claude Code

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Developer Tools servers.