欢迎来到 openJiuwen 社区
Hey @openjiuwen-sync , 感谢你对社区的贡献.
机器人使用手册
有关指令的使用,可以点击 此处 查看详情。开发人员可以在每个PR或Issue下方评论特定指令来触发机器人任务。
联系指引
有疑问可以联系 SIG: sig-agent-protocol ,
维护者是: @YiyangShao, @xinyu-jiuwen ,
审核者是: @gcw_hx9prznZ, @mingo007 .


Quick check on current main: InitializeResult now serializes r.capabilities and SetServerCapabilities is called from server_manager. If empty capabilities / Accept-header issues still reproduce for you, happy to dig further — otherwise this may already be fixed.


Thanks for the heads. I'm currently not not active testing it. So i'll try it when I have a chance to use it again.


Capabilities serialization looks fixed on current main (j["capabilities"] = r.capabilities + SetServerCapabilities). I'll still fix the remaining Accept-header case-sensitivity so MCP Inspector can connect without a CORS proxy.


Hi, thanks for the report!
We will follow up on this.


The server always returns empty capabilities
{}in theinitializeresponse, even when tools, prompts, or resources are registered. This causes MCP clients (including the official MCP Inspector) to disable their Tools/Prompts/Resources tabs.Steps to Reproduce
server->AddTool(...){ "result": { "capabilities": {}, // <-- empty, should show {"tools": {}} "serverInfo": {"name": "...", "version": "..."} } }Root Cause
Two issues:
1. Serializer hardcodes empty object — In
src/shared/jsonrpc.cpp, theInitializeResultserializer:// Line ~90 in adl_serializer<Mcp::InitializeResult>::to_json j["capabilities"] = json::object(); // Always empty, ignores r.capabilitiesThis ignores the actual
r.capabilitiesfield entirely.2. Capabilities never set —
ServerSession::SetServerCapabilities()exists but is never called anywhere in the codebase. Even if the serializer is fixed, capabilities would still be empty because no code sets them when tools are registered.Proposed Fix
Fix 1 — Serialize actual capabilities (
src/shared/jsonrpc.cpp):j["capabilities"] = json::object(); if (r.capabilities.tools.has_value()) { j["capabilities"]["tools"] = json::object(); } if (r.capabilities.prompts.has_value()) { j["capabilities"]["prompts"] = json::object(); } if (r.capabilities.resources.has_value()) { j["capabilities"]["resources"] = json::object(); }Fix 2 — Auto-set capabilities on session creation (
src/server/server_manager.cpp):After creating a session, set default capabilities:
auto session = std::make_shared<ServerSession>(transport, config_, sessionId); Mcp::ServerCapabilities caps; caps.tools = Mcp::ToolsCapabilities{}; session->SetServerCapabilities(caps);Ideally, capabilities should be set dynamically based on what's registered (tools →
tools, prompts →prompts, etc.).Impact
Additional Issue: Case-Sensitive Accept Header
The server's HTTP parser rejects requests with uppercase
Accept:header (e.g.,Accept: application/json, text/event-stream) but accepts lowercaseaccept:. Per RFC 7230, HTTP headers are case-insensitive. This prevents the MCP Inspector and browsers from connecting directly — a CORS proxy is needed as a workaround.Location:
src/server/transport/streamable_http_server_transport.cpp, line ~185.Environment
openJiuwen-ai/agent-protocolTools shows grayed out (this image contains the fixes above to fix this issue)
