agent-fleet

agent-fleet

MCP server that enables Claude Code to delegate tasks to Codex for real-time collaborative code generation and execution.

Category
Visit Server

README

agent-fleet

Claude Code + Codex 双模型协作工具。通过 MCP (Model Context Protocol) 和 tmux 实现 Claude Code 主控、Codex 执行的实时协作。

架构

┌─────────────────────────┬──────────────────────────┐
│                         │                          │
│  Claude Code            │  Codex Output            │
│  (用户交互, MCP client)  │  (实时流式日志)            │
│         │               │                          │
│         │ MCP/HTTP      │  tail -f /tmp/fleet.log  │
│         ▼               │            ▲             │
│  ┌──────────────┐       │            │             │
│  │ MCP Server   │───────┼── codex exec --json      │
│  │ (HTTP :9876) │       │            │             │
│  └──────────────┘       │            ▼             │
│                         │  [codex subprocess]      │
└─────────────────────────┴──────────────────────────┘

安装

cd ~/projects/agent-fleet
npm install

前置要求

  • Node.js >= 18
  • Claude Code CLI
  • Codex CLI (npm install -g @openai/codex)
  • tmux(可选,用于分屏)

使用

1. 启动

# 启动 MCP server + tmux 分屏
npx tsx src/cli.ts start

# 仅启动 MCP server(不用 tmux)
npx tsx src/cli.ts start --no-tmux

# 指定端口
npx tsx src/cli.ts start -p 9999

2. 配置 Claude Code

在项目的 .claude/settings.json 或全局 ~/.claude/settings.json 中添加:

{
  "mcpServers": {
    "agent-fleet": {
      "url": "http://127.0.0.1:9876/mcp",
      "type": "streamable-http"
    }
  }
}

或运行 npx tsx src/cli.ts setup 查看配置。

3. 在 Claude Code 中使用

配置完成后,Claude Code 可以使用以下 MCP 工具:

工具 说明
codex_run(prompt) 向 Codex 下发任务
codex_status() 检查 Codex 当前状态
codex_cancel() 取消正在运行的任务
fleet_info() 查看集群状态

4. 停止

npx tsx src/cli.ts stop

MCP 工具详情

codex_run

codex_run({
  prompt: "实现一个快速排序函数",
  cwd: "/path/to/project",     // 可选:工作目录
  model: "o3",                 // 可选:指定模型
  sandbox: "workspace-write"   // 可选:沙箱策略
})

返回:

{
  "taskId": "uuid",
  "output": "任务输出...",
  "exitCode": 0,
  "state": "completed"
}

开发

# 开发模式(热重载)
npm run dev

# 编译
npm run build

# 测试
npm test

# 类型检查
npx tsc --noEmit

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured