Token导航 LogoToken导航TokenDH.com
Chatgpt Webui MCP logo
办公协作未说明官方级别未说明来源级核验

Chatgpt Webui MCP

MCP Server

一个独立的MCP服务器,通过WebUI会话令牌驱动ChatGPT.com,适用于长时间任务、深度研究和图像生成。

工具数

6

提示词数

0

GitHub Stars

2

资源数

0
TypeScriptClaude团队协作Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Microck

提供方

Microck

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

mcp server for querying chatgpt (chatgpt.com) via webui session token (the image above was generated with this!)

______________________________________________________________________

快速开始

从npm安装:

npm i -g chatgpt-webui-mcp

手动运行:

CHATGPT_SESSION_TOKEN="your_token_here" chatgpt-webui-mcp

来源:

npm install
npm run build
CHATGPT_SESSION_TOKEN="your_token_here" node dist/index.js
重要提示:这使用了chatgpt的内部webuiapi和会话cookie。仅用于个人/本地修补-与openai无关。

______________________________________________________________________

概述

chatgpt-webui-mcp是一个独立的mcp服务器,通过以下方式驱动chatgpt.com camofox (UI自动化)。

它是为长时间运行的任务(gpt-5.2pro运行需要1小时以上)、深入研究和图像生成模式而构建的。

______________________________________________________________________

获取会话令牌

  1. 打开https://chatgpt.com并登录
  2. 打开开发工具
  3. 应用程序->Cookie-> https://chatgpt.com
  4. 复制值 __Secure-next-auth.session-token

______________________________________________________________________

配置

因为此服务器使用 stdiosse,将其配置为本地命令(或远程url),并通过env传递令牌。

mcp客户端配置(claude桌面、opencode等)

{
  "mcpServers": {
    "chatgpt-webui": {
      "command": "node",
      "args": ["/absolute/path/to/chatgpt-webui-mcp/dist/index.js"],
       "timeout": 7200000,
        "env": {
          "CHATGPT_SESSION_TOKEN_FILE": "/path/to/session-token.txt",
          "CHATGPT_BROWSER_BASE_URL": "http://127.0.0.1:9377",
          "CHATGPT_WAIT_TIMEOUT_MS": "7200000"
        }
     }
   }
 }

遗产 CHATGPT_CAMOFOX_* 为了兼容性,仍然支持env-vars。 CHATGPT_TRANSPORT=httpcloak 故意不受支持(使用camofox)。 当省略模型/思维时,请求默认为 gpt-5-2 (自动),不是专业。

______________________________________________________________________

开放代码工作流(自然语言风格)

如果你想键入以下命令:

  • `with chatgpt webui on gpt 5.2 pro extended thinking:

`

  • do deepresearch with chatgpt webui on

使用此工具:

工具它做什么
chatgpt_webui_command将句子解析为正确的调用并运行它

例子:

{
  "name": "chatgpt_webui_command",
  "arguments": {
    "command": "with chatgpt webui on gpt 5.2 pro extended thinking: write a 1-page memo about X",
    "mode": "auto"
  }
}

______________________________________________________________________

长跑(推荐)

使用统一的工具:

工具描述
chatgpt_webui_prompt主要工具。 mode=auto 选择等待与背景
chatgpt_webui_run检查/等待后台运行(run_id)

原因:深入研究和gpt-5.2pro可能需要很长时间,甚至可能超过一个客户端超时。 mode=auto 返回a run_id 长期工作。

______________________________________________________________________

图像生成

create_image=true 在发送提示之前,将chatgpt切换到图像生成模式。

笔记:

  • image_urls 是尽力而为(来自页面链接+访问过的url),根据chatgpt在webui中呈现图像的方式,可能为空。
  • 回退屏幕截图输出在中返回 image_data_url (不是 image_urls)启用并限制大小时。
  • 启用回退 CHATGPT_IMAGE_SCREENSHOT_FALLBACK=1.
  • 上限回退大小 CHATGPT_IMAGE_SCREENSHOT_MAX_BYTES (默认值 2097152,2 MiB)。
  • 为了获得可靠的检索,您还可以使用convention_id并打开chatgpt UI。

______________________________________________________________________

自检

# env
CHATGPT_SESSION_TOKEN="your_token_here" npm run self-test

# cli flag
npm run self-test -- --token "your_token_here"

# file
echo "your_token_here" > ~/.config/chatgpt-webui-mcp/session-token.txt
npm run self-test -- --token-file ~/.config/chatgpt-webui-mcp/session-token.txt

______________________________________________________________________

尾秤远程部署(可选)

如果您希望后台运行能够长时间运行,请将此服务器作为始终在线的SSE服务运行。

  1. 从该仓库复制模板:
  • deploy/systemd/chatgpt-webui-mcp.env.example
  • deploy/systemd/chatgpt-webui-mcp-sse.sh
  • deploy/systemd/chatgpt-webui-mcp.service
  1. 安装并启用服务(用户服务):
mkdir -p ~/.config ~/.config/systemd/user ~/.local/bin ~/.local/share/chatgpt-webui-mcp
cp deploy/systemd/chatgpt-webui-mcp.env.example ~/.config/chatgpt-webui-mcp.env
cp deploy/systemd/chatgpt-webui-mcp-sse.sh ~/.local/bin/chatgpt-webui-mcp-sse.sh
cp deploy/systemd/chatgpt-webui-mcp.service ~/.config/systemd/user/chatgpt-webui-mcp.service
chmod 600 ~/.config/chatgpt-webui-mcp.env
chmod 755 ~/.local/bin/chatgpt-webui-mcp-sse.sh
systemctl --user daemon-reload
systemctl --user enable --now chatgpt-webui-mcp.service
  1. 将opencode(云主机)指向端点:
{
  "mcp": {
    "chatgpt-webui": {
      "type": "remote",
      "url": "http://:8791/sse",
      "enabled": true,
      "timeout": 7200000,
      "oauth": false
    }
  }
}

______________________________________________________________________

工具

工具描述
chatgpt_webui_session验证令牌并返回会话有效负载
chatgpt_webui_models列出可用型号
chatgpt_webui_command自然语言命令包装器
chatgpt_webui_prompt统一提示工具(等待/后台)
chatgpt_webui_run检查/等待后台运行
chatgpt_webui_ask直接等待式提示工具(传统/简单)

______________________________________________________________________

项目结构

chatgpt-webui-mcp/
├── deploy/
│   └── systemd/
│       ├── chatgpt-webui-mcp.env.example
│       ├── chatgpt-webui-mcp-sse.sh
│       └── chatgpt-webui-mcp.service
├── src/
│   ├── index.ts               # MCP server
│   └── chatgpt-webui-client.ts # WebUI automation client
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── LICENSE
├── INSTALL.md
└── README.md

______________________________________________________________________

许可证

麻省理工学院

______________________________________________________________________

作者

Microck

目录标签

目录标签

TypeScriptClaude团队协作ChatGPT本地部署WebUIMCP服务器自动化会话令牌

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明oauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP