Token导航 LogoToken导航TokenDH.com
Claude Tools MCP logo
AI代理stdio官方级别未说明来源级核验

Claude Tools MCP

MCP Server

一个MCP服务器,通过将Claude Code的原生工具包装为MCP工具,使子代理能够生成其他子代理,支持复杂的多代理工作流。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
AI代理PythonClaude工作流自动化Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Kirchlive

提供方

Kirchlive

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e .

详细介绍

claude-tools-mcp 翻译为中文是“Claude 工具 MCP”(注:这里的“MCP”可能是一个特定项目、模块或配置的缩写,具体含义需根据上下文确定,但直接翻译为“MCP”保持了原样)。如果“MCP”在特定领域有固定含义,应替换为相应中文术语

![License](https://opensource.org/licenses/Apache-2.0) ](https://github.com/Kirchlive/claude-tools-mcp) ![Python](https://www.python.org/downloads/)

一个MCP服务器,它通过模型上下文协议(Model Context Protocol)暴露Claude Code的原生工具,使Claude Code子代理能够生成其他子代理。

目录

概述

这个项目提供了一个使用(某种技术或语言)构建的MCP服务器 FastMCP 解决了Claude Code中的一个特定限制: 子代理不能生成其他子代理 因为他们无法访问Claude Code的任务工具。

通过将Claude Code的原生工具封装为MCP工具,该服务器创建了一个代理层,使得能够嵌套生成智能体并实现高级的多智能体工作流。

为何此现象存在

问题

Claude Code允许代理使用任务工具生成子代理。然而,子代理本身无法访问任务工具,因此无法生成更多的子代理。这一限制了代理层次结构的深度以及多代理协同模式的复杂性。

解决方案

这个MCP服务器将Claude Code的原生工具(任务、待办事项编写、阅读、编辑、Bash等)作为MCP工具提供。当子代理连接到这个MCP服务器时,它们可以通过MCP协议访问这些工具,从而有效地实现:

  • 嵌套代理生成子代理可以生成它们自己的子代理
  • 深度智能体层级结构创建复杂的多级代理工作流
  • 高级编排构建复杂的智能体协调模式

特点/功能

当前(最小可行性产品)

  • 代理生成工具通过编程创建新的Claude Code子代理

- 生成格式正确的 .claude/agents/*.md 文件 - 可配置的代理描述和系统提示 - 针对每个代理的工具访问控制 - 带有代理元数据的YAML前置信息

计划中(MVP之后)

  • 额外的工具包装器全部:写、读、编辑、评论,以及更多
  • 代理管理列出、查询并终止已启动的代理
  • 代理通信代理间消息传递和共享状态
  • 资源代理状态追踪、指标和历史记录
  • 高级图案编曲者(或调度器)、评估优化器、并行化

安装

先决条件

  • Python 3.11 或更高版本
  • UV包管理器 (推荐)
  • 克劳德代码(用于测试和使用)

安装依赖项

# Clone the repository
git clone https://github.com/Kirchlive/claude-tools-mcp.git
cd claude-tools-mcp

# Install with UV (recommended)
uv sync

# Or with pip
pip install -e .

快速入门

1. 配置Claude代码

在您的Claude代码配置中添加MCP服务器:

选项A:项目特定的 (.claude/mcp_servers.json):

{
  "mcpServers": {
    "claude-tools": {
      "command": "uv",
      "args": ["run", "python", "src/mcp_server/server.py"],
      "cwd": "/absolute/path/to/claude-tools-mcp",
      "env": {
        "PYTHONPATH": "/absolute/path/to/claude-tools-mcp",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

选项B:全球 (~/.claude/mcp_servers.json):

{
  "mcpServers": {
    "claude-tools": {
      "command": "uv",
      "args": ["run", "python", "src/mcp_server/server.py"],
      "cwd": "/absolute/path/to/claude-tools-mcp",
      "env": {
        "PYTHONPATH": "/absolute/path/to/claude-tools-mcp",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

2. 使用MCP Inspector进行测试

# Install and run MCP Inspector
npx @modelcontextprotocol/inspector

# Open browser at http://localhost:5173
# Connect to: python src/mcp_server/server.py

3. 在Claude代码中的使用

请求Claude生成一个代理:

Please use the spawn_agent tool to create a code specialist agent
that can implement Python functions with proper error handling and tests.

代理将在 .claude/agents/ 并且可立即投入使用。

使用方法/用途

生成一个子代理

spawn_agent 该工具创建了一个新的Claude Code子代理:

# Tool parameters
{
  "name": "code-specialist",
  "description": "Expert in writing clean, tested Python code",
  "system_prompt": """You are an expert Python developer.

## Your Role
- Implement code based on specifications
- Write comprehensive tests
- Follow PEP 8 and best practices
- Include error handling and validation

## Guidelines
- Read existing code before changes
- Make minimal, focused changes
- Run tests before committing
- Write clear commit messages""",
  "tools": "Read,Write,Edit,Bash,Grep,Glob",  # Optional
  "model": "sonnet"  # Optional: sonnet/opus/haiku/inherit
}

结果

该工具创建 .claude/agents/code-specialist.md:

---
name: code-specialist
description: Expert in writing clean, tested Python code
tools: Read,Write,Edit,Bash,Grep,Glob
model: sonnet
---

You are an expert Python developer.

## Your Role
- Implement code based on specifications
- Write comprehensive tests
- Follow PEP 8 and best practices
- Include error handling and validation

## Guidelines
- Read existing code before changes
- Make minimal, focused changes
- Run tests before committing
- Write clear commit messages

调用代理

一旦生成,即可使用Claude Code的自然语言界面或任务工具来分配任务:

@code-specialist Please implement a FastMCP tool that validates JSON schemas.
Include error handling and write tests using pytest.

发展

设置开发环境

# Install dependencies with dev tools
uv sync

# Install pre-commit hooks
uv run pre-commit install

运行质量检查

在提交之前, 总是 运行:

uv sync                              # Update dependencies
uv run pre-commit run --all-files    # Lint, format, type check
uv run pytest                        # Run tests

或者使用缩写:

just build && just typecheck && just test

运行测试

# All tests
uv run pytest

# With coverage
uv run pytest --cov=src --cov-report=html

# Specific tests
pytest tests/test_tools.py
pytest -m "not integration"  # Skip integration tests
pytest -xvs                  # Stop on first failure, verbose

代码标准

这个项目紧随其后 FastMCP开发指南

  • Python 3.11及以上版本 带有完整的类型注解
  • “Ruff”在中文中可以翻译为“粗糙”或“毛糙”,具体含义取决于上下文。如果是指外观或触感上的粗糙,可以翻译为“粗糙的”;如果是指行为或态度上的毛糙、不细致,可以翻译为“毛糙的”或“粗鲁的”(但“粗鲁的”通常带有更强的不礼貌或无礼意味,需根据具体语境判断) 用于代码检查和格式化
  • Pyright(注:这是一个专有名词,通常指的是一个用于Python语言的类型检查工具或服务,直接翻译为“Pyright”即可,无需额外解释,若需在中文语境下说明其用途,可加“(一种用于Python的类型检查工具/服务)”) 用于类型检查
  • Pytest 用于内存传输测试
  • 提交前钩子 强制执行代码质量

项目结构

claude-tools-mcp/
├── .claude/              # Claude Code configuration
│   ├── agents/           # Spawned sub-agent definitions
│   ├── commands/         # Custom slash commands
│   └── settings.json     # Hooks configuration
├── src/
│   └── mcp_server/
│       ├── server.py     # Main FastMCP server
│       ├── tools/        # MCP tool implementations
│       ├── resources/    # MCP resources
│       └── agents/       # Agent orchestration logic
├── tests/                # Test suite
├── examples/             # Example usage
├── docs/                 # Documentation
├── pyproject.toml        # Project configuration
└── README.md

做出贡献

欢迎贡献!本项目遵循FastMCP的开发规范。

指南/指导方针

  1. 叉(Fork)并克隆(Clone) 仓库
  2. 创建一个特性分支git checkout -b feature/my-feature
  3. 做出改变 遵循代码规范
  4. 运行质量检查uv run pre-commit run --all-files && uv run pytest
  5. 提交时附带清晰的信息简洁、有针对性的提交信息
  6. 推送并创建拉取请求(PR)包含描述和重点代码示例

提交标准

  • 保持信息简洁(仅标题更佳)
  • 关注变化的内容,而非变化的方式或原因
  • 在推送前运行预提交钩子
  • 永远不要在协作分支上强制推送

公关标准

  • 1-2段:问题+解决方案
  • 展示关键功能的聚焦代码示例
  • 不要用要点总结或冗长的测试计划
  • 明确表达为何这一变化很重要

如需详细指南,请参阅 FastMCP 贡献指南

许可证

这个项目根据Apache许可证2.0授权——详见 许可证 文件中有详细信息。

链接

  • GitHub 仓库https://github.com/Kirchlive/claude-tools-mcp 的中文翻译为:“https://github.com/Kirchlive/claude-tools-mcp(GitHub仓库地址,包含Claude工具的MCP版本)”。不过,通常在中文语境下,我们可能不会直接翻译网址,而是直接使用原网址,或者在介绍时简要说明其内容,如“这是GitHub上的一个仓库,名为claude-tools-mcp,包含了Claude工具的MCP版本”
  • FastMCP 框架https://gofastmcp.com(该网址可直接翻译为“https://快速MCP.com”,但实际翻译时通常保留原网址不变,因为网址是专有名词,直接使用即可)
  • MCP规范https://modelcontextprotocol.io(中文可译为:“模型上下文协议”网站,但具体翻译可能需根据网站实际内容调整)
  • 克劳德代码文档https://docs.claude.com/en/docs/claude-code 翻译为中文是:“https://claude文档.com/英文文档/claude代码”(注:实际网址翻译时通常不直接翻译网址内容,此处仅为说明网址结构的中文表述方式)。不过,在实际应用中,我们通常直接保留网址的原样,不进行翻译。如果非要给出一个类似中文表述的解释,可以是“Claude官方文档中的代码部分(英文版)”

致谢

使用……构建 FastMCP 由杰里迈亚·洛温(@jlowin)所著。

受Claude代码工作流程中对更深层次代理层级的需求启发。

______________________________________________________________________

状态MVP(最小可行性产品)- 核心代理生成功能已实现。更多工具和功能即将推出。

目录标签

目录标签

AI代理PythonClaude工作流自动化多代理系统本地部署代理生成MCP协议ClaudeCode

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP