Skip to content

Commit 3744c6d

Browse files
committed
Fix MCP protocolVersion: return plain string, not nested object
protocolVersion was {"version":"2024-11-05"} — MCP spec requires "2024-11-05". Claude Code rejected the malformed response and marked the server as failed.
1 parent 7629940 commit 3744c6d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/mcp/mcp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,7 @@ char *cbm_mcp_initialize_response(void) {
343343
yyjson_mut_val *root = yyjson_mut_obj(doc);
344344
yyjson_mut_doc_set_root(doc, root);
345345

346-
yyjson_mut_val *proto = yyjson_mut_obj(doc);
347-
yyjson_mut_obj_add_str(doc, proto, "version", "2024-11-05");
348-
yyjson_mut_obj_add_val(doc, root, "protocolVersion", proto);
346+
yyjson_mut_obj_add_str(doc, root, "protocolVersion", "2024-11-05");
349347

350348
yyjson_mut_val *impl = yyjson_mut_obj(doc);
351349
yyjson_mut_obj_add_str(doc, impl, "name", "codebase-memory-mcp");

0 commit comments

Comments
 (0)