Cc Proxy
FreeNot checked📱 Control Claude Code from your phone — MCP server bridging Hermes Agent with local Claude Code CLI sessions
About
📱 Control Claude Code from your phone — MCP server bridging Hermes Agent with local Claude Code CLI sessions
README
License: Apache 2.0 Node.js >=18
MCP Server 桥接外部 Agent 与本地 Claude Code CLI 会话——用手机远程控制 Claude Code 编程。
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 手机 IM │ ──▶ │ Hermes │ ──▶ │ cc-proxy │ ──▶ │Claude CLI│ ──▶ │ Session │
│ (微信/钉钉)│ │(MCP 客户端)│ │(MCP 服务端)│ │ (子进程) │ │(活跃会话) │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
Quick Start
# 1. 一行安装
curl -fsSL https://raw.githubusercontent.com/cm8421/cc-proxy/main/install.sh | bash
# 2. 重启 Hermes
# 3. 在 Hermes 中使用 cc_list_projects 发现项目,cc_send_to_session 发送指令
前提:已安装 Claude Code CLI 和 Hermes。
功能
- 发现本机所有 Claude Code 项目和会话
- 向指定会话发送消息并获取响应(支持活跃和不活跃会话)
- 创建新的 Claude Code 会话
- 查询会话状态和摘要(带时间戳)
升级
重新运行安装命令即可升级,自动保留本地配置:
curl -fsSL https://raw.githubusercontent.com/cm8421/cc-proxy/main/install.sh | bash
升级后重启 Hermes 生效。
MCP 工具
| 工具 | 说明 | 只读 |
|---|---|---|
cc_list_projects |
列出本机所有 Claude Code 项目 | Yes |
cc_list_sessions |
列出会话(活跃全部 + 最新 2 个不活跃),支持按项目过滤和分页 | Yes |
cc_send_to_session |
向指定会话发送消息并获取响应(支持恢复不活跃会话) | No |
cc_create_session |
为指定项目创建新会话 | No |
cc_get_session_status |
检查会话进程是否存活 | Yes |
cc_get_session_summary |
获取会话工作摘要和最近消息 | Yes |
快速安装
curl -fsSL https://raw.githubusercontent.com/cm8421/cc-proxy/main/install.sh | bash
一行命令完成克隆、依赖安装和 Hermes 配置,重启 Hermes 即可生效。
环境变量配置
cc-proxy 需要你的 Claude Code API 凭证来与 claude CLI 通信。
安装时自动配置(推荐)
一键安装脚本会自动检测当前终端中的 ANTHROPIC_* 环境变量并保存到 .env 文件:
# 确保在已激活 Claude Code 的终端中运行
curl -fsSL https://raw.githubusercontent.com/cm8421/cc-proxy/main/install.sh | bash
如果终端中已有 ANTHROPIC_BASE_URL、ANTHROPIC_AUTH_TOKEN 等变量,安装脚本会自动捕获,无需手动操作。
手动创建 .env
如果安装时未检测到凭证,在 cc-proxy 目录下手动创建 .env:
cat > ~/.cc-proxy/.env << 'EOF'
ANTHROPIC_BASE_URL=https://your-api-endpoint
ANTHROPIC_AUTH_TOKEN=your-token
EOF
支持多 provider 配置,后面的同名变量覆盖前面的:
# Provider A
ANTHROPIC_BASE_URL=https://provider-a.com
ANTHROPIC_AUTH_TOKEN=token-a
# Provider B(当前生效)
ANTHROPIC_BASE_URL=https://provider-b.com
ANTHROPIC_AUTH_TOKEN=token-b
切换时把目标 provider 的配置移到最后即可。
Hermes 配置传递
也可以在 Hermes 的 MCP 配置中通过 env 字段传递(此时不需要 .env):
mcp_servers:
cc-proxy:
command: ~/.cc-proxy/run.sh
args:
- --transport
- stdio
env:
ANTHROPIC_BASE_URL: https://your-api-endpoint
ANTHROPIC_AUTH_TOKEN: your-token
常见变量
| 变量 | 说明 | 必需 |
|---|---|---|
ANTHROPIC_BASE_URL |
API 端点地址 | 使用代理时 |
ANTHROPIC_AUTH_TOKEN |
API 认证令牌 | 使用代理时 |
ANTHROPIC_API_KEY |
Anthropic 官方 API Key | 使用官方 API 时 |
ANTHROPIC_MODEL |
默认模型 | 可选 |
故障排查
"Not logged in" 错误:.env 文件缺失或凭证无效。运行 cat ~/.cc-proxy/.env 检查内容。
spawn claude ENOENT 错误:claude CLI 不在 PATH 中。安装脚本会自动检测并写入 config.yaml 的 cli_path。如仍有问题,手动编辑 ~/.cc-proxy/config.yaml 设置完整路径:
claude:
cli_path: "/full/path/to/claude"
项目结构
src/
├── index.ts # 入口,解析参数,启动 server
├── server.ts # McpServer 注册 6 个 MCP 工具
├── claude-cli.ts # Claude CLI 子进程管理 + stream-json 解析
├── session-store.ts # 从 ~/.claude/sessions/ 发现会话
├── project-store.ts # 从 ~/.claude/projects/ 发现项目
├── jsonl-reader.ts # JSONL 会话历史解析
├── path-utils.ts # 项目路径编解码
├── types.ts # TypeScript 类型定义
└── config.ts # 配置加载
依赖
- Node.js >= 18
- Claude Code CLI (
claude命令可用)
Installing Cc Proxy
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/cm8421/cc-proxyFAQ
Is Cc Proxy MCP free?
Yes, Cc Proxy MCP is free — one-click install via Unyly at no cost.
Does Cc Proxy need an API key?
No, Cc Proxy runs without API keys or environment variables.
Is Cc Proxy hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Cc Proxy in Claude Desktop, Claude Code or Cursor?
Open Cc Proxy on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Cc Proxy with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
