Jules MCP Server
Provides capabilities to synchronize Jules-generated code changes and unified diffs directly with local Git repositories.
Allows interaction with GitHub repositories connected to Jules, supporting repository discovery, branch management, and automated pull request creation.
Exposes Google Jules capabilities for automated coding sessions, allowing users to create sessions, manage coding plans, and interact with the Jules AI agent.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Jules MCP Server start a session to fix the authentication bug in my-org/web-app repository"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Jules MCP Server
MCP server that exposes Google Jules capabilities using @google/jules-sdk. This unified implementation uses the SDK plus direct API calls where needed, while keeping SDK-backed caching, snapshots, and artifact handling. MCP tools may use either the SDK or the REST API, whichever is the best fit for the specific operation.
Setup
Install dependencies
Provide
JULES_API_KEYvia environment or~/.jules/config.jsonBuild the server
npm install
npm run buildRun locally:
JULES_API_KEY=your_api_key node dist/cli.jsRelated MCP server: Jules MCP Server
OpenCode Integration
This repo includes a project-level OpenCode config at .opencode/opencode.json. For global setup, add to ~/.config/opencode/opencode.json (update the command path to where you built this server):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"jules": {
"type": "local",
"command": ["node", "/path/to/your/jules-mcp/dist/cli.js"],
"environment": {
"JULES_API_KEY": "your_api_key"
}
}
}
}Antigravity Integration
Example OpenCode plugin enablement snippet (merge into your config):
{
"$schema": "https://opencode.ai/config.json",
"plugins": {
"opencode-antigravity-auth": {
"enabled": true
}
}
}Tools
SDK Tools
Tool | Purpose | Key Params | Returns |
| Create a new Jules session or automated run (supports repoless sessions). |
|
|
| List recent sessions with pagination. |
|
|
| Session dashboard (status, last activity/message, pending plan). |
| Status object with activity/message/plan context |
| Approve plan, send a message, or ask and wait for a reply. |
| Confirmation or agent reply |
| Summarize code changes with file list and metadata. |
| Formatted summary string |
| Get the unified diff for a session or file. |
| Unified diff text |
| Query the local cache using JQL. |
|
|
Query example:
{
"query": {
"from": "sessions",
"where": { "state": "failed" },
"limit": 5
}
}Additional Tools (jules_*)
These tools are part of the same unified server and expose REST-style workflows plus convenience operations. They may use the SDK or the REST API under the hood, depending on which path is required for the operation. They return a structured ToolResult object:
{ success, message, data?, error?, suggestedNextSteps? }Tool | Purpose | Key Params | Notes |
| List connected repositories. |
| Returns |
| Get details for a connected repository. |
| Accepts |
| Create a session with automation settings. |
| Draft PR falls back to |
| Get session status/details. |
| — |
| List sessions with pagination. |
| — |
| Approve a pending plan. |
| — |
| Reject a plan with feedback. |
| Uses REST endpoint |
| Send a message to a session. |
| — |
| Cancel a running session. |
| Uses REST endpoint |
| List activities in a session. |
| — |
| Get most recent activity. |
| — |
| Get latest plan (if generated). |
| Plan rejection detection uses REST activity listing |
| Wait for completion or timeout. |
| — |
| Wait for plan generation. |
| — |
| Create and optionally wait for completion. |
| Draft PR falls back to |
| Create session with defaults and wait. |
| — |
| Combined session + activity summary. |
| — |
| Apply Jules diff to a local git repo. |
| Refuses dirty trees by default unless |
Hidden Tool (Not Listed in MCP)
Tool | Purpose | Key Params | Notes |
| Get bash command outputs from a session. |
| Not listed in MCP discovery |
Behavior Notes
AUTO_CREATE_DRAFT_PRis not supported by the SDK. When requested forjules_create_sessionorjules_create_and_wait, the server retries withAUTO_CREATE_PR.jules_reject_planandjules_cancel_sessionuse direct REST endpoints when the SDK does not expose public helpers.Plan rejection status depends on a
planRejectedactivity; if the API does not emit it, the status remainspending_approval.jules_sync_local_codebaseapplies patches viagit applyand refuses dirty working trees unlessallowDirty=trueorautoStash=true.
Configuration
The server reads configuration from:
JULES_API_KEYenv var or~/.jules/config.jsonOptional overrides:
JULES_API_BASE_URLJULES_API_TIMEOUTorJULES_REQUEST_TIMEOUT_MSJULES_POLL_INTERVALJULES_RATE_LIMIT_MAX_RETRY_MSJULES_RATE_LIMIT_BASE_DELAY_MSJULES_RATE_LIMIT_MAX_DELAY_MS
CLI
The CLI supports doctor and config commands (like the official SDK MCP):
# Check environment and API connectivity
jules-mcp-server doctor
# Save API key to ~/.jules/config.json
jules-mcp-server config --key YOUR_KEYCredits
Special thanks to David East for building the SDK and API on which this MCP is based.
Available Tools
26 toolscreate_sessionA
Creates a new Jules session or automated run to perform code tasks. If repo and branch are omitted, creates a "repoless" session where the user provides their own context in the prompt and Jules will perform code tasks based on that context instead of a GitHub repo.
Inputs: prompt (required), repo, branch, interactive, +1 more.
get_bash_outputsA
Get all bash command outputs from a Jules session. Returns commands executed, their stdout/stderr, and exit codes. Use to understand what shell commands were run.
Inputs: sessionId (required), activityIds.
get_code_review_contextA
Review code changes from a Jules session. Returns a structured summary of what changed, organized by file with change types, line counts, and activity IDs. Automatically detects if session is busy (aggregates from activities) or stable (uses final outcome). Can optionally scope to a single activity. For detailed diffs, use show_code_diff.
Inputs: sessionId (required), activityId, format, filter, +1 more.
get_session_stateA
Get the current status of a Jules session. Acts as a dashboard to determine if Jules is busy, waiting, or failed.
RETURNS: id, status, url, title, prompt, pr (if created), lastActivity, lastAgentMessage (if any), pendingPlan (if awaiting approval)
STATUS (use this to decide what action to take):
"busy": Jules is actively working. Peek with get_code_review_context if needed.
"stable": Work is paused. Safe to review code, send messages, or check outputs.
"failed": System-level failure (like a 500). Session cannot continue.
LAST ACTIVITY:
Shows what just happened (activityId, type, timestamp)
Common types: agentMessaged, sessionCompleted, progressUpdated, userMessaged, planGenerated
LAST AGENT MESSAGE:
Contains the last message Jules sent (activityId, content, timestamp)
Read this to understand what Jules communicated
If Jules asked a question, you can respond using send_reply_to_session
PENDING PLAN:
Present when a plan is awaiting approval (lastActivity.type is 'planGenerated')
Contains planId and steps (title, description for each step)
Use send_reply_to_session with action 'approve' to approve the plan
NEXT ACTIONS:
busy → Wait for completion, or peek with get_code_review_context
stable + pendingPlan → Review the plan steps, then approve or send feedback
stable + lastAgentMessage → Read message, respond if Jules asked something
stable + no message → Review PR or code changes with get_code_review_context
failed → Report to user. Session is unrecoverable.
IMPORTANT:
You can send messages to ANY session regardless of status.
A session is never truly "done" unless it's failed. You can always continue the conversation.
Inputs: sessionId (required).
jules_approve_planC
Approves the current plan for a session.
Inputs: sessionId (required).
jules_cancel_sessionC
Cancels an active Jules session.
Inputs: sessionId (required).
jules_create_and_waitA
Creates a Jules session AND waits for it to complete in a single operation.
Inputs: prompt (required), repo (required), branch, title, +4 more.
jules_create_sessionC
Creates a new Jules session to perform an asynchronous coding task.
Inputs: prompt (required), repo (required), branch, title, +2 more.
jules_get_latest_activityC
Gets the most recent activity from a Jules session.
Inputs: sessionId (required).
jules_get_sessionC
Gets the current status and details of a Jules session.
Inputs: sessionId (required).
jules_get_session_planC
Gets the execution plan from a Jules session.
Inputs: sessionId (required).
jules_get_session_summaryC
Gets a comprehensive summary of a Jules session including status, plan, activities, and outputs.
Inputs: sessionId (required).
jules_get_sourceC
Gets details about a specific GitHub repository connected to Jules.
Inputs: source (required).
jules_list_activitiesB
Lists all activities (events) in a Jules session.
Inputs: sessionId (required), pageSize, pageToken.
jules_list_sessionsC
Lists your Jules sessions with optional pagination.
Inputs: pageSize, pageToken.
jules_list_sourcesC
Lists all GitHub repositories connected to your Jules account.
Inputs: pageSize, pageToken.
jules_quick_taskB
Simplest way to assign a task to Jules with sensible defaults.
Inputs: prompt (required), repo (required), branch, createPr.
jules_reject_planC
Rejects the current plan for a session and optionally provides feedback.
Inputs: sessionId (required), feedback.
jules_send_messageC
Sends a message to an active Jules session.
Inputs: sessionId (required), message (required).
jules_sync_local_codebaseC
Applies the latest Jules diff to a local git working tree (syncs the codebase).
Inputs: sessionId (required), repoPath, activityId, file, +3 more.
jules_wait_for_completionC
Waits for a Jules session to complete (success, failure, or cancellation).
Inputs: sessionId (required), timeoutMs, pollIntervalMs.
jules_wait_for_planC
Waits for Jules to generate a plan for a session.
Inputs: sessionId (required), timeoutMs.
list_sessionsC
List recent Jules sessions with pagination support.
Inputs: pageSize, pageToken.
query_cacheA
Query the LOCAL CACHE of sessions and activities. Returns only previously synced data (fast, but may be stale). To ensure fresh data: call jules_sync first, then jules_select. Best for searching across multiple sessions or filtering by type/state.
Inputs: query (required).
send_reply_to_sessionC
Interacts with an active Jules session (approving plans or sending messages).
Inputs: sessionId (required), action (required), message.
show_code_diffA
Show the actual code diff for files from a Jules session. Returns unified diff format that can be displayed to users. Use after get_code_review_context to drill into specific file changes. Can optionally show diff from a specific activity (use activity IDs from get_code_review_context output).
Inputs: sessionId (required), file, activityId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
There is significant overlap among tools, causing potential confusion. For example, 'jules_create_session' and 'create_session' appear to serve the same purpose, and 'jules_get_session' and 'get_session_state' are similarly redundant. However, descriptions help clarify some distinctions, such as between 'get_code_review_context' and 'show_code_diff'.
Naming conventions are inconsistent, mixing patterns like 'jules_verb_noun' (e.g., 'jules_create_session'), 'verb_noun' (e.g., 'create_session'), and other styles (e.g., 'query_cache'). This lack of a uniform pattern makes the tool set harder to navigate and predict.
With 26 tools, the count is excessive for the server's purpose of managing Jules sessions. Many tools are redundant or overly specific, such as multiple variants for creating sessions or waiting for states, which could be consolidated into fewer, more versatile tools.
The tool set covers the core lifecycle of Jules sessions well, including creation, monitoring, interaction, and review. Minor gaps exist, such as no direct tool for deleting sessions or managing user accounts, but agents can likely work around these with the provided tools.
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Related MCP Servers
- -licenseAqualityNot gradedmaintenanceEnables automation of Google Jules AI coding assistant through task creation, code review automation, repository management, and AI-powered development workflows. Supports multiple session modes including cloud deployment with persistent authentication.13-
- AlicenseNot gradedqualityDmaintenanceConnects AI coding assistants to the Jules API for autonomous coding sessions. Enables creating and managing coding sessions, GitHub integration, plan approval workflows, and real-time activity tracking directly from your IDE.6MIT
- FlicenseAqualityDmaintenanceEnables LLM applications to interact with Google's Jules AI coding assistant to manage repositories, coding sessions, and pull requests. It allows users to programmatically create tasks, approve plans, and communicate with the assistant during active coding sessions.9-
- AlicenseAqualityDmaintenanceEnables interaction with Google Jules API to automate software development tasks, such as managing sources, sessions, and activities for AI-powered coding assistance.920 npm6MIT