agent-discussion-mcp
Connects to OpenAI-compatible chat completion endpoints for running role-based agents, proposals, critiques, and judge verdicts.
Provides a test suite runnable with pytest for the MCP server's development.
Persists agent profiles and append-only session audit events (proposals, critiques, verdicts, errors) in a SQLite database with WAL mode.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-discussion-mcp run a discussion with the architect, DBA, and security agents on our schema design"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-discussion-mcp
Model Context Protocol (MCP) server for reusable role-based agents, autonomous task execution in workspaces, structured multi-agent debates, peer critiques, and independent judge consensus.
Supports Solo autonomous execution with workspace tools (file editing, shell execution, heartbeat, watchdog protection) and bounded Discussion mode: independent proposals, parallel critique, an independent judge, bounded revision rounds, and SQLite event logs with WAL mode.
See dsaa.md for the original project vision and architectural notes (Russian).
✨ Features
Role Profiles ("Gems"): Reusable agent profiles with custom roles, system prompts, model overrides, routing tags, temperature, and output token limits.
Solo Autonomous Execution (
run_solo):Run single-agent tasks directly by agent name, or route by tags.
Pass
working_dir(orworkspace_path) to grant the agent full autonomous workspace execution capabilities:list_files: Find files matching glob patterns.read_file: Inspect file contents.write_file: Create or overwrite files.replace_in_file: Targeted surgical text replacement.run_command: Execute bash shell commands directly inside the workspace directory (e.g. running tests, linters, or build commands).
Pass custom
promptto override or augment the profile's instructions for a specific task.
Heartbeat & Inactivity Watchdog Protection:
Heartbeat reporting: Emits periodic MCP progress notifications (
ctx.report_progress) every 15s (heartbeat_interval_seconds) so the calling agent or client knows the agent is alive and progressing.Inactivity Watchdog: Automatically detects hung or frozen processes (
inactivity_timeout_seconds, default 300s) and aborts stuck tasks.Step Limit: Prevents runaway execution loops (
max_steps, default 25).Repetition Detector: Detects and breaks out of repetitive identical tool failure loops.
Structured Discussion Mode (
run_discussion):Independent Proposals: Participating agents draft proposals in parallel without seeing other agents' work.
Peer Critique: Agents review all proposals and produce structured critiques (strengths, concerns, questions).
Independent Judge: A designated judge evaluates the blackboard and decides consensus vs. no-consensus with a defensible final answer and confidence score.
Bounded Revision: If no consensus is reached, agents revise their proposals addressing critiques for up to
max_rounds.
Shared Token Budget: Dynamic token reservation and settlement preventing token overrun in concurrent calls.
Event Sourcing & Audit Log: Monotonic append-only SQLite log (
session_events) recording all proposals, critiques, tool calls, verdicts, and errors in WAL mode.Transient Error Resilience: Exponential backoff with jitter on network/HTTP status errors (408, 409, 429, 5xx) and fallback verdict if a judge fails.
Related MCP server: AgentPrism Workflows
🚀 Quick Start
Installation & Running
# Clone the repository
git clone https://github.com/ewanni/agent-discussion-mcp.git
cd agent-discussion-mcp
# Install dependencies with uv
uv sync --extra test
# Configure provider settings
export AGENT_DISCUSSION_API_KEY="your-openai-or-compatible-key"
export AGENT_DISCUSSION_BASE_URL="https://api.openai.com/v1"
export AGENT_DISCUSSION_MODEL="gpt-4o-mini"
# Run the MCP server over stdio
uv run agent-discussion-mcp(Note: legacy API_AGENT_* environment variables and api-agent-mcp CLI binary are also supported for backwards compatibility).
🛠️ MCP Tools & Resources
Tools
create_agent: Register a new agent profile (name, role, system_prompt, model, tags, temperature, max_output_tokens).update_agent: Modify fields of an existing profile.list_agents: Inspect all registered profiles (omits private system prompts / credentials).run_solo: Execute a task with an agent.task(required): Task description.working_dir(optional): Path to working directory. When provided, the agent receives workspace tools (read_file,write_file,replace_in_file,list_files,run_command).prompt(optional): Custom system prompt or additional instructions.agent(optional): Name of the agent profile (or routed by task tags).max_steps(optional, default 25): Maximum ReAct tool steps before terminating.inactivity_timeout_seconds(optional, default 300): Watchdog threshold to prevent hanging.heartbeat_interval_seconds(optional, default 15): Interval for MCP progress heartbeat notifications.
run_discussion: Run a bounded debate with 2–5 participant agents, a separate judge, round limit (1–5), and a shared completion token budget.
Resources
agent://profiles/{name}: Read a specific agent profile configuration as JSON.
⚙️ Configuration & Environment Variables
Variable | Fallback (Legacy) | Default | Description |
|
|
| API key for OpenAI-compatible endpoint |
|
|
| Base URL for |
|
|
| Default model for agents without custom override |
|
|
| SQLite database path for profiles and session audit events |
|
|
| HTTP request timeout in seconds |
🧪 Testing & Development
Run the test suite with pytest:
uv run pytest🗺️ Roadmap
✅ Solo mode and profile registry
✅ Bounded Discussion with independent proposals, critics, judge, blackboard, and output-token budget
✅ Solo autonomous workspace execution (file tools, bash commands, heartbeat, and watchdog)
⏳ Subagent verification during discussions and resumable background sessions
📄 License
MIT
Available Tools
5 toolscreate_agentC
Create a reusable profile. Provider endpoint and API key are server-wide.
Inputs: name (required), system_prompt (required), role, tags, +3 more. Returns: object
list_agentsB
List profiles without exposing system prompts or secrets.
Inputs: no named parameters. Returns: result
run_discussionA
Run a bounded multi-agent discussion with an independent judge.
Provide at least two participant names. judge may be omitted when a
profile with role judge exists. The token limit applies to generated
completion tokens across the entire discussion.
Inputs: task (required), agents (required), judge, max_rounds, +1 more. Returns: object
run_soloB
Run one agent to execute a task.
If working_dir (or workspace_path) is provided, the agent receives full workspace
tools (file inspection, edits, and shell command execution) to autonomously accomplish the task.
Includes periodic heartbeat progress reporting and inactivity watchdog protection.
Inputs: task (required), agent, prompt, max_steps, +5 more. Returns: object
update_agentB
Update fields on an existing profile; omitted fields remain unchanged.
Inputs: name (required), role, tags, model, +3 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action on a clearly identified resource: profile CRUD (create/update/list) versus execution (run_solo for one agent, run_discussion for multi-agent with a judge). The descriptions clearly delineate the two execution modes, so there is little risk of misselection.
Names follow a mostly consistent verb_noun pattern (create_agent, update_agent, run_solo, run_discussion). The only minor deviation is plural 'list_agents' versus singular elsewhere, but the convention remains predictable and readable.
Five tools is slightly lean for a profile-management plus execution server, but each tool earns its place covering profile lifecycle and both single- and multi-agent runs. Nothing appears redundant or padded.
The profile lifecycle lacks delete and get/read-single operations, so an agent can create, update, and list profiles but cannot remove or fetch one specifically. Execution paths are covered, but the CRUD surface has a notable gap.
Related MCP Connectors
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
Design, build and run teams of AI agents with checked handoffs between them.
Memory, reflection and safety for AI agents. Hosted or local, no vector database.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Related MCP Servers
- AlicenseAqualityDmaintenanceMulti-advisor debate, institutional memory, trust scoring, and cognitive governance for AI agents, all running locally.59 npm1MIT
- AlicenseNot gradedqualityAmaintenanceRun dynamic, multi-agent workflow scripts — agent(), parallel(), pipeline() — over real coding agents (Claude Code and OpenAI Codex), with deterministic journaling, resume, token budgets, and git-worktree isolation.7Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables multi-agent code review and iterative improvement loop using different LLM backends, with deterministic scoring and audit trail.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to execute and validate autonomous multi-agent workflows with tools for workflow execution, output validation, and execution logging, plus resources and prompts for task decomposition and error recovery.MIT