Skip to main content
Glama

expert-router

给 Claude Code 用的按项目开通的专家咨询层:便宜模型在本地读仓库、跑测试;真正难的问题才压缩成 briefing,交给 ChatGPT 网页版(极高档)回答。

传输层使用 ai-browser-bridge(或你自己的 fork)。本仓库 fork 那套浏览器适配器,只做路由、压缩、开通开关和防重试。

条款风险(必读)
用浏览器自动化抓取 ChatGPT 网页的回答,可能违反 OpenAI 现行使用条款。这是个人技术实验,不是生产方案。账号风险自负。长期依赖请走官方 API。


它做什么、不做什么

做:

  • 默认所有仓库关闭。只有你对某个 git 仓库跑开通脚本后,该仓库的 Claude Code 会话才会出现 expert_consult

  • 调用必须带闭集 reason、绝对路径 repo_root、结构化 briefing(有体积上限)。

  • 摘录路径必须留在仓内,不能把仓外文件送进专家。

  • 进程内同时只允许一次咨询;follow-up 仅在同一次 MCP 进程已有会话时允许。

  • 返回给 Claude 的是专家正文,不回 ChatGPT conversation URL。

不做:

  • 不自动切 ChatGPT 模型(v1 请你自己把专用窗口拧到「极高」)。

  • 不把原始 bridge ask 暴露给 Claude(开通后也只有 expert_consult)。

  • 不启动、不关闭日常浏览器。专用 Brave 由你手动拉起。


Related MCP server: mcp-gemini-assistant

架构

某个已开通的 git 仓库
        │
        ▼
 Claude Code(本地调查、改代码、跑测试)
        │  仅当 reason 命中闭集
        ▼
 expert_consult MCP(本仓库)
        │  校验开通标记 + briefing
        ▼
 ai-browser-bridge CLI(本机 spawn)
        │  --debug-port(默认 9333)
        ▼
 专用 Brave(独立 profile + CDP)
        │
        ▼
 ChatGPT 网页(极高档)

机器配置在 ~/.ai-browser-bridge/expert.json不要提交)。
项目开通标记在该仓库的 .claude/expert-consult.json(脚本会写入 .git/info/exclude)。


环境要求

  • Windows 10/11(开通脚本是 PowerShell)

  • Node.js ≥ 22

  • 已安装并登录过的 Brave(也可用其它 Chromium,但脚本默认 Brave)

  • 已构建的 ai-browser-bridgedist/bridge.js

  • Claude Code CLI(claude 在 PATH 里)

Windows 上系统的 IP Helper 经常占用 9222。本项目默认 CDP 端口是 9333
上游 bridge serve 默认仍找 9222,因此你需要一份支持 --debug-port 的构建(见下文「与 ai-browser-bridge 的关系」)。


安装(只需一次)

本仓库目录:

npm install
npm run build
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1

如果 ai-browser-bridge 和本仓库是同级目录,且已经 npm run build 过,install.ps1 会自动填上 bridgeBinary。否则:

powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -BridgeRoot "D:\path\to\ai-browser-bridge"

安装结果:

路径

含义

~/.ai-browser-bridge/*.ps1

启动 / 开通 / 关闭脚本的本机副本

~/.ai-browser-bridge/expert.json

本机路径,勿提交、勿分享

~/.ai-browser-bridge/brave-profile/

专用浏览器登录态

~/.ai-expert/consultations/

咨询记录(本机)

打开 expert.json,确认:

  • routerBinary 指向本仓库的 dist/index.js

  • bridgeBinary 指向 ai-browser-bridgedist/bridge.js

  • debugPort 与专用 Brave 一致(默认 9333

  • braveExe 是本机 Brave 路径


启动专用浏览器(每次开工)

powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.ai-browser-bridge\start-brave.ps1"

看到 CDP 已在 9333 就绪 后,在这一扇窗口里:

  1. 登录 ChatGPT

  2. 把推理档设为 极高 / Extra High

  3. 窗口保持开着(可最小化)

不要把 debug port 打到你正在用的日常 Brave 上。

冒烟测试(可选):

node <ai-browser-bridge>/dist/bridge.js ask "Reply with exactly: pong" --provider chatgpt --debug-port 9333 --json

给某个项目开通(默认关闭)

powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.ai-browser-bridge\enable-expert.ps1" -RepoRoot "D:\path\to\your\repo"

然后在该仓库开一个新的 Claude Code 会话。其他仓库仍然没有 expert_consult

开通写入(均不进 git):

<repo>/.claude/expert-consult.json
<repo>/.claude/settings.local.json
<repo>/.claude/skills/expert-consult/SKILL.md
<repo>/.git/info/exclude

关掉:

powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.ai-browser-bridge\disable-expert.ps1" -RepoRoot "D:\path\to\your\repo"

没有开通标记时,即使有人把 MCP 配进项目,调用也会被拒绝。


Claude 应如何调用

Skill 会随开通复制进项目。要点:

  1. 先本地调查,再升级。

  2. reason 只能是:

    architecture · concurrency · security · destructive-migration · local-failed-twice · unclear-tradeoff · low-confidence-after-evidence · user-explicit

    同会话续问用 follow-up(只发增量)。

  3. 必填:repo_root(git 根绝对路径)、questionestablishedexcerptsattemptsdesired_output

  4. 整份 briefing ≤ 24000 字符;单条 excerpt ≤ 4000 字符。

  5. 陈述用英文,源码不翻译。

  6. 不要因为慢就重试。不要把专家回复当可应用补丁直接打进去。


与 ai-browser-bridge 的关系

本仓库 spawn:

node <bridgeBinary> ask <prompt> --provider chatgpt --timeout 900 --debug-port <debugPort> --json

Windows 上请使用支持 --debug-portbridge serve / bridge ask 构建。上游默认端口 9222;本机若被 IP Helper 占用,用 9333。

建议流程:

  1. 构建你的 ai-browser-bridge fork(含 --debug-port)。

  2. install.ps1 -BridgeRoot <该 fork>

  3. 不要把 bridge serve 注册成 Claude 的全局 MCP,以免模型直接 ask


不要提交这些

内容

原因

~/.ai-browser-bridge/expert.json

本机绝对路径

~/.ai-browser-bridge/brave-profile/

浏览器登录态、Cookie

~/.ai-expert/

咨询正文

项目里的 .claude/settings.local.json.claude/expert-consult.json

本机开通状态

ChatGPT 页面截图、账号相关调试脚本

隐私

本仓库的 .gitignore 已忽略 expert.json 和常见本机 Claude 文件。开通脚本还会把项目侧文件写入 .git/info/exclude


故障排除

开通后工具列表里没有 expert_consult
在该仓库新开 Claude Code 会话。claude mcp list(在该仓库目录下)应显示 expert-router

调用报 off / marker
确认 <repo>/.claude/expert-consult.json 存在且 "enabled": truerepo_root 是 git 根的绝对路径。

Brave 起不来 / CDP 超时
检查 expert.jsonbraveExedebugPorthttp://127.0.0.1:9333/json/version 应能打开。9222 被占用时不要改回 9222。

ask 超时或找不到输入框
确认专用窗口已登录 ChatGPT。v1 不切模型,窗口应停在极高档。

两个 Claude 同时咨询
v1 只做进程内互斥。不要对同一专用窗口开两个会咨询的会话。


开发

npm install
npm run build
npm run dev

入口:src/index.ts(stdio MCP)。脚本:scripts/。Skill 模板:skills/expert-consult/SKILL.md

Available Tools

1 tool
expert_consultA

本地调查之后,把难题交给 ChatGPT 极高档。仅在本仓库已开通时可用(标记文件 .claude/expert-consult.json)。reason 必须是闭集之一。已有咨询在进行时不要重试。briefing 用英文填写,源码保持原样。

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYes为什么这是专家级问题。follow-up 仅在本 MCP 进程已有会话时可用。
attemptsYes已经尝试过的方案(英文)。
excerptsYes关键代码摘录,不要整文件粘贴。
questionYes要专家回答的具体问题(英文)。
repo_rootYes已开通仓库的 git 根绝对路径。
constraintsNo硬性约束(英文,可选)。
establishedYes本地已确认的事实(英文)。
desired_outputYes希望专家产出什么(英文)。
timeout_secondsNo等待专家回复的秒数。

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

由于未提供任何注解,描述承担了全部行为披露责任。它涵盖了启用检查、状态竞争(进行中不重试)、输入语言要求(briefing 用英文,源码保持原样)。缺失了对返回形式、潜在延迟或超时行为的说明,但相对于同类工具已属充实。

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

四句话,没有多余信息,条件、枚举约束、并发警告和格式要求全部前置。紧凑而可执行。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

对于一个有9个参数、7个必填、无输出架构的复杂工具,描述覆盖了启用状态、并发、参数闭集和语言要求等关键决策信息。考虑复杂度,信息量足够启动调用,但缺少对超时等待体验的说明。

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

架构描述覆盖率达到 100%,每个参数都有详细的描述,描述本身只额外给出了英文填写要求和源码原样保留的格式提示。基线为 3,因为架构承担了绝大部分参数含义,描述的价值增量有限。

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

描述以清晰的中文动宾短语开头,指明是将本地调查后的难题升级给达到极高能力的 ChatGPT 专家。它说明了工具是什么,但没有明确区分同类工具(兄弟工具缺失),与usage指南部分有重叠。

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

明确说明适用条件:仅在本仓库已开通时可用(标记文件 .claude/expert-consult.json);reason 必须是闭集之一;已有咨询进行时不要重试。这些排他性条件为智能体提供了完整的调用语境。

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.0
    • First observedexpert_consult

TDQS

A4.1/5.0

Scored across 1 tool

Disambiguation5/5

With only a single tool, there is no possibility of confusion or ambiguous overlap between tools. The purpose of expert_consult is clearly distinct by virtue of being the only operation exposed.

Naming Consistency5/5

The single tool name 'expert_consult' follows a clean verb_noun convention. With no other tools to compare against, naming consistency is trivially maintained.

Tool Count3/5

One tool feels thin for a server named 'expert-router', which implies a broader routing or expert-selection purpose. However, the tool is domain-specific and non-trivial, so it falls in the borderline range rather than being an extreme mismatch.

Completeness2/5

The server exposes only a single consult action with no way to inspect active consultations, list available experts, or manage the feature flag. The description references state ('已有咨询在进行时不要重试') and an enumeration ('reason 必须是闭集之一') but provides no supporting tools, leaving significant workflow gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers