charles-mcp
Provides tools for interacting with Charles Proxy: syncing and indexing sessions, browsing/filtering/searching transactions, inspecting headers and decoded bodies, exporting sessions, generating curl commands, and controlling recording, tools, and throttling.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
charles-mcp
An MCP server that gives AI agents access to Charles Proxy sessions: browse, filter, inspect, search, export and control Charles — all from your agent.
Why
Charles is excellent at capturing traffic, but reading a large session by hand is slow. This server turns the current Charles session into a queryable local index and exposes it as MCP tools, so an agent can answer questions like:
"Which API returned 500 during login?"
"What fields does
/v1/user/profilereturn?""Find the request that contains this order ID."
"Generate a curl command to replay this request."
"Switch to the 3G throttling preset and start recording."
It is zero-build, pure Node.js (>=20) ESM, with only two dependencies: @modelcontextprotocol/sdk and zod.
Related MCP server: proxypin-mcp
How it works
Charles exposes a Web Interface control plane. In Charles 5.x it can be reached in two ways:
Through the HTTP proxy (default): request
http://control.charles/via the Charles proxy port. No separate Web Interface listener is needed.Directly: enable Proxy → Web Interface Settings and point
CHARLES_WEB_URLat that listener.
The server uses the first mode by default.
Endpoints used:
/recording/{index,start,stop}
/tools/{slug}/{index,enable,disable}
/throttling/{index,activate?preset=,deactivate}
/session/{index,clear,export-json,export-har,export-xml,export-csv,export-trace,download}
/quit /disabledSession data is exported as JSON, streamed to a temporary file, and indexed locally. Large sessions are parsed from the tail window, so only the newest N transactions are read by default. Bodies are decoded lazily (gzip / deflate / brotli / zstd) and cached with a memory budget.
Requirements
Charles Proxy 5.x running on the same machine
Node.js >= 20
Charles Web Interface enabled:
Proxy → Web Interface Settings… → Enabled → OKThe traffic you want to inspect must go through Charles (device Wi-Fi proxy, emulator,
export https_proxy=http://127.0.0.1:8888, etc.)
Install
git clone https://github.com/Sn0w0day/charles-mcp.git
cd charles-mcp
npm installThe repository includes a .mcp.json for Claude Code project-scoped use. Other clients need the configuration below.
Configure
Claude Desktop
Edit the Claude Desktop config file:
OS | Path |
macOS |
|
Windows |
|
Linux |
|
Add the server (use an absolute path):
{
"mcpServers": {
"charles": {
"command": "node",
"args": ["/absolute/path/to/charles-mcp/server.mjs"],
"env": {
"CHARLES_PROXY_PORT": "8888"
}
}
}
}If Claude Desktop cannot find node (common for GUI apps on macOS), use the absolute Node path, for example /opt/homebrew/bin/node or /usr/local/bin/node. On Windows use C:\\Program Files\\nodejs\\node.exe.
Restart Claude Desktop after editing the file.
Claude Code
From the repository root:
claude mcp add --scope user --env CHARLES_PROXY_PORT=8888 charles -- node "$PWD/server.mjs"Or use the included .mcp.json when you open Claude Code in this repository.
Other MCP clients (Cursor, Cline, etc.)
Use the same JSON shape in the client's MCP configuration:
{
"mcpServers": {
"charles": {
"command": "node",
"args": ["/absolute/path/to/charles-mcp/server.mjs"],
"env": { "CHARLES_PROXY_PORT": "8888" }
}
}
}Tools
Tool | Description |
| Check the connection; report recording state, available tools, throttling presets and local index state. Start here when something looks wrong. |
| Export the current session and build/refresh the local index. Defaults to the newest 300 transactions; |
| Filter transactions by host glob, path, method, status class, URL substring, MIME, minimum body size, ascending/descending cursor pagination. |
| Inspect one transaction: headers, decoded body (gzip/deflate/brotli/zstd + charset repair), TLS/timing info. |
| Full-text search across decoded request/response bodies (substring or regex), with host/path/status/MIME filters and context snippets. |
| Status distribution, top hosts and slowest requests. |
| Export the session as |
| Generate a replayable curl command from a captured request (strips pseudo-headers and stale content headers, decodes the body). |
| Start/stop recording, clear the session, enable/disable a tool, switch throttling presets, quit Charles. Destructive actions require |
Typical workflow
charles_status— verify Charles is reachable and the Web Interface is enabled.charles_sync— build the local index. Query tools auto-sync on first use, so this is optional unless you want a specificwindow.charles_transactions— narrow down with host/path/status filters.charles_transaction— inspect headers and bodies of a specific#N.charles_search— find a value across all bodies.charles_curl— reproduce a request.charles_control— start/stop recording or switch throttling.
Transaction numbers (#N) are relative to the latest snapshot. Re-running charles_sync can renumber them.
Environment variables
Variable | Default | Description |
|
| Charles HTTP proxy address |
|
| Virtual host used through the proxy |
| — | Proxy authentication, if your Charles proxy requires it |
| — | Direct mode: use this Web Interface URL instead of the proxy, e.g. |
| — | Web Interface basic auth, if configured in Charles |
| — |
|
|
| How many newest transactions to parse per sync; |
|
| Auto-sync on first query when the index is empty; |
|
| Memory budget for decoded body cache (LRU) |
|
| Default directory for |
|
| Control page / export timeout |
|
| Hard cap for a single export download |
Troubleshooting
Symptom | Fix |
| Charles → Proxy → Web Interface Settings → enable → OK |
| Set |
| Charles is not running, or the proxy port is different. Set |
| Set |
Index is empty | Record some traffic and call |
Large session is slow | Lower |
| They are excluded by default; pass |
Claude Desktop cannot find | Use the absolute Node path in |
Direct mode with a self-signed certificate | Set |
Security and privacy
Captured traffic can contain credentials, cookies, tokens, personal data and proprietary payloads. The MCP server sends the decoded content to the AI model, so only point it at traffic you are authorized to inspect. The server uses stdio only and does not open a network port. charles_export writes files to the path you specify.
Development
npm install
npm test # unit tests, no Charles required
npm run test:smoke # direct Web Interface smoke test (Charles required)
npm run test:e2e # MCP protocol e2e, spawns the server and generates traffic (Charles + network required)The export schema is normalized in one place: normalize() in session-store.mjs. If a future Charles version changes the export format, compare it with charles_transaction { raw: true } and adjust that function.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Debug webhooks from your AI agent: inspect and replay captured webhooks on localhost.
Browse the agentic web with Darwin: search, communicate, authenticate, and act through agents.
Capture, inspect, send and assert on webhooks and inbound email from your coding agent.
Web data for agents. Extract web pages, crawl websites, discover URLs, and search the web.
Related MCP Servers
- AlicenseBqualityCmaintenanceIntegrates Charles Proxy with MCP clients to provide real-time and historical network traffic capture and structured analysis. It features a summary-first approach that filters noise and desensitizes data for efficient, low-token agent debugging and monitoring.18110 PyPI336MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to analyze real-time HTTP(S) traffic captured by ProxyPin, with tools to browse, search, and inspect requests and responses, as well as access saved history sessions.21 npm4MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Charles Proxy for HTTP traffic analysis, supporting incremental harvest, checkpoint timelines, and rich filtering tools.138MIT
- AlicenseBqualityBmaintenanceEnables AI agents to connect to Charles Proxy for live and historical traffic analysis, summary-first insights, request detail inspection, and data-driven mock creation via Map Local/Remote.47MIT