原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Claude MCP Bridge

作者:hampsterx版本 0.7.2i★ 7i在你的电脑上运行
注册名称io.github.hampsterx/claude-mcp-bridge

安装方法

What it does

Wraps Claude Code CLI as MCP tools: query, search, structured, ping, listSessions.

  • Connects 在你的电脑上运行
  • Account or key No key needed
  • Category 开发者工具

安装

选择你使用的 AI 应用,然后复制设置。

通过 3/3 项检查 · 在你的电脑上运行

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

  1. 安装 Node.js

    只需一次,所有需要 Node.js 的服务器都能用

    打开 Node.js 下载页 ↗

  2. 注册并创建 Claude MCP Bridge 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  4. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "claude-bridge": {
          "command": "npx",
          "args": [
            "-y",
            "claude-mcp-bridge"
          ],
          "env": {
            "CLAUDE_CLI_PATH": "your-value",
            "CLAUDE_DEFAULT_MODEL": "your-value",
            "CLAUDE_QUERY_MODEL": "your-value",
            "CLAUDE_STRUCTURED_MODEL": "your-value",
            "CLAUDE_SEARCH_MODEL": "your-value",
            "CLAUDE_FALLBACK_MODEL": "your-value",
            "CLAUDE_MAX_CONCURRENT": "your-value",
            "CLAUDE_BRIDGE_USE_API_KEY": "your-value",
            "CLAUDE_MAX_BUDGET_USD": "your-value",
            "CLAUDE_QUERY_TOOLS": "your-value",
            "CLAUDE_STRUCTURED_TOOLS": "your-value",
            "CLAUDE_SEARCH_TOOLS": "your-value",
            "CLAUDE_QUERY_EFFORT": "your-value",
            "CLAUDE_SEARCH_EFFORT": "your-value"
          }
        }
      }
    }

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  5. 退出 Claude 再重新打开

  6. 试一试

    用 Claude MCP Bridge 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 Claude MCP Bridge,或回答中出现 Claude MCP Bridge 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 Claude MCP Bridge

Claude MCP Bridge 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 Claude MCP Bridge 的应用

  • 需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
  • 需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
  • 需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)

