Skip to content

Charles mcp

Charles Proxy MCP server for AI agents with live capture, structured traffic analysis, and agent-friendly tool contracts

Install: git clone https://github.com/heizaheiza/Charles-mcp

Works with Codex · 323 GitHub stars

Install

$git clone https://github.com/heizaheiza/Charles-mcp

Install command taken from the project's README or registry entry. Always review code before running it.

Charles MCP Server

Docs | Tool Contract | AGENTS | Agent Workflow Guide | English README

仓库维护公告(2026-04-21)
本仓库的公开 Git 历史已于 2026-04-21 重新整理。如果你在该日期之前克隆过本仓库,请在继续贡献前重新克隆。不要从旧的本地克隆直接合并或推送,否则可能会把过期历史重新引入仓库。

Charles MCP Server 用于把 Charles Proxy 接入 MCP 客户端,让 agent 可以稳定地读取实时流量、分析历史录包,并在需要时再展开单条请求细节。

它解决的核心问题只有三个:

  • 录制还在进行时,agent 也能持续读取当前 session 的增量流量
  • live 与 history 统一走结构化分析,不再让 agent 直接消费原始抓包字典
  • 默认使用 summary-first 输出,先看热点与摘要,再 drill-down 到单条 detail

本次更新方向(v3.0)

v3.0 的更新方向是:charles-mcp 的能力开始从“流量查看/筛选”向“逆向工程工作流”延伸。

  • 在保留原有 live/history 分析能力的基础上,新增 reverse-analysis 工具链(导入、查询、解码、回放、签名候选分析、live 逆向会话)。
  • 目标是让 agent 不只看到流量,还能围绕认证、签名、参数变异与可重放性,形成更完整的逆向分析闭环。

快速开始

1. 开启 Charles Web Interface

在 Charles 中依次进入:Proxy -> Web Interface Settings

请确认:

  • 勾选 Enable web interface
  • 用户名为 admin
  • 密码为 123456

菜单位置示意:

设置窗口示意:

2. 安装并配置到 MCP 客户端

无需 clone 仓库,无需手动创建虚拟环境。需要先安装 uv。

Claude Code CLI

claude mcp add-json charles '{
  "type": "stdio",
  "command": "uvx",
  "args": ["charles-mcp"],
  "env": {
    "CHARLES_USER": "admin",
    "CHARLES_PASS": "123456",
    "CHARLES_MANAGE_LIFECYCLE": "false"
  }
}'

Claude Desktop / Cursor / 通用 JSON 配置

{
  "mcpServers": {
    "charles": {
      "command": "uvx",
      "args": ["charles-mcp"],
      "env": {
        "CHARLES_USER": "admin",
        "CHARLES_PASS": "123456",
        "CHARLES_MANAGE_LIFECYCLE": "false"
      }
    }
  }
}

Codex CLI

[mcp_servers.charles]
command = "uvx"
args = ["charles-mcp"]

[mcp_servers.charles.env]
CHARLES_USER = "admin"
CHARLES_PASS = "123456"
CHARLES_MANAGE_LIFECYCLE = "false"

让 AI 自动安装

将以下提示词复制粘贴给任意 AI agent(Claude Code、ChatGPT、Gemini CLI、Cursor Agent 等),agent 会自动完成安装和配置:

🔴 点击展开自动安装提示词(推荐)

Install the "charles-mcp" MCP server and configure it for my MCP client. Follow these steps exactly:

Step 1 — Detect OS:
  Determine if this machine runs Windows, macOS, or Linux.

Step 2 — Ensure uv is installed:
  Run: uv --version
  If the command fails (uv not found):
    - macOS/Linux: run: curl -LsSf https://astral.sh/uv/install.sh | sh
    - Windows: run: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  After installing, verify uv works: uv --version

Step 3 — Detect which MCP client is installed:
  Check in this order and use the FIRST match:

  a) Claude Code — run: claude --version
     If it succeeds, run this command and skip to Step 5:
       claude mcp add-json charles '{"type":"stdio","command":"uvx","args":["charles-mcp"],"env":{"CHARLES_USER":"admin","CHARLES_PASS":"123456","CHARLES_MANAGE_LIFECYCLE":"false"}}'

  b) Claude Desktop — check if config file exists:
     - macOS:   ~/Library/Application Support/Claude/claude_desktop_config.json
     - Windows: %APPDATA%\Claude\claude_desktop_config.json
     - Linux:   ~/.config/Claude/claude_desktop_config.json

  c) Cursor — check if any of these exist:
     - ~/.cursor/mcp.json
     - .cursor/mcp.json (in current project)

  d) Windsurf — check if exists:
     - ~/.codeium/windsurf/mcp_config.json

  If none detected, ask the user which client they use.

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related