
Google Jules Mcp Server
io.github.georgeracu由 GitHub 账号 georgeracu 发布v0.4.0更新于 Oct 24, 2026
Model Context Protocol server for Google's Jules AI coding agent
概览
将 AI 助手连接到 Google 的 Jules 编码代理,使其能够创建、监控、批准并获取异步编码任务及其拉取请求。
- 可以做什么
- 把 Jules API(v1alpha)封装为 MCP 工具,覆盖仓库来源、会话生命周期和活动日志。助手可以列出已连接的 GitHub 仓库、启动编码会话、轮询状态、发送后续指令、批准计划、等待完成,并获取最终拉取请求详情。它还能列出、归档、取消归档和删除会话,并读取会话活动日志。响应会经过 Zod 模式校验,并按上下文窗口限制大小。
- 适用场景
- 适合希望在聊天中驱动 Jules 编码任务、而不必打开 Jules 网页应用的场景,尤其是在多个仓库之间操作时。也适用于先启动任务、稍后查看、最后拿到拉取请求链接的流程,包括轮询或等待长时间运行的会话。
- 运行要求
- 本地 Node.js 22+ 运行时(npm 包 google-jules-mcp-server,可通过 npx 运行或全局安装)。需要具备 Jules 访问权限的 Google 账号、通过 JULES_API_KEY 环境变量提供的 Jules API 密钥,以及安装 Jules GitHub 应用以连接仓库。需要访问 Jules API 的网络;代理可通过标准代理环境变量传入。
安装
在 SourceWeft 中
- 打开 控制台中的 Google Jules Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
google-jules-mcp-server
[CI] [codecov] [npm version] [MCP Registry] [Ask DeepWiki] [CodeRabbit Pull Request Reviews]
If you're searching for a way to drive Google's Jules coding agent from Claude, Cursor, VS Code Copilot, or any other MCP client, this is that bridge. google-jules-mcp-server is an unofficial Model Context Protocol server that exposes the full Jules API (v1alpha) as 13 tools, so your assistant can create sessions, poll status, approve plans, and fetch the resulting pull request without you leaving the chat.
Developers running Jules across many repositories at once use it to let their AI assistant manage the whole async workflow: kick off a task, check on it later, and hand back a PR link when it's done, instead of switching to the Jules web app to babysit progress. Every response is validated at runtime through Zod schemas, so a drifted Jules API response fails loudly rather than silently breaking downstream code.
Model Context Protocol (MCP) server for Google's Jules AI coding agent — unofficial. Lets AI assistants like Claude create and manage asynchronous coding tasks through the Jules API v1alpha.
Overview
Jules is Google's AI coding agent that executes development tasks in isolated cloud VMs — generating code, fixing bugs, writing tests, updating dependencies, and refactoring across files. This server exposes the full Jules API surface as 13 MCP tools, covering repository sources, session lifecycle, and activity logs.
Tasks run asynchronously and typically complete in 5–60 minutes depending on complexity.
Architecture
The server is organized by Jules resource domain rather than as one flat file:
Each resource module owns its own Zod schemas, a typed API client, and its MCP tool registrations. Zod schemas are the single source of truth: TypeScript types are inferred from them (z.infer), and every Jules API response is validated at runtime through core/http-client.ts — so a drifted API response fails loudly as a JulesResponseValidationError instead of silently producing undefineds downstream.
core/http-client.ts also centralizes retry-with-backoff (bounded, honors Retry-After) and a typed error hierarchy (JulesAuthError, JulesNotFoundError, JulesRateLimitError, JulesServerError, JulesClientError, JulesNetworkError, JulesResponseValidationError) so callers can distinguish failure modes programmatically rather than pattern-matching error strings.
Prerequisites
- Google Account with Jules access
- Jules API Key — get one from https://jules.google.com/settings#api (up to 3 keys allowed)
- GitHub Integration — install the Jules GitHub app at https://jules.google.com to connect repositories
- Node.js 22+
Quick Start
1. Install
The package is published on npm as google-jules-mcp-server. Most MCP clients can run it directly via npx — no separate install step needed, skip to step 2.
If you'd rather install it once instead of letting your client invoke npx on every launch:
This puts a google-jules-mcp binary on your PATH.
Building from source (for contributors, or to run unreleased changes):
2. Configure your API key
Get a key from https://jules.google.com/settings#api. Set it directly in your MCP client's server config (see below) — that's the only place it needs to live for normal use.
If you're building from source and want to run npm run test:smoke or use .env for local scripts:
3. Register the server with your MCP client
Claude Desktop — edit the config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
Claude Code:
GitHub Copilot CLI:
Or edit ~/.copilot/mcp-config.json directly:
VS Code (Copilot Chat agent mode) — via terminal:
Or add to .vscode/mcp.json (workspace) or via MCP: Open User Configuration (user-level):
Cursor — add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-only):
OpenAI Codex CLI:
Or edit ~/.codex/config.toml directly:
If you installed globally instead, replace "command": "npx", "args": ["-y", "google-jules-mcp-server"] with "command": "google-jules-mcp", "args": [] (and any npx -y google-jules-mcp-server in a CLI command above with just google-jules-mcp).
If you're running from a local clone instead, use "command": "node", "args": ["/absolute/path/to/google-jules-mcp-server/build/index.js"] (an absolute path to build/index.js).
Behind a corporate proxy — to support enterprise/corporate proxy setups without requiring any server-side config, the server automatically picks up proxy settings from the environment. The underlying EnvHttpProxyAgent (from undici) honours the standard HTTPS_PROXY, https_proxy, HTTP_PROXY, http_proxy, and NO_PROXY variables. What catches people out is that your MCP client spawns the server as a child process, so a variable exported in ~/.zshrc never reaches a GUI-launched app. Set it in the same env block as your API key:
Proxied requests are broken in 0.2.3 and earlier, where every call fails on a gzipped response the client never decoded. If you hit that, upgrade rather than reconfigure.
Restart your client after editing its config.
4. Verify
Ask your assistant: "List my Jules repositories." You should see the jules server connected with 16 tools available.
Available Tools
Output Size and Pagination
Everything these tools return lands in your assistant's context window, and an autonomous coding session can produce very long agent messages, progress descriptions and plans of hundreds of steps. The server therefore caps what it hands back, and says so in-band whenever it cuts something, so the assistant can decide whether to go and fetch the rest.
A capped entry in jules_list_activities names the sessionId and activityId needed to re-request it through jules_get_activity, which renders the same activity under the much larger single-activity budget — ten times the room, though not unlimited. The 8,000-character cap is the end of the line: there is no continuation token or offset for a single activity, so a jules_get_activity response that reports omitted characters says so explicitly rather than pointing anywhere else. Re-requesting it returns the same truncation.
If whole entries had to be dropped to stay inside the page budget, the response ends with Showing 12 of 40 activities; the fix there is a smaller limit, not the page token, since the token resumes after the entire requested page and would skip the entries you didn't see.
Pagination itself is unaffected by any of this. jules_list_sources, jules_list_sessions and jules_list_activities all accept pageSize (or limit) and pageToken, and echo the API's nextPageToken back when more results exist.
Async Workflow Pattern
- Create a session — returns immediately with a session ID.
- Poll every 10–30 seconds with
jules_get_status. - Monitor detailed progress with
jules_list_activities. - Retrieve the pull request URL once state is
COMPLETED, viajules_get_session_output.
Your assistant handles this polling loop automatically when asked to monitor a task.
Session Watcher (Stuck Sessions)
If you don't want your LLM client burning tokens polling for stuck sessions (e.g. AWAITING_PLAN_APPROVAL or AWAITING_USER_FEEDBACK), you can run the standalone session watcher. It runs independently of any MCP client and posts a JSON payload to a webhook when a session gets stuck.
Required environment variables:
JULES_API_KEY: Your Jules API key.JULES_WATCH_WEBHOOK_URL: The URL to POST the JSON payload to.
Optional environment variables:
JULES_WATCH_INTERVAL_SECONDS: The polling interval in seconds (default:60).
The payload structure:
Running the watcher:
Via npx:
Via local clone:
The watcher can also be run directly from a built checkout:
Example PM2 configuration (ecosystem.config.js):
Example systemd service (/etc/systemd/system/jules-watcher.service):
Example Docker one-liner:
Rate Limits and Quotas
Jules enforces task quotas based on subscription tier (Free: 15 daily / 3 concurrent; Google AI Pro: ~75 daily / 15 concurrent; Google AI Ultra: ~300 daily / 60 concurrent). Tasks count against quota even if they fail, on a rolling 24-hour window.
Development
See CONTRIBUTING.md for the full setup and PR checklist, and CODE_OF_CONDUCT.md for community standards.
Testing strategy
Unit tests use MSW to intercept HTTP at the network layer rather than mocking the client module directly — this means core/http-client.ts's own logic (auth headers, retry/backoff, error mapping, Retry-After parsing) is exercised by tests, not just the handlers built on top of it. Fixtures in tests/fixtures/ encode real, previously-verified Jules API response shapes as MSW mock bodies; because the real client parses them through the Zod schemas at test time, a schema/fixture mismatch fails the test suite immediately.
tests/smoke/live-api.smoke.test.ts is an opt-in, read-only smoke test against the real Jules API (jules_list_sources only, to avoid spending task quota). It's excluded from npm test and CI, and only runs via:
Adding a new tool
- Add/extend the resource's
schemas.ts(Zod schema + inferred type). - Add the API call to that resource's
client.ts. - Add formatting logic to
format.tsand the handler +registerToolcall totools.ts. - Add MSW-backed tests for the client, format, and tool-handler layers.
Troubleshooting
- Tools not appearing: verify the absolute path in your client config, confirm
build/index.jsexists (npm run build), and restart the client completely. - "JULES_API_KEY environment variable is required": the key isn't set in your client's server config
envblock. - "No repositories connected to Jules": visit https://jules.google.com, connect your GitHub account, and grant repository access.
- 401 / 403 / 404: 401 means an invalid API key (regenerate at the settings link above), 403 means insufficient permissions or exceeded quota, 404 means the session or repository ID doesn't exist.
- Every call fails with
Unexpected token '', "..." is not valid JSON: you're behind a proxy on 0.2.3 or earlier, where gzipped responses reached the parser still compressed. Upgrade to the latest release. Network error connecting to Jules API: fetch failed, or calls that hang: if your network requires a proxy, the server isn't seeing it. Exporting it in your shell isn't enough — your client spawns the server as a child process, soHTTPS_PROXYbelongs in that server'senvblock. See Behind a corporate proxy.
Security
Found a vulnerability? See SECURITY.md for how to report it privately.
API Reference
- Base URL:
https://jules.googleapis.com/v1alpha - Authentication:
X-Goog-Api-Keyheader - Jules web app: https://jules.google.com
License
MIT
Changelog
See GitHub Releases — every published version gets an auto-generated release with notes grouped by change type.
来源:README.md,提交 e86b482
工具
0版本历史
1- v0.4.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分