B · 开发者工具 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)

  1. 安装 Node.js

    只需一次,所有需要 Node.js 的服务器都能用

    打开 Node.js 下载页 ↗

  2. 注册并创建 Claude MCP Bridge 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  4. 粘贴这条命令并按 Enter

    claude mcp add --scope user claude-bridge --env CLAUDE_CLI_PATH=your-value --env CLAUDE_DEFAULT_MODEL=your-value --env CLAUDE_QUERY_MODEL=your-value --env CLAUDE_STRUCTURED_MODEL=your-value --env CLAUDE_SEARCH_MODEL=your-value --env CLAUDE_FALLBACK_MODEL=your-value --env CLAUDE_MAX_CONCURRENT=your-value --env CLAUDE_BRIDGE_USE_API_KEY=your-value --env CLAUDE_MAX_BUDGET_USD=your-value --env CLAUDE_QUERY_TOOLS=your-value --env CLAUDE_STRUCTURED_TOOLS=your-value --env CLAUDE_SEARCH_TOOLS=your-value --env CLAUDE_QUERY_EFFORT=your-value --env CLAUDE_SEARCH_EFFORT=your-value -- npx -y claude-mcp-bridge

    按 Enter 前,把“your-value”改成你的密钥

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  5. 在 Claude Code 中输入 /mcp

    应能看到 Claude MCP Bridge 在列表中并显示已连接

  6. 试一试

    用 Claude MCP Bridge 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 Claude MCP Bridge,或回答中出现 Claude MCP Bridge 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)

  1. 安装 Node.js

    只需一次,所有需要 Node.js 的服务器都能用

    打开 Node.js 下载页 ↗

  2. 注册并创建 Claude MCP Bridge 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  4. 填写你的密钥

    在 Claude MCP Bridge 的设置中,CLAUDE_CLI_PATH, CLAUDE_DEFAULT_MODEL, CLAUDE_QUERY_MODEL, CLAUDE_STRUCTURED_MODEL, CLAUDE_SEARCH_MODEL, CLAUDE_FALLBACK_MODEL, CLAUDE_MAX_CONCURRENT, CLAUDE_BRIDGE_USE_API_KEY, CLAUDE_MAX_BUDGET_USD, CLAUDE_QUERY_TOOLS, CLAUDE_STRUCTURED_TOOLS, CLAUDE_SEARCH_TOOLS, CLAUDE_QUERY_EFFORT, CLAUDE_SEARCH_EFFORT 还是空的,填入你的密钥并保存

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  5. 在 Cursor 中以 Agent 模式打开 AI 聊天

  6. 试一试

    用 Claude MCP Bridge 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 Claude MCP Bridge,或回答中出现 Claude MCP Bridge 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要 Claude MCP Bridge 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)

  1. 安装 Node.js

    只需一次,所有需要 Node.js 的服务器都能用

    打开 Node.js 下载页 ↗

  2. 注册并创建 Claude MCP Bridge 的密钥

    打开开发者网站,注册账户并创建 API 密钥,下一步要用。价格和免费方案请看开发者网站。

    获取密钥的方法见下方开发者的 README

  3. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  4. 填写你的密钥

    在 Claude MCP Bridge 的设置中,CLAUDE_CLI_PATH, CLAUDE_DEFAULT_MODEL, CLAUDE_QUERY_MODEL, CLAUDE_STRUCTURED_MODEL, CLAUDE_SEARCH_MODEL, CLAUDE_FALLBACK_MODEL, CLAUDE_MAX_CONCURRENT, CLAUDE_BRIDGE_USE_API_KEY, CLAUDE_MAX_BUDGET_USD, CLAUDE_QUERY_TOOLS, CLAUDE_STRUCTURED_TOOLS, CLAUDE_SEARCH_TOOLS, CLAUDE_QUERY_EFFORT, CLAUDE_SEARCH_EFFORT 还是空的,填入你的密钥并保存

    只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人

  5. 在 VS Code 中以 Agent 模式打开 AI 聊天

  6. 试一试

    用 Claude MCP Bridge 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 Claude MCP Bridge,或回答中出现 Claude MCP Bridge 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 Claude MCP Bridge 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user claude-bridge --env CLAUDE_CLI_PATH=your-value --env CLAUDE_DEFAULT_MODEL=your-value --env CLAUDE_QUERY_MODEL=your-value --env CLAUDE_STRUCTURED_MODEL=your-value --env CLAUDE_SEARCH_MODEL=your-value --env CLAUDE_FALLBACK_MODEL=your-value --env CLAUDE_MAX_CONCURRENT=your-value --env CLAUDE_BRIDGE_USE_API_KEY=your-value --env CLAUDE_MAX_BUDGET_USD=your-value --env CLAUDE_QUERY_TOOLS=your-value --env CLAUDE_STRUCTURED_TOOLS=your-value --env CLAUDE_SEARCH_TOOLS=your-value --env CLAUDE_QUERY_EFFORT=your-value --env CLAUDE_SEARCH_EFFORT=your-value -- npx -y claude-mcp-bridge

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "claude-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "claude-mcp-bridge"
      ],
      "env": {
        "CLAUDE_CLI_PATH": "your-value",
        "CLAUDE_DEFAULT_MODEL": "your-value",
        "CLAUDE_QUERY_MODEL": "your-value",
        "CLAUDE_STRUCTURED_MODEL": "your-value",
        "CLAUDE_SEARCH_MODEL": "your-value",
        "CLAUDE_FALLBACK_MODEL": "your-value",
        "CLAUDE_MAX_CONCURRENT": "your-value",
        "CLAUDE_BRIDGE_USE_API_KEY": "your-value",
        "CLAUDE_MAX_BUDGET_USD": "your-value",
        "CLAUDE_QUERY_TOOLS": "your-value",
        "CLAUDE_STRUCTURED_TOOLS": "your-value",
        "CLAUDE_SEARCH_TOOLS": "your-value",
        "CLAUDE_QUERY_EFFORT": "your-value",
        "CLAUDE_SEARCH_EFFORT": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "claude-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "claude-mcp-bridge"
      ],
      "env": {
        "CLAUDE_CLI_PATH": "your-value",
        "CLAUDE_DEFAULT_MODEL": "your-value",
        "CLAUDE_QUERY_MODEL": "your-value",
        "CLAUDE_STRUCTURED_MODEL": "your-value",
        "CLAUDE_SEARCH_MODEL": "your-value",
        "CLAUDE_FALLBACK_MODEL": "your-value",
        "CLAUDE_MAX_CONCURRENT": "your-value",
        "CLAUDE_BRIDGE_USE_API_KEY": "your-value",
        "CLAUDE_MAX_BUDGET_USD": "your-value",
        "CLAUDE_QUERY_TOOLS": "your-value",
        "CLAUDE_STRUCTURED_TOOLS": "your-value",
        "CLAUDE_SEARCH_TOOLS": "your-value",
        "CLAUDE_QUERY_EFFORT": "your-value",
        "CLAUDE_SEARCH_EFFORT": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "claude-bridge": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "claude-mcp-bridge"
      ],
      "env": {
        "CLAUDE_CLI_PATH": "your-value",
        "CLAUDE_DEFAULT_MODEL": "your-value",
        "CLAUDE_QUERY_MODEL": "your-value",
        "CLAUDE_STRUCTURED_MODEL": "your-value",
        "CLAUDE_SEARCH_MODEL": "your-value",
        "CLAUDE_FALLBACK_MODEL": "your-value",
        "CLAUDE_MAX_CONCURRENT": "your-value",
        "CLAUDE_BRIDGE_USE_API_KEY": "your-value",
        "CLAUDE_MAX_BUDGET_USD": "your-value",
        "CLAUDE_QUERY_TOOLS": "your-value",
        "CLAUDE_STRUCTURED_TOOLS": "your-value",
        "CLAUDE_SEARCH_TOOLS": "your-value",
        "CLAUDE_QUERY_EFFORT": "your-value",
        "CLAUDE_SEARCH_EFFORT": "your-value"
      }
    }
  }
}

需要你填写的值

  • CLAUDE_CLI_PATH env
    Path to the claude CLI binary. Defaults to 'claude' on PATH.
  • CLAUDE_DEFAULT_MODEL env
    Shared default model for all tools. Overridden by per-tool CLAUDE_ _MODEL vars (QUERY, SEARCH, STRUCTURED).
  • CLAUDE_QUERY_MODEL env
    Override model for the query tool.
  • CLAUDE_STRUCTURED_MODEL env
    Override model for the structured tool.
  • CLAUDE_SEARCH_MODEL env
    Override model for the search tool.
  • CLAUDE_FALLBACK_MODEL env
    Model to use when the primary model hits a quota error. Set to 'none' to disable fallback.
  • CLAUDE_MAX_CONCURRENT env
    Maximum concurrent Claude CLI subprocesses (default 3).
  • CLAUDE_BRIDGE_USE_API_KEY env
    Set to '1' to forward ANTHROPIC_API_KEY to the CLI. Default is subscription-first: the CLI uses existing Max/Pro session and API key is NOT forwarded. Opt in only if you want API billing.
  • CLAUDE_MAX_BUDGET_USD env
    Maximum USD spend per call (pass-through to --max-budget-usd). Only applies when using API key auth.
  • CLAUDE_QUERY_TOOLS env
    Built-in tools the query subprocess may use. Comma or space separated list, 'default' for the CLI's full built-in set, or empty for no tools. The default withholds Bash, Write and Edit; widening it g…
  • CLAUDE_STRUCTURED_TOOLS env
    Built-in tools the structured subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.
  • CLAUDE_SEARCH_TOOLS env
    Built-in tools the search subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.
  • CLAUDE_QUERY_EFFORT env
    Reasoning effort for the query tool (low|medium|high|max).
  • CLAUDE_SEARCH_EFFORT env
    Reasoning effort for the search tool (low|medium|high|max).

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

每周下载量i
247/周
连接方式
在你的电脑上运行
最新版本i
0.7.2
发布到注册中心i
2026年10月19日
代码最后更新i
2026年10月19日
作者
hampsterx
软件包
npm: claude-mcp-bridge
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月12日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 hampsterx 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于24天前

  • ✓ 通过

    有许可证

    使用 MIT

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

使用 Google 登录后发帖

用户评价

还没有评价

用 Google 登录后写评价

与“开发者工具”中的其他服务器比较i

  • 星标数多于此分类中其他 5802 个服务器的 88%
  • 发布到注册中心的时间比此分类中其他 5802 个服务器的 54% 更新
  • 基础检查结果等于或优于此分类中其他 5802 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Claude MCP Bridge 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于24天前,最新版本(0.7.2)于24天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:REA, GitHub, Serena MCP: the IDE for your agent

同类别的其他选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

REA

Reverse engineer anything from your terminal or agent with one CLI and MCP server.

作者:morluto广泛使用↓ 38.9万/周★ 45.3万18天前更新

在你的电脑上运行

GitHub

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

作者:github广泛使用★ 3.4万9天前更新

电脑或云端

Serena MCP: the IDE for your agent

A powerful toolkit for coding, providing semantic retrieval and editing capabilities.

作者:oraios广泛使用↓ 3.5万/周★ 3.1万6个月前更新

在你的电脑上运行

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

claude-mcp-bridge

MCP server that wraps Claude Code CLI as a subprocess, exposing its capabilities as Model Context Protocol tools.

Works with any MCP client: Codex CLI, Gemini CLI, Cursor, Windsurf, VS Code, or any tool that speaks MCP.

Do you need this?

If you're in a terminal agent (Codex CLI, Gemini CLI) with shell access, call Claude Code CLI directly:

# Analyze specific files

claude -p --bare --tools Read -- "Analyze src/utils/parse.ts for edge cases"

With budget cap

claude -p --bare --max-budget-usd 0.50 "Is this retry logic sound?"

--bare skips hooks, memory, and plugins for clean subprocess use. --tools restricts which tools Claude can use at all; --allowed-tools only pre-approves permission and leaves everything else, including Bash, still reachable. --max-budget-usd prevents runaway costs.

--tools is variadic, so end the list with -- (or another flag) before the prompt. Without it the prompt is read as one more tool name and the CLI exits with "Input must be provided".

For code review, see Code review with this CLI.

Use this MCP bridge instead when:

  • Your client has no shell access (Cursor, Windsurf, Claude Desktop, VS Code)
  • You need structured output with native --json-schema validation
  • You need session resume across calls (--resume SESSION_ID)
  • You need concurrency management and security hardening
  • You want cost metadata surfaced in MCP responses

Quick Start

npx claude-mcp-bridge
Prerequisites
  • Claude Code CLI installed and on PATH
  • Authentication (one of):
  • Subscription (default): claude login (uses your Pro/Max plan, no API credits needed)
  • API key: set ANTHROPIC_API_KEY + CLAUDE_BRIDGE_USE_API_KEY=1 (billed per use via console.anthropic.com)
Codex CLI

Add to ~/.codex/config.json:

{

"mcpServers": { "claude-bridge": { "command": "npx", "args": ["-y", "claude-mcp-bridge"] } } }

Gemini CLI

Add to ~/.gemini/settings.json:

{

"mcpServers": { "claude-bridge": { "command": "npx", "args": ["-y", "claude-mcp-bridge"] } } }

Cursor / Windsurf / VS Code

Add to your MCP settings:

{

"claude-bridge": { "command": "npx", "args": ["-y", "claude-mcp-bridge"], "env": { "ANTHROPIC_API_KEY": "sk-ant-...", "CLAUDE_BRIDGE_USE_API_KEY": "1" } } }

Tools

ToolDescription
queryExecute prompts with file context, session resume, effort control, and budget caps. Supports text and images. For code review, see Code review with this CLI.
searchWeb search via Claude CLI's WebSearch and WebFetch tools. Returns synthesized answers with sources.
structuredJSON Schema validated output via Claude CLI's native --json-schema.
pingHealth check with CLI version, auth method, capabilities, and model config.
listSessionsList active sessions with cumulative cost, turn count, and timestamps.
query

Execute a prompt with optional file context. Supports session resume via sessionId, effort control (low/medium/high/max), and budget caps (maxBudgetUsd). Images (.png, .jpg, .gif, .webp, .bmp) up to 5MB each are passed to Claude's Read tool.

Key parameters: prompt (required), files, model (default sonnet), sessionId, effort, maxBudgetUsd, workingDirectory, timeout (default 60s).

search

Web search powered by Anthropic's WebSearch tool via Claude CLI. Returns synthesized answers with source URLs.

Key parameters: query (required), model (default sonnet), maxResponseLength, maxBudgetUsd, timeout (default 120s).

structured

Generate JSON conforming to a provided schema using Claude CLI's native --json-schema flag. Returns clean JSON in the first content block, metadata in a separate block so JSON parsing isn't broken.

Key parameters: prompt (required), schema (required, JSON string, max 20KB), files, model (default sonnet), sessionId, maxBudgetUsd, timeout (default 60s).

ping

No parameters. Returns CLI version, auth method (subscription/api-key/none), configured models, capabilities, and server version.

listSessions

No parameters. Returns active sessions with metadata: sessionId, model, createdAt, lastUsedAt, turnCount, totalCostUsd.

All tools attach execution metadata (_meta) with durationMs, model, sessionId, totalCostUsd, and token breakdowns. See DESIGN.md for details.

Configuration

Models
VariableDefaultDescription
CLAUDE_DEFAULT_MODELShared default for all tools
CLAUDE_QUERY_MODELsonnetDefault for query
CLAUDE_STRUCTURED_MODELsonnetDefault for structured
CLAUDE_SEARCH_MODELsonnetDefault for search
CLAUDE_FALLBACK_MODELhaikuFallback on quota exhaustion (none to disable)

Model resolution: explicit parameter > tool-specific env var > CLAUDE_DEFAULT_MODEL > built-in default.

Runtime
VariableDefaultDescription
CLAUDE_MAX_CONCURRENT3Max concurrent subprocess spawns
CLAUDE_CLI_PATHclaudePath to CLI binary
CLAUDE_MAX_BUDGET_USDGlobal cost cap in USD (per call)
ANTHROPIC_API_KEYAPI key (only forwarded when CLAUDE_BRIDGE_USE_API_KEY=1)
CLAUDE_BRIDGE_USE_API_KEYSet to 1 to forward ANTHROPIC_API_KEY to the subprocess (default: subscription auth)
Effort
VariableDefaultDescription
CLAUDE_SEARCH_EFFORTmediumDefault effort for search
CLAUDE_QUERY_EFFORTDefault effort for query
Tools

Each spawned subprocess gets an explicit built-in toolset. The defaults are read-only, so Bash, Write and Edit are not granted unless you widen them below.

VariableDefaultDescription
CLAUDE_QUERY_TOOLSRead Glob GrepBuilt-in tools for query
CLAUDE_STRUCTURED_TOOLSRead Glob GrepBuilt-in tools for structured
CLAUDE_SEARCH_TOOLSWebSearch WebFetchBuilt-in tools for search

Accepts a comma or space separated list, default for the CLI's full built-in set, or an empty value for no tools. Widening these gives the subprocess real capability in the working directory you pass it. See SECURITY.md § Tool Sandboxing.

Choosing a Claude Code MCP server

You need...Consider
Structured output, effort/budget control, session resume, cost metadataThis bridge
Multi-tool orchestration (read, grep, edit, bash as separate MCP tools)mcp-claude-code
Session continuity with async executionclaude-mcp
Maintained lightweight wrapper@kunihiros/claude-code-mcp
Native Claude Code MCP (built-in, no wrapper)claude mcp serve (docs)

Performance

Claude Code CLI has minimal startup overhead. Wall time is dominated by model inference and any agentic exploration.

ScenarioTypical time
Trivial prompt (sonnet)5-10s
Web search + synthesis15-30s

Cost metadata (totalCostUsd, token breakdowns) is returned in _meta on every response.

Bridge family

Two MCP servers, same architecture, different underlying CLIs. Each wraps a terminal agent as a subprocess and exposes it as MCP tools. Pick the one that matches your model provider, or run both for cross-model workflows.

claude-mcp-bridgecodex-mcp-bridge
CLIClaude CodeCodex CLI
ProviderAnthropicOpenAI
Toolsquery, search, structured, ping, listSessionscodex, search, query, structured, ping, listSessions
Code reviewUse Claude Code built-ins directly (not via this bridge), or claude -p for non-Claude-Code hostscodex review --base (native) or codex tool with caller-supplied prompt
Structured outputNative --json-schema (no Ajv)Ajv validation
Session resumeNative --resumeSession IDs with multi-turn
Budget capsNative --max-budget-usdNot supported
Effort control--effort low/medium/high/maxNot supported
Cold start~1-2s<100ms (inference dominates)
Authclaude login (default) or ANTHROPIC_API_KEY + opt-inOPENAI_API_KEY
CostSubscription (default) or API credits (opt-in)Pay-per-token
Concurrency3 (configurable)3 (configurable)
Model fallbackAuto-retry with fallback modelAuto-retry with fallback model

Both share: subprocess env isolation, path sandboxing, output redaction, FIFO concurrency queue, MCP tool annotations, _meta response metadata, progress heartbeats.

Code review with this CLI

The reviewer prompt is supplied by the caller. The bridge does not bundle review prompts (see ADR-001).

  • In Claude Code (interactive REPL): use the built-in /review, /security-review, /ultrareview. REPL-only; not reachable via claude -p or this bridge.
  • Through this bridge (query / structured): pass the review prompt as plain text. Slash commands (built-in or user-installed ~/.claude/commands/) do not resolve through the bridge, the isolation flags (--bare on the API-key path, --setting-sources "" on the subscription path) block all skill resolution by design. Tracked upstream: anthropics/claude-code#37207.
  • Direct `claude -p` (no bridge): user skills resolve as /skill-name when no isolation flags suppress them. For subprocess-isolated review use the hardened invocation below.

Route based on where you are:

  • Already in Claude Code? Type /review, /security-review, or /ultrareview. Skip the rest of this section.
  • Calling from another MCP host (Cursor, Codex CLI, Gemini CLI, Claude Desktop)? Slash commands and skills are not reachable through the bridge. Pass your review prompt as plain text to query / structured, or invoke claude -p directly per below.
Direct claude -p invocation (subprocess-isolated)

For shell-equipped consumers (terminal agents, CI, BYOS skills), invoke the CLI directly with hardened isolation flags:

claude -p \

--permission-mode plan \ --bare \ --add-dir \ --strict-mcp-config \ --mcp-config '{"mcpSe

只显示了开头部分;其余内容请在仓库中阅读