Server doesn't advertise tools capability when client sends empty capabilities in initialize
Version
codebase-memory-mcp v0.9.0, Windows x64
Platform
Windows (x64)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
ui
What happened, and what did you expect?
When a client sends an initialize request with capabilities: {} (empty object), the server responds with capabilities: {} and omits the tools field entirely. This means MCP clients (like Hermes Agent with MCP SDK 1.26.0) that check capabilities.tools in InitializeResult conclude the server has no tools and never call tools/list. The server's tools become invisible to the client.
Expected: Per the MCP specification, the server's capabilities in InitializeResult should describe what the server supports, regardless of what the client declares in its own capabilities. Since codebase-memory-mcp implements the tools/* request family, it should always include "tools": {"listChanged": false} (or equivalent) in its capabilities response. This is the standard behaviour of other MCP servers — they advertise their capabilities unconditionally.
Reproduction
The exact steps so we can reproduce it ourselves:
Step 1 — Start the server and send an initialize request with empty client capabilities:
Code · bash echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | codebase-memory-mcp Actual output:
Code { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "serverInfo": {"name": "codebase-memory-mcp", "version": "0.9.0"}, "capabilities": {} } } (The server returns capabilities: {} — no tools field.)
Expected output:
Code · json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "serverInfo": {"name": "codebase-memory-mcp", "version": "0.9.0"}, "capabilities": { "tools": {"listChanged": false} } } } (The server should always advertise tools since it implements the tools/* request family.)
Step 2 — For comparison, send initialize with client capabilities: {"tools": {}}:
Code · bash echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"tools":{}},"clientInfo":{"name":"test","version":"1.0"}}}' | codebase-memory-mcp Output:
Code · json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "serverInfo": {"name": "codebase-memory-mcp", "version": "0.9.0"}, "capabilities": { "tools": {"listChanged": false} } } } (This works correctly — server advertises tools because the client explicitly asked for them.)
No code indexing is needed to reproduce — this is a protocol-level bug in the MCP initialize handshake. Any MCP client that sends capabilities: {} (as MCP SDK v1.26.0 does) will fail to discover tools.
Logs
Diagnostics trajectory (memory / performance / leak issues)
Project scale (if relevant)
No response
Confirmations
- [x] I searched existing issues and this is not a duplicate.
- [x] My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
Thanks for the minimal protocol reproduction. I verified the contract against the current MCP specification: a server that implements tools must advertise the tools server capability independently of whether the client advertises its own tools capability. This is a high-priority 0.9.1-rc integration bug under #395, with empty client capabilities as the RED handshake case.
Thank you, @JobJobovich, for the minimal handshake repro! We couldn't reproduce it. With capabilities: {} from the client, the server returns "capabilities":{"tools":{"listChanged":false},…}, and v0.9.0 already advertised tools unconditionally. If Hermes still doesn't list the tools on v0.11.0, could you capture the raw initialize exchange from that session?
Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:
- the
codebase-memory-mcp --versionyou're on - the exact steps or command you ran
- a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code
Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.
Thank you for the minimal handshake example. The later check did not reproduce the missing tools capability, so the useful outstanding evidence remains the raw initialize exchange from an affected Hermes session on v0.11.0 or newer. No source repository is needed for this protocol-only case.
This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.