Claude for Agents
A local MCP server that lets Hermes supervise Claude Code, delegating focused coding, research, or review tasks to the Claude Code CLI and managing worker sessions, background jobs, cancellations, and read-only reviews.
README
Claude for Agents
Use the authenticated Claude Code CLI as a persistent, permission-controlled worker from any stdio MCP-compatible agent.
Claude for Agents is a local Node.js MCP server. A supervisor such as Hermes or Codex can delegate focused implementation or review work, receive structured telemetry, and continue the exact Claude session later.
Architecture
You → MCP-compatible supervisor → Claude for Agents → Claude Code worker
← result / session ID ←
The bridge uses Claude Code print mode (claude -p) for autonomous worker calls while the host agent remains the supervisor.
Tools
| Tool | Purpose |
|---|---|
claude_delegate |
Start a Claude Code task with project, model, policy, turn-budget, and background options. |
claude_continue |
Resume the exact stored Claude session, optionally with a model override. |
claude_status |
List background jobs or inspect one job's state and result. |
claude_cancel |
Stop a running background worker and its subprocess tree. |
claude_review |
Run a constrained, read-only review. |
Safety model
- Work is restricted to an approved project root, defaulting to
~/Projects. reviewis immutable across continuation and uses an inspection-only tool allowlist.codeuses an explicit editing/testing allowlist; the bridge never uses--dangerously-skip-permissions.- Worker prompts travel over stdin rather than command-line arguments.
- Sessions and job history persist in an owner-only (
0600) state file. - Jobs active during a bridge restart become
interrupted; they are never falsely resumed. - Cancellation targets the full subprocess group with bounded
SIGTERM→SIGKILLescalation. - The official Claude Code CLI must already be installed and authenticated locally.
Install with an agent skill
The repository includes a portable Agent Skill that can install, configure, verify, operate, and troubleshoot the bridge:
npx skills add 7D-codes/claude-for-agents --skill claude-for-agents
The skill supports Hermes and Codex directly and provides the stdio configuration contract for other MCP hosts. The skill is procedural guidance; the bridge runtime remains source-hosted in this GitHub repository and is not published as an npm package.
Install from source
Requirements:
- Node.js 20+
- Git
- Official Claude Code CLI, authenticated with
claude auth login - An MCP host that supports local stdio servers
git clone https://github.com/7D-codes/claude-for-agents.git ~/Projects/claude-for-agents
cd ~/Projects/claude-for-agents
npm ci
npm test
npm run smoke
Hermes
cd ~/Projects/claude-for-agents
hermes mcp add claude_for_agents \
--command "$(command -v node)" \
--connect-timeout 20 \
--args "$PWD/server.js"
hermes mcp test claude_for_agents
Start a new Hermes session after registration so the five tools are loaded.
Codex CLI
cd ~/Projects/claude-for-agents
codex mcp add claude_for_agents -- "$(command -v node)" "$PWD/server.js"
codex mcp get claude_for_agents
Restart Codex after registration. Ask it to list the tools exposed by claude_for_agents, then begin with a read-only claude_review or a narrowly scoped claude_delegate call.
Other MCP hosts
Register this stdio server using absolute paths:
{
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/claude-for-agents/server.js"]
}
Do not place the command and arguments into one shell string unless the host explicitly requires that format.
Configuration
| Variable | Default | Purpose |
|---|---|---|
CLAUDE_BIN |
claude |
Claude Code executable. |
CLAUDE_FOR_AGENTS_PROJECT_ROOT |
~/Projects |
Approved root containing worker projects. |
CLAUDE_FOR_AGENTS_STATE |
~/.claude-for-agents/state.json |
Persistent sessions and job history. |
The legacy CLAUDE_FOR_HERMES_PROJECT_ROOT and CLAUDE_FOR_HERMES_STATE names remain accepted. If the new default state file does not exist but ~/.claude-for-hermes/state.json does, the bridge reuses the legacy file automatically.
Environment variables must be configured on the MCP subprocess through the host, not merely exported in an unrelated shell.
Example requests
Ask Claude to implement the API validation work in
~/Projects/my-app, run the relevant tests, and report the changed files.
Ask Claude to inspect the authentication module using the review policy and identify security risks without editing files.
Continue Claude session
<session-id>: address the review findings and rerun the focused tests.
Development
npm test
npm run smoke
node --check server.js
node --check src/core.js
node --check src/config.js
node --check src/runner.js
node --check src/state.js
node --check src/workspace.js
The suite covers exact-session continuation, immutable review restrictions, persistent jobs, process-group cancellation, stdin transport, structured output, workspace containment, configuration migration, review settings, and authentication failures.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。