peer-cli-mcp

peer-cli-mcp

MCP bridge for calling local coding-agent CLIs (Codex, Claude) from another agent, enabling bounded tasks like code review, verification, and bug hunting.

Category
访问服务器

README

peer-cli-mcp

MCP bridge for calling local coding-agent CLIs from another agent.

MIT licensed. Built for trusted local workflows where one agent asks a peer agent to do a bounded task: review, verification, architecture critique, bug hunt, summarization, or another caller-authored job.

It exposes two tools:

  • call_codex
  • call_claude

The bridge does not collect diffs, build prompts, define review schemas, or interpret outcomes. The caller owns prompt, context, task semantics, and result handling.

Install

git clone https://github.com/domucchi/peer-cli-mcp.git
cd peer-cli-mcp
bun install
bun run build

Codex config

Add to ~/.codex/config.toml:

[mcp_servers.peer_cli]
command = "bun"
args = ["/Users/domucchi/Code/personal/peer-cli-mcp/src/index.ts"]
enabled = true
default_tools_approval_mode = "prompt"
tool_timeout_sec = 900

Then ask Codex:

Use peer_cli.call_claude to review the current diff. I will provide the diff in the prompt.

Claude Code config

Add to .mcp.json or Claude MCP settings:

{
  "peer-cli": {
    "command": "bun",
    "args": ["/Users/domucchi/Code/personal/peer-cli-mcp/src/index.ts"]
  }
}

Then ask Claude:

Use call_codex to review this diff. Keep Codex sandbox read-only.

call_codex

Input:

{
  "cwd": "/path/to/worktree",
  "prompt": "caller-authored prompt",
  "timeout_seconds": 600,
  "model": "optional model override",
  "sandbox": "read-only",
  "skip_git_repo_check": false,
  "output_schema": {
    "type": "object",
    "properties": {
      "summary": { "type": "string" }
    },
    "required": ["summary"]
  }
}

Defaults:

  • cwd: .
  • timeout_seconds: 600
  • sandbox: read-only
  • skip_git_repo_check: false
  • output_schema: omitted

Codex is launched with codex exec --ephemeral --ignore-user-config --ignore-rules.

call_claude

Input:

{
  "cwd": "/path/to/worktree",
  "prompt": "caller-authored prompt",
  "timeout_seconds": 600,
  "model": "optional model override",
  "tool_mode": "none",
  "output_schema": {
    "type": "object",
    "properties": {
      "summary": { "type": "string" }
    },
    "required": ["summary"]
  }
}

Defaults:

  • cwd: .
  • timeout_seconds: 600
  • tool_mode: none
  • output_schema: omitted

tool_mode: "none" launches Claude Code with no tools. tool_mode: "read-only" allows Read, Grep, and Glob.

Claude Code is launched with claude -p --no-session-persistence --permission-mode dontAsk --safe-mode.

Output

Both tools return:

{
  "agent": "codex",
  "stdout": "...",
  "stderr": "...",
  "exit_code": 0,
  "signal": null,
  "timed_out": false,
  "parsed_output": null,
  "validation_errors": []
}

When output_schema is provided, the bridge tries to parse JSON from stdout, validates it with Ajv, and returns the matching value in parsed_output. If validation fails, parsed_output is null and validation_errors explains why.

Review Example

The caller should gather context and write the review prompt.

Review this diff for correctness, regressions, security issues, and missing tests.
Do not suggest style-only changes.
Return JSON matching:
{
  "summary": "string",
  "findings": [
    {
      "severity": "critical|high|medium|low|nit",
      "file": "string",
      "line": 123,
      "title": "string",
      "rationale": "string",
      "suggested_fix": "string",
      "confidence": "high|medium|low"
    }
  ]
}

Diff:
...

Then pass that prompt to call_claude or call_codex with an output_schema if structured output is required.

Safety Boundary

This is a trusted local bridge. Do not expose it to untrusted callers or network clients.

The bridge runs local CLIs in the supplied cwd and passes caller-authored prompts through stdin. It does not sanitize prompts or decide whether a task is safe.

Codex defaults to read-only sandbox. Claude defaults to no tools; tool_mode: "read-only" is a Claude Code tool restriction, not an OS sandbox.

Development

bun run check
bun test
bun run build

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选