Where is the source code for Legion?
The source code is linked from the repository URL on this page.
@faulkj
基本信息
MCP-native LLM councils for debates, juries, blind panels, voting, refinement, and custom multi-model deliberation.
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"legion": {
"command": "npx",
"args": [
"-y",
"legion-mcp",
"stdio"
],
"cwd": "C:/path/to/folder-containing-config",
"env": {
"DEFAULT_BASE_URL": "https://your-gateway.example.com",
"DEFAULT_API_KEY": "sk-your-key",
"MCP_TRANSPORT": "stdio",
"ALLOW_NO_MODELS": "true"
}
}
}
}Fan a prompt out to two or more models; each answer comes back as a separate content item. ``` models — array of selectors: "modelSlug" or "modelSlug:roleSlug" (min 2) roles — optional ad-hoc roles for this call: { "name": "instructions" } rounds — discussion rounds (default 1; max set by MAX_ROUNDS) mode — "sequential" (default) | "parallel" | "private" | "independent" synthesize — selector for a synthesis turn (never speaks in normal rounds) synthesizeEvery — N: every Nth round (1 = every round, 0 = end only); "end"=0 default; needs synthesize frame — selector for a neutral framer that opens/steers (mirror of synthesize) reframeEvery — N: re-frame every Nth round; 0/"end" = opening frame only; needs frame closingStatements — true: one final statement per speaker before synthesis; needs synthesize objectives — optional { team: goal } map for team runs (see Teams) vote — optional anonymous peer-vote ballot instructions (see Anonymous voting) voteEvery — N: vote every Nth round (always the last); 0/"end" = one final vote; needs vote voteVisibility — "aggregate" (default, counts only) | "ballots" (also every cast label, unordered) tokenBudget — optional soft cumulative token budget (overrides TOKEN_BUDGET) ``` **Sizing `tokenBudget` against `maxTokens`**: `maxTokens` caps one turn's visible output (reasoning models add their own thinking allotment on top); `tokenBudget` counts every call's input *and* output across the whole run. Estimate `turns × (context + maxTokens + allotment)` where `turns = speakers × rounds + eliminations + syntheses (+ closings, votes)` and context grows each round as the transcript accumulates — input dominates in long councils. Set the budget above that estimate; one that only covers outputs trips in round two and skips the rest. It is soft: parallel rounds can overshoot before it checks. **Selectors**: `"fable"`, `"opus:skeptic"`, `"gpt:builder"`. Same model + different roles = distinct speakers (`["gpt:judge", "gpt:skeptic"]`). Identical selectors are **not** deduped — `["gpt:critic", "gpt:critic"]` runs two independent critics (labeled `critic 1`/`critic 2`), at ~2× the tokens. A trailing `@team` tags a speaker's side: `"gpt:combatant@blue"` (see **Teams**). **Modes** (a 2×2 of *see peers?* × *see own prior turns?*): *sequential* (default) — each turn sees the full transcript so far, including same-round peers. *parallel* — sees only completed earlier rounds, blind to same-round peers. *private* — sees only its own prior turns (blind self-refinement across rounds). *independent* — sees nothing but the prompt during rounds; a true blind panel. All modes' synthesis still sees the whole transcript. **Synthesizer**: `synthesize` names a final consolidating voice that does **not** speak in normal rounds — it runs only in its synthesis slot. `synthesizeEvery` controls timing: a number `N` runs synthesis every Nth round (feeding forward, always including the last; `1` = every round, `0` = end only). `end` is an alias for `0` and is the default. Interim per-round syntheses get an interim banner, not the "final" one. **Closing statements**: set `closingStatements: true` (requires `synthesize`) to give every round speaker one final parallel statement over the whole transcript, right before the synthesis — labeled `[closing / role]`. They run in parallel regardless of `mode`, and the synthesis sees them. When `synthesizeEvery` is a number, the final round's interim synthesis is skipped so there's exactly one synthesis, after the closings. **Transcript labels**: turns are labeled by **role** (`builder`, `critic 1`, `critic 2`), never by model — so models judge each other's content, not reputation. Role-less selectors show the model slug. `structuredContent.turns` still reports real selectors for you. **Ad-hoc roles**: define personas inline for one call — `roles: { "contrarian": "Argue against every claim." }`, then `models: ["gpt:contrarian", "fable"]`. Shadows a file role of the same name; disa…
Free-for-all: pit two or more contestants against each other, then crown a winner. Staff `combatant` with as many models as you like (min 2, no cap) — each argues its own answer is best and picks apart the others. A single `overseer` declares the winner and says why. Staff via models[]: combatant (2+), overseer (one). overseer also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Diverge on ideas independently, then converge. Staff via models[]: ideator (one), pragmatist (one), curator (one). curator also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Adversarial stress-test: one model defends a position while the rest gang up on it. Staff `victim` with exactly 1 model — it must hold its ground. Staff `bully` with 2 or more models that attack the victim's reasoning, poke holes, and demand answers. Optionally staff 1-2 `teacher` models to supervise and rule on whether the victim survived or folded. Staff via models[]: victim (one), bully (2+), teacher (up to 2). teacher also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Ship-readiness review of a code change. A builder argues for shipping, a critic hunts for flaws, and a judge weighs both and delivers a verdict. Staff via models[]: builder (one), critic (1-5), security (optional), judge (one). judge also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Try a dispute in court: opposing legal teams argue, jurors deliberate and vote by side, and one judge rules. Staff `lawyer` with 2 or more team-tagged models across at least two sides — for example `model:lawyer@prosecution` and `model:lawyer@defense` — and supply each side's case via `objectives`. Staff `juror` with 3-12 neutral models and one neutral `judge`. One lawyer per side handles each round, rotating through the team in selector order. Jurors observe silently, then weigh the complete trial and cast the existing secret side ballot after lead lawyers close. Larger legal teams gain no speaking or ballot advantage. The judge sees the anonymous tally, then delivers the binding ruling. Staff via models[]: lawyer (2+), juror (3-12), judge (one). judge also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Adversarial pressure-test of a proposal. Staff via models[]: proponent (one), opponent (one), moderator (one). moderator also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Double-blind study: independent participants, then a blind synthesis. Staff `participant` with 2 or more models — each answers with ZERO visibility of the others (even across rounds), so no one anchors on anyone else. A `researcher` consolidates the findings. Because turns are labeled by role, the researcher weighs the answers on merit, not on which model wrote them. Staff via models[]: participant (2+), researcher (one). researcher also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Hold an election: candidates campaign, then the field decides by secret ballot — the vote IS the verdict, not a judge's opinion. Staff `candidate` with 2 or more models — each makes its case and, over rounds, responds to rivals. Optionally add one `incumbent` (a candidate defending their record) and an `electorate` of silent voters who read every round but never campaign. After the final round the candidates AND the electorate cast one anonymous ballot for the strongest position — candidates may back their own, as in a real election — and a neutral `returning_officer` certifies the tally WITHOUT overruling it. Unlike battle_royale or courtroom, no authority picks the winner — the voters do. Use rounds >= 2 so campaigns can react. Staff via models[]: candidate (2+), incumbent (optional), electorate (0+), returning_officer (one). returning_officer also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Final girl: a group is picked off one by one each round until a single survivor remains. Staff `survivor` with 3 or more models — each keeps making its case round after round, reacting to who was just cut. Survivors speak simultaneously within a round (so they answer the last cut, not each other mid-round), then the `slasher` eliminates one until only the final girl is left standing — and she delivers the ending. Cuts are spread evenly across `rounds`, with the last cut on the final round — 3 survivors over 5 rounds die after rounds 3 and 5, so every round happens and survivors get time to build a case. Ask for at least as many rounds as survivors minus one. Feed the question or task via the prompt/context. If the field is still crowded after the last round, bounded cleanup cuts try to reach one survivor. If cleanup stalls, the result explicitly marks the contest incomplete and the first remaining survivor closes. Cost: one turn per surviving speaker each round, plus elimination calls and retries, plus the closing turn. Staff via models[]: survivor (3+), slasher (one). survivor also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Focus group: a moderated panel reacts to something and riffs off each other, then a facilitator reports the themes. Staff `panelist` with 2 or more models — each reacts in their own voice AND builds on what earlier panelists said (real cross-talk, unlike a blind panel). Optionally add one or more `contrarian` to keep the group honest. A `facilitator` distills the discussion into themes, points of consensus, and dissent. Feed the thing under discussion via the prompt/context. Staff via models[]: panelist (2+), contrarian (0+), facilitator (one). facilitator also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Run several solvers through a gauntlet: each privately refines its own answer over multiple rounds, then a judge crowns the best. Staff `solver` with 2 or more models — each sees only its OWN prior attempts (blind to rivals) and improves across rounds. A single `judge` picks the strongest final answer. Best with rounds >= 2, where the private self-refinement pays off. Staff via models[]: solver (2+), judge (one). judge also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Fast two-voice gut check, no deliberation. Staff via models[]: answerer (one), challenger (one). Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Relay polish of an existing artifact: pass it down a line of improvers, consolidating each round. Supply the idea, code, or text to improve via the prompt/context — this preset improves what exists, it does not create from scratch. Staff `improver` with 2 or more models; each takes the current draft and makes it better. A `polisher` consolidates at the end of every round, so each round builds on the last polished version. Use rounds >= 2 to keep iterating. Staff via models[]: improver (2+), polisher (one). polisher also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Tag team match: two or more teams, one wrestler legal per team each round, tagging out between rounds while a neutral ref calls the finish. Staff `wrestler` with team-tagged selectors — `model:wrestler@blue`, `model:wrestler@red` — and give each team a shared objective via `objectives` ({ "blue": "…", "red": "…" }). Keep the sides even: **2 a side** for a standard tag match (4 wrestlers), **3 a side** for a six-man tag (6), or **6 a side** for a twelve-man war (12). Only ONE wrestler per team is legal each round; the rest are on the apron reading the match, and the legal wrestler rotates every round, so a 3-person team cycles through all three across rounds 1-2-3 and a 6-person team takes six rounds to get everyone in. Whoever is in has to pick up their partner's thread, not restart it. Optionally staff an `announcer` (no team) to call the opening bell and the turning points. The `ref` names the winning TEAM and why. Use rounds >= 2x your team size so everyone gets in at least twice. Optionally book interference: staff `run_in` with a team tag (`model:run_in@blue`) and it hits the ring for exactly ONE round — at most two, and if you book two, book **one per side** (`@blue` and `@red`) so the interference cuts both ways. Set `cameoRound` to book the round it happens (default: the middle of the match). A run-in is not a wrestler: it never becomes legal, never takes a tag, and is gone the moment it has done its damage. Staff via models[]: wrestler (4-12), run_in (up to 2), announcer (optional), ref (one). ref also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
Resolve a stalemate with a decisive third voice. Staff via models[]: side_a (one), side_b (one), arbiter (one). arbiter also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
War Games: two or more teams enter a staggered-entry cage match, one combatant at a time, while a neutral ref calls fouls and, at the bell, names the winning team. Staff `combatant` with team-tagged selectors — `model:combatant@blue`, `model:combatant@red` — and give each team a shared objective via `objectives` ({ "blue": "…", "red": "…" }). Round 1 starts with one combatant per team; every round after, one more enters (alternating teams) until the whole field is in — then it's a full brawl. Optionally staff a `booker` (the show-runner) to set the card on the opening bell and throw swerves every couple of rounds to keep the match live. The `ref` may eliminate a combatant for foul play (optional) and delivers a verdict naming the winning team and why it out-argued the others. Needs >= 2 teams. Raise rounds for bigger teams: rounds >= (total combatants - team count) + 2 leaves two brawl rounds. Staff via models[]: combatant (2+), booker (optional), ref (one). ref also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
A structured team builds something new from a brief: architect, builders, and a critic collaborate, then an editor ships it. Unlike `refine` (a uniform improver relay on an existing thing), this is a differentiated team creating from scratch. Staff `architect` (shapes the approach), `builder` (produces the work — one or more), `critic` (pressure-tests), optionally `researcher` (facts / prior art), and `editor` (final cut). Sequential, so each voice builds on the last. Use rounds >= 2. Staff via models[]: architect (one), builder (1+), critic (one), researcher (optional), editor (one). editor also synthesizes. Available models: . Set maxTokens to about 1500 — it is plenty per turn, and reasoning models get their own thinking room on top. The maximum is 3000; larger values are rejected.
MCP-native LLM councils for debates, juries, blind panels, voting, refinement, and custom multi-model deliberation.
The README includes setup instructions such as - Node.js 24+.
The source code is linked from the repository URL on this page.
If the README contains a parseable MCP configuration block, it is shown in the Config tab.

Official MCP server for imageat — AI image and video generation for AI assistants. Generate images and videos, and use 20+ editing tools (background remove/replace, inpainting, object eraser, relight, virtual try-on) dir
AON MCP connects AI agents to real, buyable products and services with live pricing and tracked links—enabling builders to earn developer revenue share from attributed clicks and conversions.

Wallet auth for AI agents: send a blockchain wallet and conditions, get a signed yes or no across 37 chains, never the balance. Hosted at https://api.insumermodel.com/mcp with no key (10 tools), or run locally with npx -

Singularis is unlimited computation. Bring us your hardest problems. MCP server; free agent key: 500 credits instantly.

**Melaya gives an AI assistant hands.** It is a remote MCP server, so there is nothing to install and no API key to configure — one URL works in Claude, ChatGPT, Le Chat, Cursor and any MCP client. ### Your Android phon
评论