AI Counsel

True deliberative consensus MCP server where AI models debate and refine positions across multiple rounds

Documentation

AI Counsel Logo

AI Counsel

ItemReference
InterfaceMCP server over stdio
FunctionMulti-model deliberation, structured votes, convergence detection
RuntimePython 3.11; provider CLI or HTTP service
Configurationconfig.example.yaml → config.yaml, loaded beside server.py
LicenseMIT

Installation

git clone https://github.com/blueman82/ai-counsel.git
cd ai-counsel
cp config.example.yaml config.yaml
python3.11 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
Provider typePrerequisites
CLIInstalled executable; provider authentication; model access
Local HTTPRunning service; loaded model
Hosted HTTPProvider account, API key, model access
Code searchOptional rg; Python fallback
AdapterTransportShipped executable or endpoint
claude, codex, droid, geminiCLICorresponding executable name
llamacppCLIllama-cli
ollamaHTTPhttp://localhost:11434
lmstudioHTTPhttp://localhost:1234
openrouterHTTPhttps://openrouter.ai/api/v1
nebiusHTTPhttps://api.tokenfactory.nebius.com/v1
openaiHTTPhttps://api.openai.com/v1
CredentialsConfiguration
Hosted HTTPOPENROUTER_API_KEY, NEBIUS_API_KEY, OPENAI_API_KEY
Local fileOptional .env beside config.yaml; existing environment precedence
CLI authenticationProvider CLI configuration; separate from HTTP API keys

MCP client configuration

  • Placeholder replacement: /absolute/path/to/ai-counsel → clone directory.
  • Configuration key: mcpServers; client-specific configuration file.
  • Transport: stdio; no HTTP listener.
{
  "mcpServers": {
    "ai-counsel": {
      "command": "/absolute/path/to/ai-counsel/.venv/bin/python",
      "args": ["/absolute/path/to/ai-counsel/server.py"]
    }
  }
}
  • Manual stdio launch, from clone directory:
.venv/bin/python server.py

MCP tools

ToolArgumentsResult
deliberateRequired: question, participants, working_directoryResponses, synthesis, votes, transcript path, cost summary
list_modelsOptional: adapterEnabled registry models and defaults
set_session_modelsAdapter keys mapped to model IDs or nullServer-process overrides; null clears override
query_decisionsquery_text, find_contradictions, decision_id, limit, threshold, formatDecision search; registration conditional on graph enabled
get_quality_metricsinclude_problem_models, min_responses, reset_afterResponse-format metrics; optional reset

Deliberation arguments

FieldConstraint / behavior
questionString; minimum 10 characters
participantsMinimum 2 entries; each with cli, optional model, optional reasoning_effort
working_directoryRequired string; absolute existing project path recommended; file context and CLI cwd
modequick default: exactly one round; conference: requested round limit
roundsInteger 1–5; default 2; conference early termination possible
contextOptional additional context string
Omitted modelProcess override → registry default
Explicit modelEnabled registry ID where an allowlist is configured
EffortProvider/model-specific; CLI model reference
  • Tool: deliberate.
  • Placeholder replacement: /absolute/path/to/project → target project directory.
  • Prerequisites: authenticated Claude Code and Codex; access to selected models.
{
  "question": "Which changes would improve test coverage in this repository?",
  "participants": [
    {"cli": "claude", "model": "claude-sonnet-5-5", "reasoning_effort": "high"},
    {"cli": "codex", "model": "gpt-6.1-sol", "reasoning_effort": "high"}
  ],
  "working_directory": "/absolute/path/to/project",
  "mode": "conference",
  "rounds": 2
}

Model selection

AdapterEnabled current-family IDs in shipped registry
claudeclaude-opus-5-5 (default), claude-fable-5-1, claude-sonnet-5-5, claude-haiku-5-5
codexgpt-6.1-sol (default), gpt-6-astra, gpt-6-sol, gpt-6-luna
openrouter, free entriesgoogle/gemma-4-26b-a4b-it:free, google/gemma-4-31b-it:free, nvidia/nemotron-3.5-lightning:free
Other adapterslist_models; full registry
AvailabilityAccount and upstream dependent; registry membership ≠ successful invocation
Prices / billingDated sources and effort matrix; separate API, subscription, and Codex-credit units
  • Tool: list_models.
{"adapter": "claude"}
  • Tool: set_session_models.
{"claude": "claude-sonnet-5-5", "codex": "gpt-6.1-sol"}
  • Tool: set_session_models; override removal.
{"claude": null, "codex": null}

