syndic-mcp
v0.8.12MCP server for orchestrating external AI CLI engines with sentinel-file completion detection
An MCP server that lets any MCP-capable AI host (Claude Code, Cursor, Cline, etc.) spawn and orchestrate external AI CLI engines — Codex, Gemini CLI, Claude Code, and OpenCode — as subagents for parallel or delegated task execution. Tasks run in their own processes. Completion is detected via a sentinel file written by the engine, so the orchestrator never polls or blocks unnecessarily. 1. The orchestrating AI calls syndic_run with an engine, a prompt, and an optional working directory. 2.
Summary extracted from the README.
syndic-mcp
An MCP server that lets any MCP-capable AI host (Claude Code, Cursor, Cline, etc.) spawn and orchestrate external AI CLI engines — Codex, Gemini CLI, Claude Code, and OpenCode — as subagents for parallel or delegated task execution.
Tasks run in their own processes. Completion is detected via a sentinel file written by the engine, so the orchestrator never polls or blocks unnecessarily.
How it works
- The orchestrating AI calls
syndic_runwith an engine, a prompt, and an optional working directory. - syndic-mcp writes the full task (prompt + structured completion protocol) to a
.syndic/<id>.promptfile in the working directory. - A Windows supervisor starts the CLI suspended, assigns it to a process job, then resumes it. Native executables and recognized npm shims run without a command shell.
- When the engine finishes, it writes its results to
.syndic/<id>.output.mdand a structured sentinel to.syndic/<id>.md. - syndic-mcp validates the sentinel, reads the output, stops the process job, and confirms termination before reporting the outcome.
- The orchestrating AI polls with
syndic_statusor useswait: truefor synchronous execution.
Prerequisites
Install the CLI engines you intend to use:
| Engine | Install |
|---|---|
| Codex CLI | npm install -g @openai/codex |
| Gemini CLI | npm install -g @google/gemini-cli |
| Claude Code | npm install -g @anthropic-ai/claude-code |
| OpenCode | npm install -g opencode-ai |
Node.js >= 18, Windows, and PowerShell 7 (pwsh.exe on PATH) are required.
Installation
npm install -g syndic-mcp
Or run directly without installing:
npx syndic-mcp
MCP Configuration
Add to your MCP host's config (e.g. claude_desktop_config.json, .claude.json, mcp.json):
{
"mcpServers": {
"syndic": {
"command": "syndic-mcp"
}
}
}
Or with npx:
{
"mcpServers": {
"syndic": {
"command": "npx",
"args": ["syndic-mcp"]
}
}
}
Tools
syndic_run
Spawn an external AI CLI engine to execute a task.
| Parameter | Type | Required | Description |
|---|---|---|---|
engine |
"codex" | "gemini" | "claude" | "opencode" |
Yes | Which CLI engine to invoke |
prompt |
string |
Yes | Self-contained task prompt (≥10 chars, ≤200,000 chars). The engine has no context beyond this string. |
cwd |
string |
No | Absolute working directory path. Defaults to the server's cwd. |
timeout_ms |
number |
No | Timeout in ms. Range: 10,000–3,600,000. Default: 1,800,000 (30 min). |
wait |
boolean |
No | If true, block until the task completes or times out. Default: false (returns task_id immediately). |
yolo |
boolean |
No | If true, run engine without guardrails. Default: false (safe mode). See Safe mode vs YOLO mode. |
model |
string |
No | Model override for Codex, Gemini, Claude Code, or OpenCode (provider/model). Omit to use the CLI default. For Gemini, only set when the user explicitly requests a model. |
reasoning_effort |
string |
No | Codex or Claude Code reasoning effort, or OpenCode model variant, supported by the selected model/provider. Omit to use the CLI default. Rejected for Gemini. |
skip_git_repo_check |
boolean |
No | Codex only. Set true when cwd is knowingly not a git repository; otherwise codex exec refuses to start with Not inside a trusted directory. What the engine writes there is outside revision control. Default: false. Rejected for the other engines. |
mode |
"default" | "review" |
No | review restricts Claude/Codex (and, with the limit below, OpenCode) to source/semantic inspection and captures their final report. Requires yolo: false. |
review_inputs |
string[] |
No | Absolute paths to packet/procedure/evidence files the reviewer may read, in addition to tracked repository source. |
review_roslyn |
{command: string, args?: string[]} |
No | Override the automatic per-user Roslyn installation with a trusted absolute executable and arguments. Review mode only. |
review_skills |
string[] |
No | Skills the reviewer must read and apply, as plugin:skill or skill. Added to review.skills from the defaults file. Review mode only. |
review_mcp |
{name: string, command: string, args?: string[], tools: string[], path_args?: Record<string, string[]>}[] |
No | Extra MCP servers the reviewer may call, each limited to tools. command must be an absolute path. path_args maps a tool to the argument names that carry file locations. Added to review.mcp from the defaults file; an entry with the same name replaces the default. Review mode only. |
review_defaults |
boolean |
No | false ignores the defaults file for this call. Review mode only. |
For Codex with Astra at max effort, pass engine="codex", model="gpt-6-astra", reasoning_effort="max" to syndic_run along with the task prompt. These settings override the CLI defaults for that invocation. OpenCode (version 2 only) receives both in --model as provider/model#variant; use its provider/model identifier and a supported variant. An effort without a model is not sent.
For Claude Code, pass engine="claude", optionally with model="opus" and reasoning_effort="max". Syndic launches claude -p and forwards the overrides through --model and --effort. Without overrides, Claude Code uses its configured defaults.
Async response (wait: false):
{
"task_id": "abc1234567",
"status": "running",
"engine": "codex",
"message": "Task spawned. Use syndic_status to check progress."
}
Sync response (wait: true):
{
"task_id": "abc1234567",
"status": "completed",
"engine": "gemini",
"duration_ms": 12400,
"output_content": "## Output\n...",
"result": "---\nstatus: completed\n---\n\n## Summary\n...",
"error": null
}
syndic_status
Check the status of a task by its ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id |
string |
Yes | ID returned by syndic_run |
While running, returns a tail of stdout for progress visibility. When complete, returns the full output and sentinel content.
Task statuses: running | stopping | completed | failed | cancelled | timed_out
All responses include requested model/effort, launch settings/mode, observed
CLI metadata with provenance, pid, termination, and termination_error.
Observed metadata may be unavailable (null). It is never filled from the request
or model self-description. A CLI banner/event is not provider attestation.
One exception: Codex's banner prints none for an effort nobody set, and Codex then runs the
model's default. With no effort requested, observed.reasoning_effort is that default, read
from models_cache.json in CODEX_HOME (else ~/.codex), and observed.source says so. A
missing table or unlisted model leaves none.
termination is running, stopping, stopped, or unknown. Only stopped
confirms that the supervised job contains no active processes.
syndic_cancel
Request job termination and wait for evidence. Returns structured task state. An unknown termination state remains cancellable even when task status is failed. Timeout initiates termination automatically. The supervisor also terminates its job if the parent connection closes; its job handle uses kill-on-close for crashes.
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id |
string |
Yes | ID of the task to cancel |
Safe mode vs YOLO mode
Each engine supports two permission levels, selected by the yolo parameter:
| Engine | Safe (yolo: false, default) |
YOLO (yolo: true) |
|---|---|---|
| Codex | exec -s workspace-write (writes confined to workspace, unrestricted reads) |
exec --dangerously-bypass-approvals-and-sandbox (no sandbox, no approvals) |
| Gemini | --approval-mode=auto_edit (auto-approves file writes only) |
--yolo (auto-approves all tools including shell commands) |
| Claude | --permission-mode dontAsk (unapproved operations denied) |
--dangerously-skip-permissions |
| OpenCode | run --auto (auto-approve unless explicitly denied by config) |
run --auto (same policy) |
Default mode is not a read-only boundary. Use mode: review for the restrictions
below. Existing Claude automation that needs writes must supply appropriate CLI
permissions or explicitly select unrestricted mode; safe mode no longer bypasses
permission checks.
Restricted review mode
The CLI runs in temporary storage, with user hooks/plugins/memory disabled and an environment allowlist retaining OS startup variables and model authentication. No credential files are copied. Claude has no built-in tools; Codex has its shell, apps and delegation disabled and uses its read-only sandbox. Only the supplied review MCP server is configured. Installed CLIs must support these controls; unsupported flags fail the run instead of falling back to default mode.
The broker exposes tracked-file listing and bounded reads, explicit evidence-file
reads, paged diffs between any two commits (SHA, branch, tag or HEAD~n; external
diff/textconv disabled), repository status, and search_files (a case-insensitive git grep over tracked files of every
type, plain text or regex: true). Paths escaping the source root are denied unless explicitly supplied as
review inputs. It has no arbitrary command, write, publication, or memory tools.
Any reply over 60,000 characters is dropped with an error, because Claude Code saves
a larger MCP result to a file the reviewer cannot read.
git_diff takes base and head (any revision git resolves, turned into full SHAs
by the broker) and returns one page of about 40,000 characters per call:
{ base, head, path, files_total, files, files_listed, total_lines, offset, next_offset, text }.
The first page lists the changed files (a prefix when there are many) as
added<TAB>deleted<TAB>path, with renames shown as a delete plus an add. Pass path to
read one file (a literal name, not a glob) and offset set to the previous
next_offset for the next page. next_offset is null on the last page. Join the
text of all pages with no separator to get the whole diff. A line too long for one
page is split across pages. A diff over 8 MiB fails with a message to pass path.
It compares committed revisions only, so uncommitted changes need a supplied diff file.
review_status lists all supplied inputs, including snapshots outside the repository
that do not appear in list_files. read_file labels current disk reads as
working_tree or supplied_input, with a resolved path and no asserted revision.
Tracked-file access does not mean committed HEAD contents; the reported HEAD is
repository metadata, and reads are not frozen against concurrent edits. Only
git_diff compares committed revisions. Reviewers are instructed to inspect the
input inventory and relevant supplied evidence before reporting missing coverage.
Unavailable Roslyn semantic tools do not make supplied Roslyn scripts unavailable.
The reviewer returns Markdown in its final response; syndic writes the output and
sentinel after the CLI exits. The coordinator validates coverage and saves/publishes
the report. A transport success is not evidence of a complete review.
OpenCode review mode (OpenCode 2, model as provider/model, reasoning_effort as the
variant) is not a hard read-only boundary. It runs opencode run --standalone with an empty
home folder, only the review MCP server, and shell, edit, read, glob, grep, web and question
tools denied. OpenCode 2 reaches MCP tools through its execute tool and cannot hide its own
tools.opencode.* helpers (session rename, worktree create) from the model. The
prompt forbids the state-changing ones, and a review whose events show a call to one (read-only helpers such as models and worktree_list pass), or to any tool other than
execute, is rejected after the fact. A helper call that already ran is not undone.
When model is omitted, OpenCode review mode uses the first favorite entry of
~/.local/state/opencode/model.json (the picker's state), else the top-level model in
~/.config/opencode/opencode.json (config.json when opencode.json is absent), else the first recent
entry of model.json. API keys in the environment play no part in the choice. Only the model name is read,
plus the provider block for that model when that file defines it with no option except baseURL (a local server such as ollama). A block with
an apiKey or other options is never copied. The block is also passed for a model you name yourself.
Syndic does not check that a local server is running.
Claude review launches preserve the CLI's built-in tool guidance and append the
review instructions; personal and project instruction files remain disabled.
If a review returns literal tool invocation text (including after a prose opening),
or lacks broker-confirmed evidence reads, syndic retries once after
confirming the first process job has stopped. The retry keeps the task ID, model,
permissions and original timeout, and asks the CLI to make native tool calls.
Syndic never executes the printed invocation text. A second invalid response
fails the task. Rejected responses are retained as
.syndic/<id>.attempt-1.invalid-output.md and, if needed,
.syndic/<id>.attempt-2.invalid-output.md.
Before accepting a report, syndic requires broker receipts for review_status,
all lines of task.prompt, and at least one supplied input when review_inputs
is nonempty. Each retry must establish its own reads. Broker receipts retain tool
names, outcomes, and read paths/ranges in .syndic/<id>.review-evidence.jsonl
after temporary files are removed; they do not contain file contents. These checks
establish that evidence was accessed, not that every relevant file was reviewed
or that the report's conclusions are correct. The coordinator still checks coverage.
Review mode automatically uses %LOCALAPPDATA%/RoslynMcp/RoslynMcp.Server.exe,
the standard per-user installation. Supply review_roslyn to override that launcher
for a custom installation. Executables are never discovered from the reviewed
repository or its PATH. Roslyn owns solution discovery: a repository without a
supported solution gets no semantic tools. Missing installations and selection or
startup failures are reported in review_status.roslyn_error.
A CLI fixes its tool inventory when it starts and will not wait for a solution to
open, so the semantic tool names are published up front, read once per Roslyn build
from the installation and cached in the temp directory. The broker selects
the source root with warmUp=false in the background and validates solution
containment before semantic queries; the first tool call waits for that selection. Each broker owns its own stdio server; same-solution instances
can share Roslyn's on-disk cache/database. Errors become explicit coverage gaps.
Arbitrary builds/tests run separately in the coordinator's approved environment.
This is a tool-access boundary, not OS containment of a compromised CLI or semantic server. Roslyn can evaluate project metadata and write caches. Use trusted tooling and source environments; do not put secrets in review evidence. The Windows job controls process lifetime, not network or filesystem privileges.
Defaults, skills and extra MCP servers
Every review launch reads ~/.syndic/defaults.json, or the file named by the
SYNDIC_DEFAULTS environment variable:
{
"review": {
"skills": ["ponytail:ponytail-review", "my-local-skill"],
"mcp": [
{
"name": "docs",
"command": "C:/tools/docs-mcp.exe",
"args": ["--stdio"],
"tools": ["read_doc", "list_docs"],
"path_args": { "read_doc": ["target"] }
}
]
}
}
The file is optional. A missing file adds nothing. An unreadable file, invalid JSON
or an invalid entry never fails the call: the review runs without that part and
review_status.notes says why. Pass review_defaults: false to ignore the file for
one call. Entries from the call (review_skills, review_mcp) are added to the file's.
Skills. plugin:skill is looked up in the plugin's install folder from
~/.claude/plugins/installed_plugins.json (the newest cached version when the
registry is missing). A bare skill is looked up in ~/.claude/skills. Each
SKILL.md becomes a supplied input and the reviewer is told to read and apply it.
A name that cannot be found is reported in review_status.notes and the review still
runs. Reading a skill does not satisfy the evidence check: when review_inputs is
nonempty, a report still needs a read of one of those files.
Extra MCP servers. The review broker starts each server from the review root on
first use and exposes only the tools named in tools. Tool schemas are read once at
launch (30 s limit per server). A tool its server declares as changing state
(readOnlyHint: false or destructiveHint: true) is not offered. Upstream
annotations are kept. A tool whose name is already taken by a broker tool or another
server is skipped. review_status.extra_tools lists what is available, and each
skipped tool or missing server is named in review_status.notes. A server name used
twice keeps its last entry.
Extra tools may read any file under the review root (tracked or not), the
review_inputs files and the resolved skills. Nothing else. Before forwarding a
call the broker checks its arguments, including nested values and object keys:
- A string is a file location when its key names one (path, file, dir, uri, source,
target and similar), when
path_argslists the key for that tool, or when its shape says so: an absolute path, afile:URI, a\\?\or\\.\prefix, or a..segment. Onlyhttp(s),ftp(s)andws(s)URLs are skipped. - A location must resolve, through links and junctions, to a path under the review root or to a supplied input. A path that does not exist yet is judged by its nearest existing parent.
- These are refused: drive-relative values such as
C:name, a path component with a trailing dot or space or a colon, and reserved device names (CON,NUL,COM1and the rest).
The guard recognizes locations by name and shape, so it cannot know a tool's own
argument rules. A location passed under an argument that is not path-like, not in
path_args and not shaped like a path is not checked. List every such argument in
path_args, and allow-list only tools you trust. The guard is a tool-access
boundary, like the rest of review mode, and does not contain a compromised server.
Completion protocol
syndic-mcp instructs each engine to write two files when it finishes:
.syndic/<id>.output.md — findings, results, or generated content:
## Output
(engine's findings/results)
.syndic/<id>.md — structured sentinel (read by syndic-mcp):
---
status: completed
---
## Summary
(what was accomplished)
## Files Changed
(list of changed files, or "None")
## Issues
(problems encountered, or "None")
If the engine hits an unrecoverable error it uses status: failed in the sentinel.
Only the exact single status field in frontmatter is parsed. Partial/malformed
sentinels or a missing paired output cannot certify completion. Default mode fails
when no readable sentinel exists, even after exit code zero; consumers must check that
usable output exists. Review mode requires a captured final response.
Working directory and file isolation
Each task creates files under .syndic/ in the working directory:
<cwd>/
└── .syndic/
├── <id>.prompt # task instructions (written by syndic-mcp)
├── <id>.output.md # results (written by engine)
└── <id>.md # completion sentinel (written by engine)
You can safely add .syndic/ to .gitignore.
Example: parallel code review
syndic_run(engine="codex", prompt="Review src/auth.ts for security issues. List findings in the output file.", cwd="/my/project")
syndic_run(engine="gemini", prompt="Review src/auth.ts for performance issues. List findings in the output file.", cwd="/my/project")
Poll both with syndic_status until complete, then compare results.
Platform notes
- Windows only. PowerShell 7 compiles the bundled job supervisor at runtime.
Recognized npm JS launchers run through Node; other command shims use validated
cmd.exearguments. Unsupported shell expansion characters are rejected. MSYS2_ARG_CONV_EXCL=*is set in the child environment to prevent MSYS2/Git Bash path mangling.
License
MIT