DEV Community

Hank Wang
Hank Wang

Posted on

Bringing Multi-Agent Debates to Cursor (and other IDE/CLI) via MCP (AgentChatBus)

https://github.com/Killea/AgentChatBus

Have you ever generated a complex refactoring snippet in Cursor and wished you had a “Security Expert” and a “Performance Guru” to review it simultaneously before applying the changes?

I’ve been experimenting with bridging this gap by building an open-source MCP server called AgentChatBus. It essentially turns your single-turn Cursor chat into a persistent, role-based multi-agent message bus. I wanted to share this workflow idea with the community and see how others are tackling similar “second pair of eyes” problems.

:bullseye: The Core Concept: Cursor as a Multi-Agent Debate Room

AgentChatBus integrates into Cursor as an MCP Server. Instead of just returning a single AI response, it opens up a dedicated “collaboration room” right inside your IDE:

  • Parallel Roles: When you share a code snapshot or architectural idea, multiple backend Agents can review it in parallel within the same long-running thread, debating and reaching a consensus. Because you can prompt arbitrary personas on the fly, you can instantly summon a Software Architect, a Product Manager, a ruthless QA engineer, or even a picky End-User, and have them join the room to provide their specialized insights!

  • Dynamic Roster: This isn’t a closed discussion. If the current Agent debate hits a bottleneck, you can dynamically pull in a new Agent (like a specialized DBA Agent) mid-discussion to drop their thoughts.

  • Native Multimodal Support: You can pass screenshots containing error logs or UI previews directly to the thread. The MCP Client inside Cursor extracts the underlying image data and feeds it natively to visual-analysis Agents.

  • Persistent History: This isn’t a one-off chat. Through a persistent Thread ID (e.g., D12s), you can pull up past discussions across different projects or even future development cycles to continue refining your architecture.

:light_bulb: A Typical Workflow in Cursor:

  1. Generate the Draft: Quickly spin up the initial code skeleton using Cursor’s Composer/Chat.

  2. One-Click Launch via Custom Commands: By deeply integrating with Cursor’s recent Custom Commands feature, you can define a quick command like /debate with a simple prompt, instantly kicking off a standardized multi-Agent review workflow.

  3. Initiate Cross-Review: Call the MCP Tool (or trigger it automatically via the shortcut above) and tell Cursor: “Send this code to the AgentChatBus D12s thread and have the SecurityAgent and PerfAgent provide cross-feedback.”

  4. Human Direction (Visibility Isolation): The underlying architecture supports message visibility isolation. You can drop “human_only” direction cues in the console to steer the overarching goal, without polluting the reasoning context of the Agents currently debating.

  5. One-Click Apply: Once the Agents have debated and reached an optimal solution, they summarize a repair checklist within the thread, returning it to Cursor so you can apply it with a single click.

🔧 Why is this highly beneficial for Cursor users?

When handling deep business logic or complex engineering architectures, a single LLM model inevitably has “blind spots” and “hallucinations.” By leveraging multiple models with distinct roles to cross-check each other, the process evolves from simple “blind generation” into a rigorous “Generate → Cross-Verify → Synthesize” workflow. Though it consumes slightly more API tokens, it significantly improves the maintainability and fault tolerance of long-term projects.

📊 A Real-World Agent Debate (D12s)

I ran an experiment in my repository featuring a pure Agent-to-Agent debate consisting of 31 messages (Thread D12s), demonstrating this as a highly promising architectural assistance model.

Here is the complete conversation log where you can clearly see specialized Agents pushing back against one another on code vulnerabilities and conventions, sometimes even overturning each other’s conclusions:

:backhand_index_pointing_right: Full D12s Thread Chat Log (GitHub Gist)

💬 Discussion & Feedback

Since we’re all using Cursor (or Copilot/Claude/GPT-CLI) daily to build complex applications, I am very curious about the community’s thoughts on extending workflows like this.

Left a comment if you like it!

Top comments (1)

Collapse
 
killea profile image
Hank Wang • Edited

Left a comment if you like it! Thank you!
Share it if you think it's helpful. Thank you!