chatgpt-jules-mcp

chatgpt-jules-mcp

Secure MCP server allowing ChatGPT to manage Google Jules sessions through OpenAI Secure MCP Tunnel.

Category
访问服务器

README

chatgpt-jules-mcp

Secure MCP server allowing ChatGPT to manage Google Jules sessions through OpenAI Secure MCP Tunnel.

Architecture

ChatGPT
  -> OpenAI Secure MCP Tunnel
    -> tunnel-client (your MacBook)
      -> chatgpt-jules-mcp (stdio)
        -> jules-agent-sdk
          -> Google Jules
            -> GitHub repository

No public HTTP. No Tailscale Funnel. No raw arbitrary HTTP.

Security Features

  • Policy-based access control (policy.yaml) — allowlist sources, titles, tools
  • Confirmation gate for jules.approve_plan
  • Audit logging (JSONL) — every tool call recorded with metadata
  • Secret redaction — JULES_API_KEY, tokens, private keys scrubbed from all output
  • Rate limiting — per-tool, configurable via policy
  • Error boundary — all exceptions caught, sanitized, never leak secrets
  • No generic HTTP tools — only Jules-specific operations

Quick Start

# Install from PyPI
pip install chatgpt-jules-mcp

# Or install in development mode
pip install -e ".[dev]"

# Set credentials
export JULES_API_KEY="your-jules-api-key"

# Configure policy
mkdir -p ~/.config/chatgpt-jules-mcp
cp config/policy.example.yaml ~/.config/chatgpt-jules-mcp/policy.yaml
# Edit: add your sources to allowed_sources

# Run MCP server (module)
python -m chatgpt_jules_mcp

# Or with CLI script (installed via pip)
chatgpt-jules-mcp

# Or with custom config
python -m chatgpt_jules_mcp --config /path/to/policy.yaml
chatgpt-jules-mcp --config /path/to/policy.yaml

MCP Tools (14)

Tool Category Description
jules.health Diagnostics Server status, API key check, policy load
jules.list_sources Sources List allowed GitHub sources
jules.get_source Sources Get single source details
jules.find_source Sources Fuzzy search sources (client-side)
jules.create_session Sessions Create Jules session with policy checks
jules.get_session Sessions Get session status
jules.list_sessions Sessions List sessions (filtered by policy)
jules.approve_plan Sessions Approve plan (requires confirmation)
jules.send_message Sessions Send follow-up message
jules.wait_for_completion Sessions Poll until session completes
jules.list_activities Activities List session activities
jules.get_activity Activities Get single activity
jules.summarize_session Convenience Best-effort session summary
jules.extract_result Convenience Extract final result from activities

Project Structure

chatgpt-jules-mcp/
├── src/chatgpt_jules_mcp/
│   ├── server.py            # FastMCP server, tool registration
│   ├── policy.py            # Policy engine (YAML load, validate, enforce)
│   ├── audit.py             # JSONL audit logger
│   ├── redaction.py         # Secret pattern redaction
│   ├── errors.py            # Custom exceptions, error boundary
│   ├── ratelimit.py         # In-memory rate limiter
│   ├── shutdown.py          # Graceful shutdown (SIGTERM/SIGINT)
│   ├── tools/
│   │   ├── health.py        # jules.health
│   │   ├── sources.py       # list_sources, get_source, find_source
│   │   ├── sessions.py      # create_session, get_session, list_sessions, approve_plan, send_message, wait_for_completion
│   │   ├── activities.py    # list_activities, get_activity
│   │   └── convenience.py   # summarize_session, extract_result
├── tests/                   # 103 tests across 10 test files
├── config/
│   └── policy.example.yaml  # Example policy configuration
├── scripts/
│   └── emergency-stop.sh    # Kill switch
└── docs/
    └── openai-secure-mcp-tunnel.md  # Tunnel setup guide

Configuration

Policy is controlled via ~/.config/chatgpt-jules-mcp/policy.yaml:

jules:
  allowed_sources:
    - "sources/your-repo"
  default_require_plan_approval: true
sessions:
  allowed_title_prefixes:
    - "ChatGPT:"
  max_prompt_chars: 12000
  max_message_chars: 8000
tools:
  allow:
    - "jules.health"
    - "jules.list_sources"
    # ... see policy.example.yaml for full list
  require_confirmation:
    - "jules.approve_plan"
audit:
  path: "~/.local/share/chatgpt-jules-mcp/audit.jsonl"
  redact_secrets: true

Tests

pip install pytest pytest-asyncio
PYTHONPATH=src python -m pytest tests/ -v

50 tests covering: policy engine, audit logging, redaction, rate limiting, all 14 tools, error handling, input validation, secret redaction in transit.

OpenAI Secure MCP Tunnel

See docs/openai-secure-mcp-tunnel.md for full setup.

Quick version:

export CONTROL_PLANE_API_KEY="sk-..."
export CONTROL_PLANE_TUNNEL_ID="tunnel_..."
export JULES_API_KEY="..."

tunnel-client init \
  --sample sample_mcp_stdio_local \
  --profile chatgpt-jules-mcp-local \
  --tunnel-id "$CONTROL_PLANE_TUNNEL_ID" \
  --mcp-command "python -m chatgpt_jules_mcp"

tunnel-client doctor --profile chatgpt-jules-mcp-local --explain
tunnel-client run --profile chatgpt-jules-mcp-local

Emergency Stop

./scripts/emergency-stop.sh

Production Deployment

Security Checklist

  • [ ] Set allowed_sources to specific repositories (never null in production)
  • [ ] Set allowed_title_prefixes to restrict session titles
  • [ ] Disable log_full_prompts (keep false)
  • [ ] Set redact_secrets: true
  • [ ] Restrict audit log file permissions (chmod 600 audit.jsonl)
  • [ ] Run behind OpenAI Secure MCP Tunnel (no public HTTP)
  • [ ] Set rate limits appropriate for your usage (calls_per_minute)
  • [ ] Review and customize redaction.patterns for your environment

systemd Service (Linux)

Create /etc/systemd/system/chatgpt-jules-mcp.service:

[Unit]
Description=ChatGPT Jules MCP Server
After=network.target

[Service]
Type=simple
User=chatgpt-jules
Group=chatgpt-jules
Environment="JULES_API_KEY=your-key-here"
Environment="PYTHONUNBUFFERED=1"
WorkingDirectory=/opt/chatgpt-jules-mcp
ExecStart=/opt/chatgpt-jules-mcp/.venv/bin/python -m chatgpt_jules_mcp
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable chatgpt-jules-mcp
sudo systemctl start chatgpt-jules-mcp
sudo systemctl status chatgpt-jules-mcp

Docker

FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -e ".[dev]"
ENV PYTHONUNBUFFERED=1
USER 1000
CMD ["python", "-m", "chatgpt_jules_mcp"]
docker build -t chatgpt-jules-mcp .
docker run -e JULES_API_KEY=... chatgpt-jules-mcp

License

Apache-2.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选