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-mcprun 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.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| role | No | general | |
| tags | No | ||
| model | No | ||
| temperature | No | ||
| system_prompt | Yes | ||
| max_output_tokens | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does add one genuinely useful fact not in the schema β that provider endpoint and API key are server-wide and therefore not per-agent inputs β but says nothing about persistence, name-collision behavior, permissions, or whether created agents are immediately runnable by run_solo.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with the action and followed by the key constraint. No filler, though the brevity is partly under-specification rather than tight editing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need not be described, and the server-wide credential note is helpful. But for a 7-parameter creation tool with no annotations and zero schema descriptions, the definition leaves an agent without enough information to populate parameters confidently or know how this interacts with update_agent/run_solo.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 7 parameters, so the description must compensate and largely does not. It implicitly explains the absence of endpoint/API-key arguments, but leaves name, role, tags, model, temperature, and max_output_tokens entirely uninterpreted (valid ranges, defaults' meaning, format of tags).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
"Create a reusable profile" gives a verb and a resource, but "profile" is an oblique synonym for "agent" and is not clearly differentiated from the siblings update_agent, list_agents, run_solo, and run_discussion. An agent can infer it creates an agent-like entity, but the description never uses the word "agent" or clarifies the relation to run_solo/run_discussion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No statement of when to use this vs. update_agent or list_agents, no prerequisites, no mention of what to do if an agent with the same name already exists. The only contextual hint is that provider credentials are server-wide, which is a constraint rather than usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_agentsB
List profiles without exposing system prompts or secrets.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose one valuable behavioral trait β that system prompts and secrets are not exposed β which the agent could not infer otherwise, but it says nothing about pagination, scope, or permissions for a list operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single tight sentence with the privacy caveat placed where it matters. No filler, though it is arguably terse enough to leave gaps.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described, and there are no parameters to document. What remains missing is any guidance on when to call it relative to the run/create/update siblings, which leaves the definition only minimally viable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so the baseline is 4. Schema coverage is 100% and there is nothing for the description to compensate for.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The verb 'List' is clear, but the resource named is 'profiles' while the tool is named list_agents, leaving the agent to infer they are the same objects. It provides no differentiation from the sibling tools (create_agent, update_agent, run_solo, run_discussion), though the read/list nature is implied.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no statement of when to use this tool versus the sibling create/update/run tools. Usage is only implied by the verb 'List'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| judge | No | ||
| agents | Yes | ||
| max_rounds | No | ||
| max_output_tokens | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It usefully discloses that the run is 'bounded' and that the token limit spans the entire discussion rather than a single agent's output, but says nothing about cost, latency, whether the run is idempotent, or what control the caller retains mid-run.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Roughly 50 words, front-loaded with the core action, then the ordering constraints. The hard line breaks make it slightly choppier than needed, but no sentence is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Run a bounded multi-agent discussion with an independent judge. Provide at least two participant names; `judge` can be omitted if a profile with role `judge` exists. The token limit applies to generated completion tokens across the whole discussion. Missing: what `max_rounds` controls and when to prefer this over run_solo.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 5 parameters, so the description must compensate. It clarifies the `agents` minimum (two), the `judge` omission fallback, and the scope of `max_output_tokens`, but leaves `task` and `max_rounds` entirely unexplained β 2 of 5 parameters remain pure guesswork.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Run a bounded multi-agent discussion with an independent judge'), which is clearly distinguishable from the agent-CRUD siblings. It stops short of naming run_solo as the contrasting one-on-one alternative, so the multi-agent framing does the separation implicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete preconditions in 'Provide at least two participant names' and the judge-omission rule, which is real conditional guidance. However it never says when to pick this tool over run_solo, nor what kinds of tasks warrant a multi-agent debate versus a single run.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| agent | No | ||
| prompt | No | ||
| max_steps | No | ||
| working_dir | No | ||
| workspace_path | No | ||
| max_output_tokens | No | ||
| heartbeat_interval_seconds | No | ||
| inactivity_timeout_seconds | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does add real value: workspace tool access is gated on working_dir/workspace_path, plus heartbeat reporting and inactivity watchdog protection. However, it omits critical operational traits such as whether the call blocks until completion, what happens when the watchdog fires or max_steps is hit, and any auth or cost implications of launching an autonomous agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core action and free of filler. The conditional workspace detail is placed immediately after the purpose statement, which is good ordering, though it could be trimmed slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described. Still, for a complex 9-parameter autonomous-execution tool with zero annotation coverage, the description leaves too much unsaid about blocking behavior, timeout outcomes, and the task/prompt/agent parameter relationships.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 9 parameters, so the description must compensate. It explains the semantic effect of working_dir/workspace_path (agent gains file and shell tools) but says nothing about task vs. prompt, agent selection, max_steps, max_output_tokens, heartbeat_interval_seconds, or inactivity_timeout_seconds, leaving most parameters undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Run one agent to execute a task.' The phrase 'one agent' implicitly contrasts with the multi-agent sibling run_discussion, but the description never names that alternative, so an agent must infer the distinction from the tool name alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No when-to-use guidance, no prerequisites, and no mention of run_discussion as the alternative for multi-agent work. The only conditional offered ('if working_dir is provided...') describes a behavioral effect of a parameter rather than when to choose this tool over its siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_agentB
Update fields on an existing profile; omitted fields remain unchanged.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| role | No | ||
| tags | No | ||
| model | No | ||
| temperature | No | ||
| system_prompt | No | ||
| max_output_tokens | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does disclose the key non-obvious trait: omitted fields remain unchanged (partial update, not replace). It still omits whether changes are reversible, what auth is needed, and whether the required "name" is an identifier that renames the agent or just a lookup key.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single tight sentence with the action first and the partial-update constraint second; every clause earns its place and there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need no explanation, but for a 7-parameter, zero-coverage mutation tool with no annotations the description is too thin. Parameter intent and the semantics of the required "name" field are missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 7 parameters, so the description must compensate and it largely does not. It says nothing about role, tags, model, temperature, system_prompt, or max_output_tokens, nor does it clarify why "name" is required while everything else is optional.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ("Update fields on an existing") and describes the mutation style, so the agent can distinguish it from create_agent. However, it calls the resource a "profile" while the tool name and siblings use "agent", and it never names an alternative tool, so the sibling distinction is only inferable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this versus create_agent or list_agents, and no prerequisites (e.g., the agent must already exist, permissions required) are stated. The partial-update behavior implies an edit path but the description leaves all routing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
create_agent - First observed
list_agents - First observed
run_discussion - First observed
run_solo - First observed
update_agent
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.
Maintenance
Related MCP Connectors
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
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.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Related MCP Servers
- AlicenseAqualityDmaintenanceMulti-advisor debate, institutional memory, trust scoring, and cognitive governance for AI agents, all running locally.511 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