Skip to main content
Glama

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

  1. Install dependencies

  2. Provide JULES_API_KEY via environment or ~/.jules/config.json

  3. Build the server

npm install
npm run build

Run locally:

JULES_API_KEY=your_api_key node dist/cli.js

Related 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_session

Create a new Jules session or automated run (supports repoless sessions).

prompt (req)repobranchinteractiveautoPr

Session created. ID: <sessionId>

list_sessions

List recent sessions with pagination.

pageSizepageToken

{ sessions: [...], nextPageToken? }

get_session_state

Session dashboard (status, last activity/message, pending plan).

sessionId (req)

Status object with activity/message/plan context

send_reply_to_session

Approve plan, send a message, or ask and wait for a reply.

sessionId (req)action (approve/send/ask)message (send/ask)

Confirmation or agent reply

get_code_review_context

Summarize code changes with file list and metadata.

sessionId (req)activityIdformatfilterdetail

Formatted summary string

show_code_diff

Get the unified diff for a session or file.

sessionId (req)fileactivityId

Unified diff text

query_cache

Query the local cache using JQL.

query (req)

{ results: [...], _meta? }

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

jules_list_sources

List connected repositories.

pageSizepageToken

Returns { sources, hasMore, nextPageToken }

jules_get_source

Get details for a connected repository.

source (req)

Accepts sources/github/owner/repo or owner/repo

jules_create_session

Create a session with automation settings.

prompt (req)repo (req)branchtitleautomationModerequirePlanApproval

Draft PR falls back to AUTO_CREATE_PR if not supported

jules_get_session

Get session status/details.

sessionId (req)

—

jules_list_sessions

List sessions with pagination.

pageSizepageToken

—

jules_approve_plan

Approve a pending plan.

sessionId (req)

—

jules_reject_plan

Reject a plan with feedback.

sessionId (req)feedback

Uses REST endpoint

jules_send_message

Send a message to a session.

sessionId (req)message (req)

—

jules_cancel_session

Cancel a running session.

sessionId (req)

Uses REST endpoint

jules_list_activities

List activities in a session.

sessionId (req)pageSizepageToken

—

jules_get_latest_activity

Get most recent activity.

sessionId (req)

—

jules_get_session_plan

Get latest plan (if generated).

sessionId (req)

Plan rejection detection uses REST activity listing

jules_wait_for_completion

Wait for completion or timeout.

sessionId (req)timeoutMspollIntervalMs

—

jules_wait_for_plan

Wait for plan generation.

sessionId (req)timeoutMs

—

jules_create_and_wait

Create and optionally wait for completion.

prompt (req)repo (req)branchtitleautomationModewaitForCompletiontimeoutMsrequirePlanApproval

Draft PR falls back to AUTO_CREATE_PR if not supported

jules_quick_task

Create session with defaults and wait.

prompt (req)repo (req)branchcreatePr

—

jules_get_session_summary

Combined session + activity summary.

sessionId (req)

—

jules_sync_local_codebase

Apply Jules diff to a local git repo.

sessionId (req)repoPathactivityIdfiledryRunallowDirtyautoStashthreeWay

Refuses dirty trees by default unless allowDirty=true or autoStash=true

Hidden Tool (Not Listed in MCP)

Tool

Purpose

Key Params

Notes

get_bash_outputs

Get bash command outputs from a session.

sessionId (req)activityIds

Not listed in MCP discovery

Behavior Notes

  • AUTO_CREATE_DRAFT_PR is not supported by the SDK. When requested for jules_create_session or jules_create_and_wait, the server retries with AUTO_CREATE_PR.

  • jules_reject_plan and jules_cancel_session use direct REST endpoints when the SDK does not expose public helpers.

  • Plan rejection status depends on a planRejected activity; if the API does not emit it, the status remains pending_approval.

  • jules_sync_local_codebase applies patches via git apply and refuses dirty working trees unless allowDirty=true or autoStash=true.

Configuration

The server reads configuration from:

  • JULES_API_KEY env var or ~/.jules/config.json

  • Optional overrides:

    • JULES_API_BASE_URL

    • JULES_API_TIMEOUT or JULES_REQUEST_TIMEOUT_MS

    • JULES_POLL_INTERVAL

    • JULES_RATE_LIMIT_MAX_RETRY_MS

    • JULES_RATE_LIMIT_BASE_DELAY_MS

    • JULES_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_KEY

Credits

Special thanks to David East for building the SDK and API on which this MCP is based.

Available Tools

26 tools
create_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

    B3/5.0

    Scored across 26 tools

    Disambiguation3/5

    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 Consistency2/5

    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.

    Tool Count2/5

    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.

    Completeness4/5

    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

    Related MCP Servers

    • -
      license
      A
      quality
      Not graded
      maintenance
      Enables 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
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects 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.
      6
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables 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
      -