Decision graph queries

  • Tool: query_decisions.
  • Prerequisite: enabled decision graph with stored deliberations.
{"query_text": "test coverage strategy", "limit": 5, "threshold": 0.6, "format": "summary"}

Configuration and output

Setting / artifactBehavior
adaptersTyped configuration; precedence over duplicate legacy cli_tools entries
cli_toolsSupported legacy CLI configuration; deprecation warning
model_registryIDs, labels, defaults, enabled flags; disabled entries hidden from discovery
deliberation.file_treeInitial tree injection; shipped depth 2, maximum 50 files
deliberation.vote_retryMissing-vote retry; shipped maximum 1, minimum response length 100
deliberation.early_stoppingParticipant stop votes; shipped threshold 0.66
deliberation.convergence_detectionSemantic convergence checks; configurable thresholds
Vote option groupingSimilarity threshold 0.85; separate convergence thresholds
decision_graph.enabledShipped true; stored decisions and retrieved context
free_model_fallback.enabledDefault false; opt-in fallback among enabled free models
adapters.openrouter.rate_limitingFree-model spacing; bounded Retry-After handling
cost_comparisonIllustrative rate comparison; coverage and exclusions
mcp.max_rounds_in_responseShipped 3; implementation caps entries in full_debate
Transcriptstranscripts/ beneath server launch directory; result transcript_path
Decision databaseRelative path: deliberation storage from launch directory; query lookup beside server.py; absolute decision_graph.db_path for consistent resolution
Logsmcp_server.log beside server.py; stderr logging

File access and execution

SurfaceActual boundary
working_directoryContext/cwd selection; no filesystem sandbox
read_fileUTF-8; configured exclusions; shipped 1 MiB limit; paths outside cwd possible
search_codePattern search; configured exclusions; rg or Python fallback
list_filesGlob discovery; configured exclusions
get_file_treeTree generation; configured depth/file limits
run_commandExecutable allowlist; unrestricted arguments; 10-second timeout; no shell interpolation
Allowed commandsls, pwd, cat, head, tail, wc, find, git, grep, awk, sed, sort, uniq, tree, file, stat, diff
Command side effectsWrites/network operations possible through allowed programs and arguments
Cwd handlingProcess-wide directory changes during internal tool execution
Native CLI permissionsProvider-specific; shipped Codex workspace-write; Droid permission escalation
Provider dataQuestions, context, retrieved decisions, responses, requested file content
Summary generationAdditional calls through enabled-model fallback chain; possible hosted-provider use with local participants
CredentialsEnvironment/.env; no secret-file exclusion guarantee
PersistenceQuestions and arguments in logs; deliberation content in transcripts/database
Internal tool interfaceModel-generated TOOL_REQUEST markers; not separate public MCP tools

Free-model probe

Evidence, 2026-10-10Measured outcome
Nemotron report3/3 valid vote-format rounds; small sample
Gemma reportBoth variants: 3/3 HTTP 429; no successful vote-quality measurement
InterpretationFormat acceptance only; no uptime, answer-quality, or future availability guarantee
AuthenticationOPENROUTER_API_KEY; missing key → skipped report
Price guardLive catalogue check; nonzero-priced models rejected
AutomationWeekly/manual workflow; repository secret required
.venv/bin/python -m scripts.probe_free_model_votes --help
  • Optional live requests; provider quota consumption:
.venv/bin/python -m scripts.probe_free_model_votes \
  --model nvidia/nemotron-3.5-lightning:free \
  --rounds 3 --timeout 90 --output /tmp/free-model-votes.json

Development

.venv/bin/python -m pip install -r requirements-dev.txt
.venv/bin/python -m pytest tests/unit
AreaReference
MCP handlers and schemasserver.py
Request/result modelsmodels/schema.py
Configuration validationmodels/config.py
Execution and toolsEngine, tools
Adapter extensionCLI, HTTP
Tool extensionAdding a tool
Voting and convergenceVoting, convergence
Model selectionRegistry and picker
HTTP setupOllama, LM Studio, OpenRouter
Decision memoryConfiguration, troubleshooting
HTTP failuresTroubleshooting