fix(coding-agents): answer tools/list when disabled - #3537
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the hindsight-integrations/coding-agents MCP server’s zero-tool (“opted-out/disabled”) mode so that MCP clients probing tools/list don’t misinterpret an intentionally inert server as a startup failure. It introduces a single helper to build the MCP server surface and adds a regression test to ensure the discovery contract is valid when no tools are exposed.
Changes:
- Centralized MCP server construction into
buildMcpServer(...)to consistently register tools (or a valid empty tool surface). - When the resolved project exposes zero tools, explicitly advertises an empty tools capability and answers
tools/listwith{ tools: [] }. - Added an in-memory client/server test covering the zero-tool
tools/listpath.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hindsight-integrations/coding-agents/src/mcp-server.ts | Adds buildMcpServer and ensures disabled projects still respond to tools/list with an empty tool set. |
| hindsight-integrations/coding-agents/src/mcp-server.test.ts | Adds an in-memory regression test validating capabilities + tools/list response for the zero-tool server. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7bbae64 to
0301e62
Compare
|
Rebased onto current The conflicts with Closing in favour of #3626. |
|
thanks @nicoloboschi 🙇 |
Summary
Keep opted-out Hindsight MCP servers inert while making their tool-discovery contract valid. This prevents clients that probe
tools/listfrom treating an intentionally disabled project as an MCP startup failure.Changed
tools/listwith{ "tools": [] }.Risks
Low. Normal tool registration is unchanged; only the existing zero-tool path gains an explicit discovery response.
Verification
npm test— 530 tests passed.npm run build— passed../scripts/hooks/lint.sh— passed.git diff --check upstream/main...HEAD— passed.Complexity
The zero-tool path is constant-time. No API, persistence, or network behavior changes.