The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Jules Dispatch listing page.
Batch-dispatch tasks to Google Jules in parallel — and use it as an MCP tool inside Claude Code or OpenAI Codex CLI.
🌐 Languages: English · 简体中文
🌐 Landing page & interactive docs
https://yuuqq.github.io/jules-dispatch/ — full onboarding guide and MCP integration examples
jules-dispatch is a CLI and an MCP server for the Google Jules API that lets you:
It turns Jules from a "one task at a time" tool into a massively parallel coding workforce, controlled by either humans on the CLI or other AIs over MCP.
Entirely optional. All core commands work without any LLM key. Skip this section if you only want raw dispatch.
Stop hand-writing task YAML. Give jules-dispatch one sentence and let an LLM expand it into N parallel Jules sessions.
Bring your own LLM — works with any OpenAI-compatible /chat/completions endpoint:
| Provider | LLM_BASE_URL | Example LLM_MODEL |
|---|---|---|
| OpenAI (default) | (omit — defaults to https://api.openai.com/v1) | gpt-4o-mini, gpt-4o, o3-mini |
| OpenRouter | https://openrouter.ai/api/v1 | openrouter/auto, anthropic/claude-opus-4.7 |
| Ollama (local, free) | http://localhost:11434/v1 | llama3.1, qwen2.5-coder:32b |
| Groq | https://api.groq.com/openai/v1 | llama-3.3-70b-versatile |
| Together / Fireworks / DeepInfra / vLLM / LiteLLM / Azure OpenAI | (their endpoint) | (their model id) |
Configure via env vars (LLM_API_KEY, LLM_BASE_URL, LLM_MODEL) or per-invocation flags (--llm-key, --llm-base-url, --llm-model). OPENAI_API_KEY and OPENROUTER_API_KEY are also recognised as fallbacks.
| Command / Tool | What it does |
|---|---|
jules-dispatch plan-tasks "<intent>" | Plan only — print or write tasks to a YAML file |
jules-dispatch auto "<intent>" | Plan + dispatch in one shot (with confirmation) |
MCP jules_plan_tasks | Same planning, exposed to Claude Code / Codex (only registered if an LLM key is configured) |
MCP jules_auto | One-shot plan + dispatch (only registered if an LLM key is configured) |
jules-dispatch mcp) — 15 always-registered tools, plus 2 optional planning tools when an LLM key is configured--json mode — machine-readable output on every command for AI agents and shell pipelinesplan, approve commands + requirePlanApproval: true task optiontail <id> streams activity events as they happencancel <id> aborts runaway runsget <id>, status --ids no longer limited to the recent pageRetry-Afterdispatch - reads YAML/JSON from a pipe--api-key flag — pass keys per-invocation, no .env required| Feature | Details |
|---|---|
| ⚡ Bounded, paced dispatch | Continuously replenish a 1–50 worker pool and optionally space launches with --pace-ms |
| 📋 YAML task files | Multi-document YAML supported (--- separators) |
| 🔄 Status polling | Auto-detects PRs, plan approvals, failures |
| 💬 Plan & message control | Approve plans, send follow-up messages, cancel sessions |
| 🤖 MCP server | Drop into Claude Code or Codex as a tool |
| 📦 Structured output | --json mode for clean piping into agents and scripts |
| 📝 Dispatch logs | JSON audit trail of every dispatch run |
jules-dispatch works best when a change can be split into independent, PR-sized tasks. If tasks edit the same files or depend on earlier output, dispatch them in separate waves instead of running them concurrently.
Suppose the auth, billing, users, and audit modules all need tests. Put one self-contained task file per module in a dedicated directory, then dispatch the directory as a batch:
Each Jules session owns one module. With AUTO_CREATE_PR enabled, the result is a set of focused PRs that can be reviewed and merged independently. A failed task can be retried without restarting the rest.
Why it helps: independent test work runs at the same time without turning into one large, hard-to-review change.
For a goal such as migrating an Express API to Fastify, use the optional LLM planner to identify independent routes, middleware, startup code, and test work:
auto shows the proposed tasks and asks for confirmation before dispatching them. Use plan-tasks instead when you want to save and edit the generated YAML before anything is sent to Jules.
Why it helps: the planner reduces the cost of decomposing a broad goal while keeping the task boundaries visible and reviewable.
To add a shared CI check, security baseline, or contribution policy across several Jules-connected repositories, give each task its own source:
Place the task file in a dedicated batch directory and dispatch it with controlled concurrency and launch pacing:
Why it helps: one command coordinates the rollout while preserving a separate session and PR for each repository plus an audit log for the batch.
Authentication, authorization, and database migrations often need review before implementation begins. Require Jules to stop after planning:
Inspect the plan, send corrections if needed, approve it, and then continue monitoring:
Why it helps: you keep control of high-impact decisions without giving up delegated execution.
After configuring the MCP server, describe the outcome instead of operating each session yourself:
Analyze this repository, split its test gaps into independent tasks, and dispatch them to Jules. Ask me before approving plans or answering feedback requests. When every session finishes, summarize the outcome and PR URL for each task.
The coding assistant can call jules_dispatch, wait with jules_monitor, inspect action-required sessions with jules_interact, and return a final PR summary.
Why it helps: you manage the goal and the important decisions while the assistant handles dispatch, follow-up, and result collection.
The MCP server exposes Jules as a set of tools your coding AI can call directly.
Full setup guide (including GSD integration): docs/MCP-INTEGRATION.md
Add to ~/.config/claude-code/mcp.json (or use claude mcp add):
Then in Claude Code: "Dispatch 5 Jules tasks to add tests to the auth, payments, users, sessions, and audit modules." Claude calls jules_dispatch, monitors them with jules_monitor, and uses jules_interact when it needs full context or PR output.
Add to ~/.codex/config.toml:
This repository also ships a lightweight skill wrapper at skills/jules-dispatch/. The skill teaches Claude Code, Codex, or any Agent Skills-compatible host when and how to use the jules-dispatch MCP tools.
For Codex, copy or install the folder as jules-dispatch in your Codex skills directory, then restart Codex:
For Agent Skills-compatible hosts that use a shared skills directory, copy the same folder into that host's skills directory. The skill is only the instruction layer; you still need the MCP server configured with jules-dispatch mcp and a valid JULES_API_KEY.
The server always registers 15 tools: 3 recommended consolidated tools, 5 utility tools, and 7 deprecated aliases. Two additional planning tools are registered when an LLM key is configured.
jules_dispatch — Create one or more sessionsAccepts a single task object, an array of tasks, or a YAML/JSON string.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
tasks | object | object[] | string | Yes | — | Task definition(s). Objects need title + prompt. Strings are parsed as YAML/JSON. |
format | "yaml" | "json" | No | "yaml" | Format when tasks is a string |
parallel | number | No | 10 | Max concurrent dispatches (1–50) |
paceMs | number | No | 0 | Global minimum delay between session creation starts (0–60000 ms) |
Dispatch uses a continuously replenished worker pool rather than fixed waves: whenever one task finishes creating its session, the next queued task can start. paceMs applies globally across all workers, so consecutive creation starts are separated by at least that interval while result order still matches task order.
jules_monitor — Check status or wait for the next resolution pointParameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sessionIds | string[] | Yes | — | Session IDs to monitor |
wait | boolean | No | false | If true, poll until all sessions are terminal, any session requires action, or the timeout expires |
intervalMs | number | No | 10000 | Poll interval in ms (min 1000) |
timeoutMs | number | No | 600000 | Max wait time in ms (min 1000) |
failFast | boolean | No | false | Exit immediately on first failure |
Action-required states are AWAITING_PLAN_APPROVAL, AWAITING_USER_FEEDBACK, and PAUSED. When the result includes actionRequired, inspect those sessions with jules_interact, approve the plan or send feedback as appropriate, then call jules_monitor again for the unresolved IDs.
jules_interact — Inspect a session in full contextReturns session details, derived status, the globally latest plan, activity timeline, and PR output in one call. The server scans the complete oldest-first activity feed, then returns the newest activityCount entries in chronological order plus activityTotal for the full feed.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sessionId | string | Yes | — | Session ID to inspect |
activityCount | number | No | 10 | Number of recent activities (1–100) |
| Tool | Parameters | Description |
|---|---|---|
jules_list_sources | (none) | List all GitHub repos connected to Jules |
jules_list_sessions | pageSize?, pageToken? | List recent sessions with pagination |
jules_approve_plan | sessionId | Approve a plan-gated session |
jules_send_message | sessionId, text | Send a follow-up message |
jules_cancel_session | sessionId | Cancel a running session |
| Tool | Parameters | Description |
|---|---|---|
jules_plan_tasks | description, maxTasks?, source?, branch?, context? | Plan tasks from a high-level description |
jules_auto | description, maxTasks?, source?, branch?, parallel?, paceMs? | Plan + dispatch in one shot |
All tools return:
Errors return:
jules_dispatch_task, jules_dispatch_batch, jules_get_session, jules_list_activities, jules_get_plan, jules_status, and jules_wait_for_completion remain functional for compatibility. New integrations should use the consolidated tools.
The wizard prompts for your API key, default source, and branch. It writes a .env file.
For CI/scripts (non-interactive):
That's it — 6 steps from install to your first PR.
| Flag | Default | Description |
|---|---|---|
-p, --project <dir> | . | Directory containing your .env file |
--api-key <key> | Jules API key (overrides JULES_API_KEY) | |
--json | off | Machine-readable output. NDJSON for streaming commands. |
| Command | What it does |
|---|---|
init | Interactive first-run wizard (API key, source, branch) |
dispatch <taskFile> | Dispatch a single task. Use - to read from stdin. |
batch [taskDir] | Dispatch all .yaml/.yml/.json files in a directory |
auto <description> | LLM-plan + dispatch in one shot (with confirmation) |
plan-tasks <description> | Use LLM to expand an intent into N task drafts (no dispatch) |
status | Summary of recent sessions (or specific --ids) |
get <sessionId> | Full details of one session |
wait <ids...> | Poll until sessions are terminal, require action, or time out |
tail <sessionId> | Live-stream activity events for a session |
plan <sessionId> | Show the most recent generated plan |
approve <sessionId> | Approve a pending plan |
message <sessionId> <text> | Send a follow-up message |
cancel <sessionId> | Cancel a running session |
sources | List connected GitHub repos (auto-paginates) |
doctor | Validate environment, API key, connectivity, task files |
mcp | Run as an MCP server over stdio |
| Code | Meaning |
|---|---|
0 | Success |
1 | Generic error |
2 | Authentication error (missing or rejected API key) |
3 | Validation or configuration error (bad task file, args, or Jules settings) |
4 | Partial failure (some batch tasks failed) |
5 | Timeout (wait ran out of time) |
status reports session or activity lookup failures explicitly as status: "error" and exits nonzero instead of fabricating a Jules failure or trusting a potentially stale state. Polling commands retry only network, rate-limit, and server errors; invalid requests, authentication failures, and missing sessions fail immediately with the affected session ID in the error context.
dispatch examplesbatch examplesbatch and auto both use the same continuously replenished worker pool. --parallel caps in-flight session creation and --pace-ms sets the global minimum spacing between creation starts; it does not add a delay separately inside each worker.
wait exampletail examplejules-dispatch tracks every Jules session through its full lifecycle and surfaces each state through the CLI / MCP:
| Official state | Meaning | Recommended action |
|---|---|---|
STATE_UNSPECIFIED | No specific state was supplied | Recheck with jules_monitor or inspect with jules_interact |
QUEUED / PLANNING / IN_PROGRESS | Jules is actively progressing | Continue monitoring; use tail for live activity |
AWAITING_PLAN_APPROVAL | The generated plan needs approval | Review with jules_interact, then use approve / jules_approve_plan |
AWAITING_USER_FEEDBACK | Jules needs clarification or input | Inspect context, then use message / jules_send_message |
PAUSED | Execution is paused and needs attention | Inspect context, provide guidance if appropriate, then monitor again |
COMPLETED | Terminal success | Inspect the session and collect PR output |
FAILED | Terminal failure | Inspect the newest failure activity and decide whether to retry or replace the task |
For compatibility, jules-dispatch also normalizes legacy API states: PENDING, RUNNING, AWAITING_USER_INPUT, CANCELLED, and CANCELED. Cancellation is sent with the Jules DELETE /sessions/{id} operation.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Yes | — | Human-readable task name shown in CLI status and session lists |
prompt | string | Yes | — | Detailed instructions for the Jules agent. The more specific, the better the output. |
source | string | No | JULES_DEFAULT_SOURCE from .env | Jules source identifier, e.g. sources/github/owner/repo. Override per-task. |
branch | string | No | JULES_DEFAULT_BRANCH from .env (or main) | Git branch for the Jules session to start from |
autoMode | string | No | AUTO_CREATE_PR | Automation mode. Values: AUTO_CREATE_PR (Jules creates a PR automatically), NONE |
requirePlanApproval | boolean | No | false | When true, Jules pauses after generating a plan and waits for jules-dispatch approve <id> |
--- separators)JSON array (for batch dispatch via MCP):
The killer use case: combine jules-dispatch with Claude Code or Codex.
"I have a Node.js backend that needs to be migrated from Express to Fastify. Analyse the codebase, split the work into independent migration units, and dispatch them all to Jules in parallel using the jules-dispatch MCP tools. Then poll for completion and report back the PR URLs."
With the MCP server installed, your assistant will:
jules_dispatch with N task definitionsjules_monitor with wait: true; if action is required, inspect with jules_interact, approve or send feedback, and monitor againjules_interact to collect terminal context and PR URLsYou get N parallel coding agents orchestrated by one strategic agent, hands-free.
MIT — see LICENSE
Built to make Google Jules actually scale.