Skip to content

[Bug]mcp服务报400,但是同一个mcp服务在openclaw/hermes agent这边是可用的 #8022

Description

@tutianyu101

What happened / 发生了什么

我自己在vps上部署了一个mcp服务器,然后部署到自己的openclaw和hermes 都是没问题可以正常获取工具,但是添加到astrbot后报400,不知道为何

gpt5.5-xhigh的回答:

Image 如果服务端启用了 session,初始化后后续请求需要带 Mcp-Session-Id,astrbot缺了 session id,服务端可以回 400 Bad Request

Reproduce / 如何复现?

1.添加mcp
2.添加格式:
{
"type": "streamable_http",
"url": "http://自己的vpsip:44460/mcp",
"timeout": 120
}

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

4.24.2
windows

OS

Windows

Logs / 报错日志

astrbot:
[2026-05-06 09:35:50.244] [Core]
[ERRO]
[v4.24.2] [routes.tools:441]: Traceback (most recent call last):
File "C:\Users\Administrator.astrbot_launcher\instances\cd7d3a99-112a-47e9-b2d4-ec63b53c9a6f\core\astrbot\dashboard\routes\tools.py", line 433, in test_mcp_connection
tools_name = await self.tool_mgr.test_mcp_server_connection(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator.astrbot_launcher\instances\cd7d3a99-112a-47e9-b2d4-ec63b53c9a6f\core\astrbot\core\provider\func_tool_manager.py", line 717, in test_mcp_server_connection
raise Exception(error_msg)
Exception: HTTP 400: Bad Request

服务器端:

Image

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions