claude-code-mcp

claude-code-mcp

Enables Claude Code to spawn child sessions for parallel, asynchronous task execution, allowing users to continue working while tasks run in the background.

Category
访问服务器

README

Claude Code MCP Async Server

Asynchronous MCP wrapper for Claude Code CLI

Enable Claude Code to spawn child Claude Code sessions for parallel task execution.

Features

  • ✅ Async execution - Start tasks in background, continue working
  • ✅ Multi-instance parallelism - Run multiple Claude Code sessions simultaneously
  • ✅ Automatic cleanup - No zombie processes
  • ✅ Zero config - Works out of the box
  • ✅ Cross-platform - Supports Windows, Linux, and macOS
  • ✅ CI/CD ready - GitHub Actions workflows included

Quick Start

🚀 Install with UVX

Zero configuration - just run:

uvx claudecode-mcp-async-windows

Configure Claude Code

Add to your ~/.claude/settings.json:

{
  "mcpServers": {
    "claude-code-mcp": {
      "command": "uvx",
      "args": ["claudecode-mcp-async-windows"],
      "env": {}
    }
  }
}

Restart Claude Code

Reload or restart Claude Code to load the MCP server.

Usage Examples

🚀 Async Execution (Game Changer!)

Start a long task and continue working immediately:

You:

Please analyze the entire project code and generate a comprehensive technical report

Claude: I'll analyze your entire project and generate a technical report. This is a large task, so I'll start it asynchronously...

✅ Task Started (Task ID: abc12345) You can continue working on other things while it runs in the background!

You: (Continue working immediately)

While the report is generating, help me write some unit tests

Claude: Sure! Let me write those unit tests for you...

You: (A few minutes later)

Can you check if the report task is finished?

Claude: ✅ Report Complete!

[View Detailed Technical Report]

  • Project structure analysis
  • Code quality assessment
  • Performance optimization recommendations
  • Security audit results

⚡ Parallel Execution

Run multiple tasks simultaneously:

You:

I need to do three things at once:

  1. Generate unit tests for utils.py
  2. Refactor database.py to use async/await
  3. Add type hints to all functions in api.py

Claude: I'll start all three tasks in parallel!

🔄 Task 1 Started (Task ID: task1) - Generating unit tests 🔄 Task 2 Started (Task ID: task2) - Refactoring database code 🔄 Task 3 Started (Task ID: task3) - Adding type hints

All tasks are running in parallel...

You: (Later)

Are all three tasks finished?

Claude: ✅ All Complete!

  • ✅ Task 1: Unit tests for utils.py generated
  • ✅ Task 2: database.py refactored to async mode
  • ✅ Task 3: Type hints added to api.py functions

🎯 Quick Sync Tasks

For simple immediate tasks:

You:

Write a Python function to validate email addresses

Claude:

import re

def validate_email(email):
    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
    return re.match(pattern, email) is not None

# Usage examples
print(validate_email("user@example.com"))  # True
print(validate_email("invalid-email"))    # False

✅ Task Complete!

Why Async?

Problem: Claude Code blocks the parent session while running.

Solution: This MCP server spawns child Claude Code processes that run in the background.

Benefits:

  • 🚀 Start a task and continue working immediately
  • ⚡ Run multiple tasks in parallel
  • 🎯 No blocking, no waiting
  • 🧹 Automatic process cleanup

Troubleshooting

Server not showing up?

  • Use absolute path in config
  • Linux/macOS: Run chmod +x claudecode_mcp_async_server.py
  • Restart Claude Code

Task stuck in "running"?

  • Wait a moment, large tasks take time
  • Check task files:
    • Linux/macOS: ls -la /tmp/claude_code_tasks/
    • Windows: dir %TEMP%\claude_code_tasks\
  • View logs:
    • Linux/macOS: tail -f /tmp/claude_code_mcp_debug.log
    • Windows: type %TEMP%\claude_code_mcp_debug.log

Platform-specific notes:

  • Windows: Automatic process cleanup (no zombie processes)
  • POSIX: Uses SIGCHLD handler for process cleanup
  • All platforms: Uses platform-appropriate temp directories

Requirements

  • Python 3.6+
  • Claude Code CLI installed

Development

Building from Source

Using uv (recommended):

# Install uv if you haven't already
pip install uv

# Build the package
uv build

# Install locally
uv pip install dist/*.whl --system

GitHub Actions

This project includes automated workflows:

  1. Test Workflow (.github/workflows/test.yml)

    • Runs on: Windows, Linux, macOS
    • Python versions: 3.8, 3.9, 3.10, 3.11, 3.12
    • Triggered on: push to main/develop/claude branches, pull requests
    • Actions:
      • Build with uv
      • Run import tests
      • Lint with flake8, black, isort
  2. Publish Workflow (.github/workflows/publish.yml)

    • Builds distribution packages using uv
    • Publishes to PyPI on release
    • Uploads to GitHub Releases
    • Supports TestPyPI for testing

Publishing to PyPI

Option 1: Automatic (GitHub Release)

  1. Create a new release on GitHub
  2. Workflow automatically builds and publishes to PyPI

Option 2: Manual (TestPyPI)

  1. Go to Actions → Publish to PyPI
  2. Run workflow manually
  3. Set test_pypi to true for TestPyPI

Setting up PyPI Publishing:

  1. Configure trusted publishing in your PyPI project settings
  2. Add environment pypi to your GitHub repository
  3. No API tokens needed (uses OIDC)

License

MIT License


Questions? Open an issue on GitHub.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选