Skip to main content
Glama

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 (or workspace_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 prompt to 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):

    1. Independent Proposals: Participating agents draft proposals in parallel without seeing other agents' work.

    2. Peer Critique: Agents review all proposals and produce structured critiques (strengths, concerns, questions).

    3. Independent Judge: A designated judge evaluates the blackboard and decides consensus vs. no-consensus with a defensible final answer and confidence score.

    4. 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

AGENT_DISCUSSION_API_KEY

API_AGENT_API_KEY

""

API key for OpenAI-compatible endpoint

AGENT_DISCUSSION_BASE_URL

API_AGENT_BASE_URL

https://api.openai.com/v1

Base URL for /chat/completions

AGENT_DISCUSSION_MODEL

API_AGENT_MODEL

gpt-4o-mini

Default model for agents without custom override

AGENT_DISCUSSION_DB

API_AGENT_DB

~/.agent_discussion_mcp/data.db

SQLite database path for profiles and session audit events

AGENT_DISCUSSION_TIMEOUT

API_AGENT_TIMEOUT

120

HTTP request timeout in seconds


πŸ§ͺ Testing & Development

Run the test suite with pytest:

uv run pytest

πŸ—ΊοΈ Roadmap

  1. βœ… Solo mode and profile registry

  2. βœ… Bounded Discussion with independent proposals, critics, judge, blackboard, and output-token budget

  3. βœ… Solo autonomous workspace execution (file tools, bash commands, heartbeat, and watchdog)

  4. ⏳ Subagent verification during discussions and resumable background sessions


πŸ“„ License

MIT

Available Tools

5 tools
create_agentC

Create a reusable profile. Provider endpoint and API key are server-wide.

NameRequiredDescriptionDefault
nameYes
roleNogeneral
tagsNo
modelNo
temperatureNo
system_promptYes
max_output_tokensNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

C2.4/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose3/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose3/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault
taskYes
judgeNo
agentsYes
max_roundsNo
max_output_tokensNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
taskYes
agentNo
promptNo
max_stepsNo
working_dirNo
workspace_pathNo
max_output_tokensNo
heartbeat_interval_secondsNo
inactivity_timeout_secondsNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

B3/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault
nameYes
roleNo
tagsNo
modelNo
temperatureNo
system_promptNo
max_output_tokensNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

B3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 5 tool updatesv0.1.0
    • First observedcreate_agent
    • First observedlist_agents
    • First observedrun_discussion
    • First observedrun_solo
    • First observedupdate_agent

TDQS

B3.2/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness3/5

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

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers