[GH-ISSUE #814] [bug] MCP 配置 http 服务无法使用工具 #609

Open
opened 2026-03-02 03:40:48 +03:00 by kerem · 4 comments
Owner

Originally created by @huaduokantu on GitHub (Dec 29, 2025).
Original GitHub issue: https://github.com/codexu/note-gen/issues/814

详细描述这个 Bug

MCP 服务器:MCPHub:v0.11.10

  1. MCP 配置 http 服务测试连接提示失败,保存后在列表中会显示已连接状态。
    Image

  2. 在对话界面 MCP 状态显示是开启的,勾选后也不会调用

Image

NoteGen 版本

0.23.1

操作系统

Windows

报错日志

No response

Originally created by @huaduokantu on GitHub (Dec 29, 2025). Original GitHub issue: https://github.com/codexu/note-gen/issues/814 ### 详细描述这个 Bug MCP 服务器:MCPHub:v0.11.10 1. MCP 配置 http 服务测试连接提示失败,保存后在列表中会显示已连接状态。 <img width="1360" height="751" alt="Image" src="https://github.com/user-attachments/assets/6d5ca60c-52b8-421e-ba26-3265b8ac4073" /> 2. 在对话界面 MCP 状态显示是开启的,勾选后也不会调用 <img width="1360" height="751" alt="Image" src="https://github.com/user-attachments/assets/554072c1-f3b3-446c-ac8e-9d4845246d3f" /> ### NoteGen 版本 0.23.1 ### 操作系统 Windows ### 报错日志 _No response_
Author
Owner

@lanzeweie commented on GitHub (Dec 30, 2025):

F12 看看报错。多半是CORS(跨域)拦截

<!-- gh-comment-id:3698262149 --> @lanzeweie commented on GitHub (Dec 30, 2025): F12 看看报错。多半是CORS(跨域)拦截
Author
Owner

@K1vinL commented on GitHub (Jan 13, 2026):

遇到类似问题了,版本0.24.0,跨域问题我配置了服务端解决了,但是在initialize的时候似乎有点问题

Image

且后续tools/list、listTools、resources/list都没自动带上mcp session id头

Image

initialize时服务端的响应是这样的

Image
<!-- gh-comment-id:3741657008 --> @K1vinL commented on GitHub (Jan 13, 2026): 遇到类似问题了,版本0.24.0,跨域问题我配置了服务端解决了,但是在initialize的时候似乎有点问题 <img width="1107" height="365" alt="Image" src="https://github.com/user-attachments/assets/687a1fb3-32e3-47d0-98f6-317fcff4eca2" /> 且后续tools/list、listTools、resources/list都没自动带上mcp session id头 <img width="715" height="295" alt="Image" src="https://github.com/user-attachments/assets/9f7a232c-e4df-4176-9c07-5507ee70bd5f" /> initialize时服务端的响应是这样的 <img width="755" height="353" alt="Image" src="https://github.com/user-attachments/assets/1b5c5fae-6b09-4fca-acc3-b7fcb543d90b" />
Author
Owner

@ZhangTianrong commented on GitHub (Feb 1, 2026):

目前 initialize 之后不会从 response header 中提取 session id 导致无法使用。手动添加 session id 到 header 又会因为 note-gen 重新 initialize 的时候也带上这个 id 导致 server 认为 session 已经 initialize 而 note-gen 认为无法连接。而且这个 CORS 我怎么一会儿能一会儿过不了呢?

<!-- gh-comment-id:3829962202 --> @ZhangTianrong commented on GitHub (Feb 1, 2026): 目前 initialize 之后不会从 response header 中提取 session id 导致无法使用。手动添加 session id 到 header 又会因为 note-gen 重新 initialize 的时候也带上这个 id 导致 server 认为 session 已经 initialize 而 note-gen 认为无法连接。而且这个 CORS 我怎么一会儿能一会儿过不了呢?
Author
Owner

@K1vinL commented on GitHub (Feb 1, 2026):

目前 initialize 之后不会从 response header 中提取 session id 导致无法使用。手动添加 session id 到 header 又会因为 note-gen 重新 initialize 的时候也带上这个 id 导致 server 认为 session 已经 initialize 而 note-gen 认为无法连接。而且这个 CORS 我怎么一会儿能一会儿过不了呢?

在ng反代上加下面的配置就能过cors了

location / {
        add_header Access-Control-Allow-Origin 'http://tauri.localhost' always;
        add_header Access-Control-Allow-Credentials 'true' always;
        add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, PATCH, OPTIONS' always;
        add_header Access-Control-Allow-Headers 'Authorization, Content-Type, Accept, X-Requested-With, Mcp-Session-Id' always;
<!-- gh-comment-id:3830811198 --> @K1vinL commented on GitHub (Feb 1, 2026): > 目前 initialize 之后不会从 response header 中提取 session id 导致无法使用。手动添加 session id 到 header 又会因为 note-gen 重新 initialize 的时候也带上这个 id 导致 server 认为 session 已经 initialize 而 note-gen 认为无法连接。而且这个 CORS 我怎么一会儿能一会儿过不了呢? 在ng反代上加下面的配置就能过cors了 ``` location / { add_header Access-Control-Allow-Origin 'http://tauri.localhost' always; add_header Access-Control-Allow-Credentials 'true' always; add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, PATCH, OPTIONS' always; add_header Access-Control-Allow-Headers 'Authorization, Content-Type, Accept, X-Requested-With, Mcp-Session-Id' always; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/note-gen#609
No description provided.