|
| 1 | +# Claude Code 远程服务器依赖 |
| 2 | + |
| 3 | +> 只列出代码中实际发起网络请求的远程服务。本地服务、npm 包依赖、展示用 URL 不包含在内。 |
| 4 | +
|
| 5 | +## 总览表 |
| 6 | + |
| 7 | +| # | 服务 | 远程端点 | 协议 | 状态 | |
| 8 | +|---|---|---|---|---| |
| 9 | +| 1 | Anthropic API | `api.anthropic.com` | HTTPS | 默认启用 | |
| 10 | +| 2 | AWS Bedrock | `bedrock-runtime.*.amazonaws.com` | HTTPS | 需 `CLAUDE_CODE_USE_BEDROCK=1` | |
| 11 | +| 3 | Google Vertex AI | `{region}-aiplatform.googleapis.com` | HTTPS | 需 `CLAUDE_CODE_USE_VERTEX=1` | |
| 12 | +| 4 | Azure Foundry | `{resource}.services.ai.azure.com` | HTTPS | 需 `CLAUDE_CODE_USE_FOUNDRY=1` | |
| 13 | +| 5 | OAuth (Anthropic) | `platform.claude.com`, `claude.com`, `claude.ai` | HTTPS | 用户登录时 | |
| 14 | +| 6 | GrowthBook | `api.anthropic.com` (remoteEval) | HTTPS | 默认启用 | |
| 15 | +| 7 | Sentry | 可配置 (`SENTRY_DSN`) | HTTPS | 需设环境变量 | |
| 16 | +| 8 | Datadog | 可配置 (`DATADOG_LOGS_ENDPOINT`) | HTTPS | 需设环境变量 | |
| 17 | +| 9 | OpenTelemetry Collector | 可配置 (`OTEL_EXPORTER_OTLP_ENDPOINT`) | gRPC/HTTP | 需设环境变量 | |
| 18 | +| 10 | 1P Event Logging | `api.anthropic.com/api/event_logging/batch` | HTTPS | 默认启用 | |
| 19 | +| 11 | BigQuery Metrics | `api.anthropic.com/api/claude_code/metrics` | HTTPS | 默认启用 | |
| 20 | +| 12 | MCP Proxy | `mcp-proxy.anthropic.com` | HTTPS+WS | 使用 MCP 工具时 | |
| 21 | +| 13 | MCP Registry | `api.anthropic.com/mcp-registry` | HTTPS | 查询 MCP 服务器时 | |
| 22 | +| 14 | Bing Search | `www.bing.com` | HTTPS | WebSearch 工具 | |
| 23 | +| 15 | Google Cloud Storage (更新) | `storage.googleapis.com` | HTTPS | 版本检查 | |
| 24 | +| 16 | GitHub Raw (Changelog/Stats) | `raw.githubusercontent.com` | HTTPS | 更新提示 | |
| 25 | +| 17 | Claude in Chrome Bridge | `bridge.claudeusercontent.com` | WSS | Chrome 集成 | |
| 26 | +| 18 | CCR Upstream Proxy | `api.anthropic.com` | WS | CCR 远程会话 | |
| 27 | +| 19 | Voice STT | `api.anthropic.com/api/ws/...` | WSS | Voice Mode | |
| 28 | +| 20 | Desktop App Download | `claude.ai/api/desktop/...` | HTTPS | 下载引导 | |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## 详细说明 |
| 33 | + |
| 34 | +### 1. Anthropic Messages API |
| 35 | + |
| 36 | +核心 LLM 推理服务,发送对话消息、接收流式响应。 |
| 37 | + |
| 38 | +- **端点**: `https://api.anthropic.com` (生产) / `https://api-staging.anthropic.com` (staging) |
| 39 | +- **覆盖**: `ANTHROPIC_BASE_URL` 环境变量 |
| 40 | +- **认证**: API Key / OAuth Token |
| 41 | +- **文件**: `src/services/api/client.ts`, `src/services/api/claude.ts` |
| 42 | + |
| 43 | +### 2. AWS Bedrock |
| 44 | + |
| 45 | +- **端点**: `bedrock-runtime.{region}.amazonaws.com` |
| 46 | +- **认证**: AWS 凭证链 / `AWS_BEARER_TOKEN_BEDROCK` |
| 47 | +- **文件**: `src/services/api/client.ts:153-190`, `src/utils/aws.ts` |
| 48 | + |
| 49 | +### 3. Google Vertex AI |
| 50 | + |
| 51 | +- **端点**: `{region}-aiplatform.googleapis.com` |
| 52 | +- **认证**: `GoogleAuth` + `cloud-platform` scope |
| 53 | +- **文件**: `src/services/api/client.ts:228-298` |
| 54 | + |
| 55 | +### 4. Azure Foundry |
| 56 | + |
| 57 | +- **端点**: `https://{resource}.services.ai.azure.com/anthropic/v1/messages` |
| 58 | +- **认证**: API Key 或 Azure AD `DefaultAzureCredential` |
| 59 | +- **文件**: `src/services/api/client.ts:191-220` |
| 60 | + |
| 61 | +### 5. OAuth |
| 62 | + |
| 63 | +OAuth 2.0 + PKCE 授权码流程。 |
| 64 | + |
| 65 | +- **端点**: |
| 66 | + - `https://platform.claude.com/oauth/authorize` — 授权页 |
| 67 | + - `https://claude.com/cai/oauth/authorize` — Claude.ai 授权 |
| 68 | + - `https://platform.claude.com/v1/oauth/token` — Token 交换 |
| 69 | + - `https://api.anthropic.com/api/oauth/claude_cli/create_api_key` — 创建 API Key |
| 70 | + - `https://api.anthropic.com/api/oauth/claude_cli/roles` — 获取角色 |
| 71 | + - `https://claude.ai/oauth/claude-code-client-metadata` — MCP 客户端元数据 |
| 72 | + - `https://claude.fedstart.com` — FedStart 政府部署 |
| 73 | +- **文件**: `src/constants/oauth.ts`, `src/services/oauth/` |
| 74 | + |
| 75 | +### 6. GrowthBook (功能开关) |
| 76 | + |
| 77 | +- **端点**: `https://api.anthropic.com/` (remoteEval 模式) 或 `CLAUDE_GB_ADAPTER_URL` |
| 78 | +- **SDK Keys**: `sdk-zAZezfDKGoZuXXKe` (外部), `sdk-xRVcrliHIlrg4og4` (ant prod), `sdk-yZQvlplybuXjYh6L` (ant dev) |
| 79 | +- **文件**: `src/services/analytics/growthbook.ts`, `src/constants/keys.ts` |
| 80 | + |
| 81 | +### 7. Sentry (错误追踪) |
| 82 | + |
| 83 | +- **激活**: 设置 `SENTRY_DSN` (默认未配置) |
| 84 | +- **行为**: 仅错误上报,自动过滤敏感 header |
| 85 | +- **文件**: `src/utils/sentry.ts` |
| 86 | + |
| 87 | +### 8. Datadog (日志) |
| 88 | + |
| 89 | +- **激活**: 同时设 `DATADOG_LOGS_ENDPOINT` + `DATADOG_API_KEY` (默认未配置) |
| 90 | +- **文件**: `src/services/analytics/datadog.ts` |
| 91 | + |
| 92 | +### 9. OpenTelemetry Collector |
| 93 | + |
| 94 | +- **激活**: `CLAUDE_CODE_ENABLE_TELEMETRY=1` 或 `OTEL_*` 环境变量 |
| 95 | +- **协议**: gRPC / HTTP / Protobuf,支持 OTLP 和 Prometheus 导出 |
| 96 | +- **文件**: `src/utils/telemetry/instrumentation.ts` |
| 97 | + |
| 98 | +### 10. 1P Event Logging (内部事件) |
| 99 | + |
| 100 | +- **端点**: `https://api.anthropic.com/api/event_logging/batch` |
| 101 | +- **协议**: 批量导出 (10s 间隔, 每批 200 事件) |
| 102 | +- **文件**: `src/services/analytics/firstPartyEventLoggingExporter.ts` |
| 103 | + |
| 104 | +### 11. BigQuery Metrics |
| 105 | + |
| 106 | +- **端点**: `https://api.anthropic.com/api/claude_code/metrics` |
| 107 | +- **文件**: `src/utils/telemetry/bigqueryExporter.ts` |
| 108 | + |
| 109 | +### 12. MCP Proxy |
| 110 | + |
| 111 | +Anthropic 托管的 MCP 服务器代理。 |
| 112 | + |
| 113 | +- **端点**: `https://mcp-proxy.anthropic.com/v1/mcp/{server_id}` |
| 114 | +- **认证**: Claude.ai OAuth tokens |
| 115 | +- **文件**: `src/services/mcp/client.ts`, `src/constants/oauth.ts` |
| 116 | + |
| 117 | +### 13. MCP Registry |
| 118 | + |
| 119 | +获取官方 MCP 服务器列表。 |
| 120 | + |
| 121 | +- **端点**: `https://api.anthropic.com/mcp-registry/v0/servers?version=latest&visibility=commercial` |
| 122 | +- **文件**: `src/services/mcp/officialRegistry.ts` |
| 123 | + |
| 124 | +### 14. Bing Search |
| 125 | + |
| 126 | +WebSearch 工具的默认适配器,抓取 Bing 搜索结果。 |
| 127 | + |
| 128 | +- **端点**: `https://www.bing.com/search?q={query}&setmkt=en-US` |
| 129 | +- **文件**: `src/tools/WebSearchTool/adapters/bingAdapter.ts` |
| 130 | + |
| 131 | +另外还有 Domain Blocklist 查询: |
| 132 | +- **端点**: `https://api.anthropic.com/api/web/domain_info?domain={domain}` |
| 133 | +- **文件**: `src/tools/WebFetchTool/utils.ts` |
| 134 | + |
| 135 | +### 15. Google Cloud Storage (自动更新) |
| 136 | + |
| 137 | +- **端点**: `https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases` |
| 138 | +- **文件**: `src/utils/autoUpdater.ts` |
| 139 | + |
| 140 | +### 16. GitHub Raw Content |
| 141 | + |
| 142 | +- **端点**: `https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md` |
| 143 | +- **端点**: `https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json` |
| 144 | +- **文件**: `src/utils/releaseNotes.ts`, `src/utils/plugins/installCounts.ts` |
| 145 | + |
| 146 | +### 17. Claude in Chrome Bridge |
| 147 | + |
| 148 | +- **端点**: `wss://bridge.claudeusercontent.com` (生产) / `wss://bridge-staging.claudeusercontent.com` (staging) |
| 149 | +- **文件**: `src/utils/claudeInChrome/mcpServer.ts` |
| 150 | + |
| 151 | +### 18. CCR Upstream Proxy |
| 152 | + |
| 153 | +- **端点**: `ws://api.anthropic.com/v1/code/upstreamproxy/ws` |
| 154 | +- **激活**: `CLAUDE_CODE_REMOTE=1` + `CCR_UPSTREAM_PROXY_ENABLED=1` |
| 155 | +- **文件**: `src/upstreamproxy/upstreamproxy.ts` |
| 156 | + |
| 157 | +### 19. Voice STT |
| 158 | + |
| 159 | +- **端点**: `wss://api.anthropic.com/api/ws/...` |
| 160 | +- **文件**: `src/services/voiceStreamSTT.ts` |
| 161 | + |
| 162 | +### 20. Desktop App Download |
| 163 | + |
| 164 | +- **端点**: `https://claude.ai/api/desktop/win32/x64/exe/latest/redirect` (Windows) |
| 165 | +- **端点**: `https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect` (macOS) |
| 166 | +- **文件**: `src/components/DesktopHandoff.tsx` |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +## Anthropic API 辅助端点汇总 |
| 171 | + |
| 172 | +以下端点都挂在 `api.anthropic.com` 上,按功能分类: |
| 173 | + |
| 174 | +| 端点路径 | 用途 | 文件 | |
| 175 | +|---|---|---| |
| 176 | +| `/api/event_logging/batch` | 事件批量上报 | `src/services/analytics/firstPartyEventLoggingExporter.ts` | |
| 177 | +| `/api/claude_code/metrics` | BigQuery 指标导出 | `src/utils/telemetry/bigqueryExporter.ts` | |
| 178 | +| `/api/oauth/claude_cli/create_api_key` | 创建 API Key | `src/constants/oauth.ts` | |
| 179 | +| `/api/oauth/claude_cli/roles` | 获取用户角色 | `src/constants/oauth.ts` | |
| 180 | +| `/api/oauth/accounts/grove` | 通知设置 | `src/services/api/grove.ts` | |
| 181 | +| `/api/oauth/organizations/{id}/referral/*` | 推荐活动 | `src/services/api/referral.ts` | |
| 182 | +| `/api/oauth/organizations/{id}/overage_credit_grant` | 超额信用 | `src/services/api/overageCreditGrant.ts` | |
| 183 | +| `/api/oauth/organizations/{id}/admin_requests` | 管理请求 | `src/services/api/adminRequests.ts` | |
| 184 | +| `/api/web/domain_info?domain={}` | 域名安全检查 | `src/tools/WebFetchTool/utils.ts` | |
| 185 | +| `/api/claude_code/settings` | 设置同步 | `src/services/settingsSync/index.ts` | |
| 186 | +| `/api/claude_code/managed_settings` | 企业托管设置 (1h 轮询) | `src/services/remoteManagedSettings/index.ts` | |
| 187 | +| `/api/claude_code/team_memory?repo={}` | 团队记忆同步 | `src/services/teamMemorySync/index.ts` | |
| 188 | +| `/api/auth/trusted_devices` | 可信设备注册 | `src/bridge/trustedDevice.ts` | |
| 189 | +| `/api/organizations/{id}/claude_code/buddy_react` | Companion 反应 | `src/buddy/companionReact.ts` | |
| 190 | +| `/mcp-registry/v0/servers` | MCP 服务器注册表 | `src/services/mcp/officialRegistry.ts` | |
| 191 | +| `/v1/files` | 文件上传/下载 | `src/services/api/filesApi.ts` | |
| 192 | +| `/v1/sessions/{id}/events` | 会话历史 | `src/assistant/sessionHistory.ts` | |
| 193 | +| `/v1/code/triggers` | 远程触发器 | `src/tools/RemoteTriggerTool/RemoteTriggerTool.ts` | |
| 194 | +| `/v1/organizations/{id}/mcp_servers` | 组织 MCP 配置 | `src/services/mcp/claudeai.ts` | |
| 195 | + |
| 196 | +## 非 Anthropic 远程域名汇总 |
| 197 | + |
| 198 | +| 域名 | 服务 | 协议 | |
| 199 | +|---|---|---| |
| 200 | +| `bedrock-runtime.*.amazonaws.com` | AWS Bedrock | HTTPS | |
| 201 | +| `{region}-aiplatform.googleapis.com` | Google Vertex AI | HTTPS | |
| 202 | +| `{resource}.services.ai.azure.com` | Azure Foundry | HTTPS | |
| 203 | +| `www.bing.com` | Bing 搜索 | HTTPS | |
| 204 | +| `storage.googleapis.com` | 自动更新 | HTTPS | |
| 205 | +| `raw.githubusercontent.com` | Changelog / 插件统计 | HTTPS | |
| 206 | +| `bridge.claudeusercontent.com` | Chrome Bridge | WSS | |
| 207 | +| `platform.claude.com` | OAuth 授权页 | HTTPS | |
| 208 | +| `claude.com` / `claude.ai` | OAuth / 下载 | HTTPS | |
| 209 | +| `claude.fedstart.com` | FedStart OAuth | HTTPS | |
0 commit comments