Skip to content

fix(mcp): show MCP tool changes in system prompt preview - #242

Open
JamesDAdams wants to merge 1 commit into
co-l:developfrom
JamesDAdams:fix/mcp-toogle
Open

fix(mcp): show MCP tool changes in system prompt preview#242
JamesDAdams wants to merge 1 commit into
co-l:developfrom
JamesDAdams:fix/mcp-toogle

Conversation

@JamesDAdams

Copy link
Copy Markdown
Contributor

Summary

Fix MCP toggle visibility: the "Update system prompt" preview now shows which MCP tools are added/removed, mcp_config list no longer lists servers disabled for the current session, and toggling MCP servers before a conversation starts applies the update directly instead of showing a stale banner.

  • context.applyDynamic.preview diffs tool definitions (added/removed) against the cached prompt; when no cache exists it falls back to the unfiltered registry so toggles are visible on fresh sessions
  • DynamicContextPreviewModal renders a "Tools (X added, Y removed)" section; the "hash changed but text identical" fallback only appears when nothing actually changed
  • mcp_config list omits servers disabled for the current session (getSessionDisabledServers)
  • PUT /api/sessions/:id/mcp/overrides applies the context directly when the session has no messages, avoiding the banner before conversation start

AI-Enhanced Development

Tell what models helped shape this PR:

  • AI Models: DeepSeek V4 Flash

Cache Impact

Does this PR affect anything cached — system prompts, tool definitions, skills, or other context?

  • Yes — the system-prompt preview now surfaces tool-definition changes (added/removed MCP tools) and the cached-prompt rebuild path was extended: fresh sessions without a cached prompt use the unfiltered tool registry as the diff baseline, and MCP toggles on empty sessions trigger an immediate cache rebuild (applyDynamicContext) instead of deferring it.

…session-disabled servers

- context.applyDynamic.preview now diffs tools (added/removed) against the
  cached prompt, falling back to the unfiltered registry when no cache exists
- DynamicContextPreviewModal renders a Tools section with add/remove counts
- mcp_config list omits servers disabled for the current session
- toggling MCP servers on a fresh session applies the system prompt update
  directly instead of showing the stale banner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant