agent-zero icon indicating copy to clipboard operation
agent-zero copied to clipboard

Feature Request: MCP per‑server enable/disable toggle (QOL)

Open Omni-NexusAI opened this issue 3 months ago • 0 comments

Summary

Add a per‑server availability toggle to MCP settings. Improves clarity/control over MCPs, hardens the modal against race conditions during auto‑refresh and Apply.

Motivation (QoL)

  • Enable/disable individual MCPs without manual JSON edits.

Scope

  • UI only; no backend changes.
  • JSON contract preserved: mcpServers: { "<server>": { disabled?: boolean, ... } }.

UX details

  • Toggle switch next to each server; green when enabled.
  • If disabled is missing, toggles remain stable using the prior known state

Technical notes

  • Robust key resolution (underscore/hyphen/case‑insensitive) to find the correct MCP block.
  • Concurrency guards:
    • Debounced Apply for rapid toggles.
    • Pause auto status polling during Apply; resume after.
    • Track in‑flight status requests; ignore out‑of‑order responses.
    • Prevent overlapping Apply calls; queue one follow‑up if changes occur during Apply.
  • Log modal reliability: opens immediately with “Loading…”, then updates when data arrives.

Files (frontend)

  • webui/components/settings/mcp/client/mcp-servers-store.js
  • webui/components/settings/mcp/client/mcp-servers.html

Backward compatibility

  • Fully backward compatible; optional disabled is used if present.

Test plan

  • Toggle single/multiple servers; press Apply during auto‑refresh → no stalls; state persists.
  • Remove disabled from some entries:
    • Reformat → only those entries get disabled re‑added (default conservative: disabled).
    • Apply → editor JSON remains unchanged; status reflects updated state.
  • Open Log repeatedly and after toggles → always loads; no blank modal.
  • Verify no duplicate MCP entries or extra maps.

Screenshot

Image

References

  • Implemented in fork: Omni-NexusAI/agent-zero, branch feature/mcp-toggle-green (merged into development).

Labels

enhancement, ui, mcp, quality-of-life

Omni-NexusAI avatar Sep 17 '25 20:09 Omni-NexusAI