Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
这是 Claude Code 的 CLI 客户端主体(src/ 目录),即整个终端交互层的源码。具体包含: 1. CLI 入口与命令解析 — main.tsx(4684行)、entrypoints/(CLI 模式、SDK 模式、MCP 模式) 2. 终端 UI 渲染 — components/(144 个组件,用 React + Ink 渲染终端界面) 3. 工具系统 — tools/(43 个工具,Bash、文件读写编辑、Grep、Glob、Web 搜索等) 4. API 通信层 — services/api/(与 Anthropic 后端通信) 5. MCP 协议 6. 多 Agent/Team 协作 l 7. 认证与策略 8. 辅助服务 等
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Same catalog task: AI & machine learning.
.prompts, the home to all your AI prompts, everywhere you need them.
Same catalog task: AI & machine learning.
Real MCP server (stdio + @modelcontextprotocol/sdk) that exposes x402-paywalled HTTP endpoints as MCP tools. Drop into Claude Desktop, Cursor, or any MCP client.
Same catalog task: AI & machine learning.
Standalone MCP (Model Context Protocol) server - stdio/http/websocket transports, connection pooling, tool registry
Fetched from the repository for this visit.
Claude Code CLI 源代码学习与分析项目
这是 Anthropic 官方 Claude Code CLI 工具的源代码,用于学习、研究和分析目的。Claude Code 是一个强大的 AI 编程助手命令行工具,支持多种编程任务自动化。
| 类别 | 技术 |
|---|---|
| 语言 | TypeScript / TSX |
| 运行时 | Bun |
| UI 框架 | Ink (React for CLI) |
| 包管理 | Bun |
| CLI 框架 | Commander.js |
| 终端样式 | Chalk |
src/
├── commands/ # 斜杠命令实现 (/commit, /review 等)
├── components/ # UI 组件 (基于 Ink React)
│ └── design-system/ # 设计系统组件
├── services/ # 核心服务
│ ├── api/ # API 服务
│ ├── mcp/ # MCP 协议实现
│ ├── analytics/ # 分析服务
│ └── settingsSync/ # 设置同步
├── tools/ # 工具实现
│ ├── BashTool/ # Shell 命令执行
│ ├── FileReadTool/ # 文件读取
│ ├── FileEditTool/ # 文件编辑
│ ├── GrepTool/ # 代码搜索
│ ├── GlobTool/ # 文件匹配
│ ├── TaskTool/ # 任务代理
│ └── ... # 更多工具
├── hooks/ # React Hooks
├── constants/ # 常量定义
├── ink/ # 终端 UI 框架
├── utils/ # 工具函数
├── schemas/ # JSON Schema 定义
├── screens/ # 屏幕组件
├── plugins/ # 插件系统
├── keybindings/ # 快捷键绑定
└── main.tsx # 主入口文件
| 命令 | 描述 |
|---|---|
/commit | 智能生成 Git 提交 |
/review | 代码审查 |
/pr_comments | PR 评论分析 |
/diff | 差异查看 |
/branch | 分支管理 |
| 命令 | 描述 |
|---|---|
/resume | 恢复历史会话 |
/session | 会话管理 |
/clear | 清除对话 |
/compact | 压缩上下文 |
/rewind | 回退操作 |
/export | 导出会话 |
| 命令 | 描述 |
|---|---|
/config | 配置管理 |
/init | 初始化项目 |
/model | 切换模型 |
/theme | 主题设置 |
/login | 登录账户 |
/logout | 登出账户 |
| 命令 | 描述 |
|---|---|
/mcp | MCP 服务器管理 |
/plugin | 插件管理 |
/skills | 技能系统 |
| 命令 | 描述 |
|---|---|
/doctor | 系统诊断 |
/cost | 费用统计 |
/usage | 使用量统计 |
/help | 帮助信息 |
/upgrade | 升级版本 |
| 命令 | 描述 |
|---|---|
/vim | Vim 模式 |
/plan | 计划模式 |
/fast | 快速模式 |
/permissions | 权限管理 |
/hooks | 钩子配置 |
每个工具都是独立模块,包含:
支持多种命令类型:
prompt - 提示词命令local - 本地执行命令dialog - 对话框命令完整的 Model Context Protocol 实现,支持:
可扩展的技能框架:
多代理协作支持:
| 指标 | 数量 |
|---|---|
| TypeScript 文件 | ~1884 |
| 命令数量 | ~50+ |
| 工具数量 | ~30+ |
| UI 组件 | ~100+ |
| 文件 | 描述 |
|---|---|
main.tsx | 应用主入口 |
commands.ts | 命令注册中心 |
tools.ts | 工具注册中心 |
context.ts | 上下文管理 |
ink.tsx | UI 渲染引擎 |
main.tsx
├── commands.ts ──► commands/
├── tools.ts ──► tools/
├── services/
│ ├── api/
│ ├── mcp/
│ └── analytics/
└── components/
└── design-system/
本项目仅用于学习和研究目的。Claude Code 是 Anthropic, PBC. 的产品。本仓库不包含完整的构建配置和依赖,仅包含源代码用于学习分析。
源代码版权归 Anthropic, PBC. 所有。本项目仅用于教育目的。
最后更新: 2026-03-31
Loading reviews...
GitHub checked 447h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.