The Jules MCP Server enables AI assistants to delegate coding tasks to Google Jules and manage recurring automated workflows, with security and human oversight built in.
Create coding tasks (
create_coding_task): Submit natural language instructions (bug fixes, refactoring, tests, features) to a GitHub repository, with options to auto-create a Pull Request and/or require plan approval before any code changes are made.Check session status (
get_session_status): Retrieve the current state of a Jules session (e.g., PLANNING, IN_PROGRESS, COMPLETED) using its session ID.Manage active sessions (
manage_session): Approve a generated plan (approve_plan) or send feedback (send_message) to guide Jules's work, implementing human-in-the-loop control.Schedule recurring tasks (
schedule_recurring_task): Set up cron-based automated workflows (e.g., weekly dependency updates, security audits) with timezone support that persist through server restarts.List schedules (
list_schedules): View all locally managed recurring scheduled tasks and their execution history.Delete a schedule (
delete_schedule): Remove a previously created recurring task by name.Security & control: Restrict operations to a repository allowlist, store scheduled tasks with AES-256-GCM encryption, and use
require_plan_approvalto ensure no code changes happen without explicit human consent.Integrations: Connect to Claude, VS Code/Cursor, and other MCP-compatible tools for natural language task delegation.
Enables management of GitHub repositories through Google Jules, allowing automated code modifications, PR creation, and scheduling of maintenance tasks for connected GitHub repositories.
Provides integration with Google Jules API for autonomous coding tasks, enabling creation and management of coding sessions, plan approval workflows, and scheduling of recurring development tasks like dependency updates and security audits in connected GitHub repositories.
Click on "Install 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 Serverschedule weekly dependency updates for my-app-backend every Monday at 9 AM"
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
A production-ready Model Context Protocol (MCP) server for the Google Jules API, enabling autonomous coding tasks and scheduling directly from AI assistants like Claude.
β οΈ DISCLAIMER: This is an independent, open-source project and is NOT officially created, maintained, or endorsed by Google. This server is a community-driven integration with the public Jules API. Use at your own risk. For official Jules documentation, visit jules.google.
π Star This Repository
If you find this useful, please star β the repository to help others discover it!
Overview
This MCP server bridges the Google Jules coding agent with AI assistants, allowing you to:
Create coding tasks - Delegate bug fixes, refactoring, tests, and features to Jules
Schedule recurring tasks - Set up automated weekly/daily maintenance (dependency updates, security audits, etc.)
Monitor progress - Track session states and review generated plans
Approve plans - Human-in-the-loop control before code changes
Manage workflows - Send feedback and iterate on Jules's work
Architecture: The "Thick Server" Pattern
Since the Jules API v1alpha is stateless (no native scheduling endpoints), this server implements a local scheduling engine:
Persistent Storage: Schedules stored in
~/.jules-mcp/schedules.encCron Engine: Uses
node-schedulefor reliable task executionSurvives Restarts: Schedules are rehydrated on server startup
Autonomous Execution: Scheduled tasks run even without active IDE sessions
Installation
Prerequisites
Node.js 18.0.0 or higher
npm 9.0.0 or higher
Jules API Key - Generate at jules.google/settings
GitHub Repositories - Ensure your repositories are connected to Jules and the GitHub app is installed.
Developer Setup
# 1. Clone the repository
git clone https://github.com/savethepolarbears/jules-mcp-server.git
cd jules-mcp-server
# 2. Install dependencies
npm install
# 3. Configure environment
# Copy example env and fill in your JULES_API_KEY
cp .env.example .env
# 4. Build the project
npm run build
# 5. Run a smoke test to verify connectivity
npm run mcp:smokeQuick smoke test (MCP stdio)
After building and setting JULES_API_KEY, you can validate the server end-to-end:
npm run mcp:smokeExpected output (with a valid key):
Lists 11 tools, 5 prompts, and the 4 core resources
Attempts to read a fake session ID and reports a Jules 404 (proves real API calls work)
Attempts a tool call with dummy data and reports the API error without crashing
Global Installation (Recommended)
# Install globally
npm install -g
# Now available as: jules-mcp
jules-mcpConfiguration
Environment Variables
Create a .env file or set these in your shell:
# Required - Your Jules API Key
JULES_API_KEY=your_jules_api_key_here
# Strongly Recommended - Encryption key for local schedules
# Using JULES_API_KEY as fallback means rotating your API key will make all scheduled tasks unreadable.
# Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
JULES_ENCRYPTION_KEY=your_strong_random_key_here
# Required for create_coding_task. Comma-separated list of authorized repositories.
JULES_ALLOWED_REPOS=owner/repo1,owner/repo2
# Optional - Default branch for coding tasks
JULES_DEFAULT_BRANCH=mainSecurity & Privacy
This server is designed with a "security-first" approach to protect your repositories and data:
Restrictive File Permissions: Local schedule storage (
~/.jules-mcp) uses0o700directory permissions and0o600file permissions, ensuring only the owner can read or write task data.Encrypted Local State: All scheduled tasks are stored using AES-256-GCM encryption. A unique, random 16-byte salt is generated for every write operation to prevent offline attacks and ensure data integrity.
PII Leak Prevention: Raw Jules API responses are sanitized and truncated (max 500 characters) before being included in logs or exceptions, preventing accidental disclosure of proprietary code or personal information in system logs.
Generic Validation Errors: The server returns generic error messages when repository validation fails, preventing the enumeration of your private repository allowlist.
Human-in-the-Loop: Use the
require_plan_approval: trueflag to ensure Jules never modifies code without your explicit review and approval of the generated plan.
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"jules": {
"command": "node",
"args": ["/path/to/jules-mcp/dist/index.js"],
"env": {
"JULES_API_KEY": "your-key-here"
}
}
}
}On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
VS Code / Cursor Configuration
For Cursor or VS Code with MCP support:
{
"mcp.servers": {
"jules": {
"command": "jules-mcp",
"env": {
"JULES_API_KEY": "your-key-here"
}
}
}
}Usage
Once configured, your AI assistant can use Jules through natural language:
Creating Immediate Tasks
"Use Jules to add unit tests for the authentication module in my-app-backend repository"The assistant will:
Check
jules://sourcesto find the repositoryCall
create_coding_tasktool with appropriate promptReturn the session ID for monitoring
Scheduling Recurring Tasks
"Schedule Jules to update dependencies every Monday at 9 AM in my-app-backend"The assistant will:
Call
schedule_recurring_taskwith cron"0 9 * * 1"Save the schedule to
~/.jules-mcp/schedules.encConfirm the next execution time
Monitoring Progress
"Check the status of Jules session abc123"The assistant will:
Call
get_session_statusor readjules://sessions/abc123/fullShow current state (PLANNING, IN_PROGRESS, COMPLETED, etc.)
Provide next steps based on state
Reviewing and Approving Plans
"Show me Jules's plan for session abc123 and approve it"The assistant will:
Read
jules://sessions/abc123/fullto get the planDisplay the plan steps to you
Call
manage_sessionwithaction=approve_planafter your confirmation
Migration Guide
The server has migrated from plain JSON storage (schedules.json) to encrypted storage (schedules.enc).
Auto-Migration: Upon startup, if
schedules.jsonis detected, the server automatically encrypts its contents and saves them toschedules.enc, then deletes the unencrypted file.Backwards Compatibility: No manual action is required if you are upgrading from a version that used
schedules.json.
Documentation
Detailed documentation has been moved to the docs/ folder:
API Reference - Complete details on available MCP Tools, Resources, and Prompts.
Architecture - System design and the "Thick Server" pattern.
Configuration - Environment variables and setup instructions.
Examples - Example workflows and usage patterns.
Quickstart - A fast guide to getting up and running.
Security Considerations
API Key Security
Never commit your
JULES_API_KEYto version controlStore in environment variables or secure secrets manager
The API key grants write access to connected repositories
Repository Allowlist
Use JULES_ALLOWED_REPOS to restrict which repositories can be modified:
export JULES_ALLOWED_REPOS="myorg/safe-repo,myorg/test-repo"This prevents accidental modifications to production or sensitive repos.
Plan Approval Workflow
For critical repositories, always set require_plan_approval: true:
"Create a task but require plan approval before any code changes"This ensures human review before Jules modifies code.
Safe OpenClaw/Codex Integration
When integrating with autonomous AI agents like OpenClaw or Codex, additional safety measures are enforced:
Auto-PR Defaults: Prompt templates now encourage setting
auto_create_pr: trueto ensure all AI-driven changes are reviewed as Pull Requests before merging.Mandatory Review: It is strongly recommended to set
require_plan_approval: truefor tasks generated by other AI systems to establish trust before allowing direct changes.Quota-Aware Scheduling: To respect API limits and prevent unintended runaway tasks, the cron engine validates all schedules. Schedules must not run more frequently than once per hour. Daily or weekly intervals are highly recommended for automated maintenance.
Resilient Storage: Local schedules are saved using atomic file writes with corrupted-state backups to prevent the server from crashing during unexpected failures.
Audit Logging
All scheduled task executions are logged to jules://schedules/history. Review this regularly to audit autonomous activities.
Troubleshooting
"JULES_API_KEY environment variable is required"
Set your API key:
export JULES_API_KEY="your-key-here""Repository not found" error
Check
jules://sourcesresource to see connected reposEnsure the GitHub app is installed on the repository
Use the exact resource name format:
sources/github/owner/repo
Schedules not persisting
Check that ~/.jules-mcp/schedules.enc exists and is writable.
TypeScript compilation errors
npm run typecheckDevelopment
Documentation
This project uses JSDoc for comprehensive code documentation. Every public function, method, and class is documented with clear descriptions of purpose, parameters, and return values.
To explore the architecture and API details, check the docs/ directory.
Testing
We use Vitest for unit and integration testing.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageProject Structure
src/
types/ # TypeScript type definitions (Jules API & local state)
api/ # Jules API client layer with retry logic
storage/ # Secure persistence layer (encrypted JSON)
scheduler/ # Cron engine for recurring task management
mcp/ # MCP protocol layer (tools, resources, prompts)
utils/ # Security, rate limiting, and string utilities
index.ts # Server entry point and MCP handler setup
pieces/ # Activepieces integration (Google Jules piece)Build Commands
npm run build # Compile TypeScript
npm run dev # Development mode with tsx
npm run typecheck # Type checking onlyAPI Endpoints Covered
This server provides complete coverage of the Jules v1alpha API:
Endpoint | Method | MCP Mapping |
| GET | Resource: |
| GET | Included in full session resource |
| POST | Tool: |
| GET | Resource: |
| GET | Tool: |
| POST | Tool: |
| POST | Tool: |
| GET | Resource: |
Additional Capabilities (Beyond API)
Local scheduling - Cron-based task execution
Schedule persistence - Survives server restarts
Execution history - Audit trail for scheduled tasks
Future Roadmap
When Jules API adds native scheduling:
The
schedule_recurring_tasktool will migrate from local cron to API callsExisting local schedules can be migrated automatically
The MCP tool interface remains unchanged for backward compatibility
Resources
Jules API Documentation: https://developers.google.com/jules/api
Jules Web Interface: https://jules.google
Model Context Protocol: https://modelcontextprotocol.io
MCP TypeScript SDK: https://github.com/modelcontextprotocol/typescript-sdk
License
MIT
Contributing
This is an open-source implementation. Contributions welcome for:
Additional prompt templates
Enhanced error handling
Webhook support (when Jules API adds it)
Advanced scheduling features (conditional execution, dependency chains)
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.