Charles MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CHARLES_PASS | No | Password for Charles Web Interface | 123456 |
| CHARLES_USER | No | Username for Charles Web Interface | admin |
| CHARLES_MOCK_DIR | No | Root directory for Map Local mocks; Charles maps https://<host>/* into <CHARLES_MOCK_DIR>/<host>/ | ~/charles-mocks |
| CHARLES_STATE_DIR | No | Base directory for Charles MCP state (used as parent for reverse state) | |
| CHARLES_PROXY_HOST | No | Host of the Charles proxy | 127.0.0.1 |
| CHARLES_PROXY_PORT | No | Port of the Charles proxy | 8888 |
| CHARLES_CONFIG_PATH | No | Path to the Charles configuration file | |
| CHARLES_DISPATCHER_PORT | No | Port of the local dispatcher used by Map Remote rules | 18080 |
| CHARLES_REQUEST_TIMEOUT | No | Timeout in seconds for HTTP requests to Charles | 10 |
| CHARLES_MANAGE_LIFECYCLE | No | Whether the MCP server should start and stop Charles | false |
| CHARLES_REVERSE_STATE_DIR | No | Directory for reverse analysis state: artifacts and SQLite database | ${CHARLES_STATE_DIR}/reverse |
| CHARLES_DISPATCHER_TIMEOUT | No | Timeout in seconds for requests forwarded by the dispatcher | 20 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| start_live_captureA | Start or adopt a live capture session for incremental polling. PREFER THIS TOOL when the user wants to inspect ongoing / just-now traffic. This is the default entry point for live-plane analysis; do NOT default to list_recordings or query_recorded_traffic unless the user explicitly names a saved recording (.chlsj). DEFAULT BEHAVIOR (safe): adopts the user's ongoing Charles session WITHOUT clearing the traffic that is already there, and ensures Charles is recording (start_recording is idempotent). The capture always includes the traffic recorded before this call, so query and read tools see the whole session: the first read_live_capture returns the existing entries, later reads return only new ones. Pass reset_session=true ONLY when the user explicitly asks to clear / wipe the current Charles session before starting a fresh capture (e.g. debugging a single isolated flow). Reset is destructive and cannot be undone by this server. Returns a capture_id required by all other live tools. Preserve and reuse capture_id across follow-up live calls. |
| read_live_captureA | Read incremental traffic and advance the cursor. Returns compact entry summaries (host/method/path/status only). This read call consumes the current increment. Use query_live_capture_entries for structured filtering instead of this tool. This tool advances the internal cursor — repeated calls only return new items. |
| peek_live_captureA | Preview incremental traffic without advancing the cursor. Returns compact entry summaries (host/method/path/status only). This peek call does not consume the current increment. Safe to call repeatedly — does not consume items. Use query_live_capture_entries for structured filtering and analysis. |
| stop_live_captureA | Stop an active live capture and optionally persist the filtered snapshot. Only status='stopped' means the capture is fully closed. |
| query_live_capture_entriesA | Analyze the active live capture with structured summary-first filtering. This is the RECOMMENDED tool for inspecting live / ongoing traffic. Prefer this over query_recorded_traffic / analyze_recorded_traffic unless the user explicitly names a saved recording (.chlsj). Use this summary path before calling get_traffic_entry_detail. Does NOT advance the cursor — safe to call repeatedly with different filters. Default cursor=0 scans all captured data from the beginning. Use get_traffic_entry_detail to drill down into a specific entry_id. Pass |
| analyze_recorded_trafficA | Analyze a saved recording snapshot with compact summaries. HISTORY-PLANE TOOL — only use when the user explicitly references a saved recording (.chlsj file). For ongoing / live traffic, prefer start_live_capture + query_live_capture_entries instead. Preserve recording_path for follow-up detail calls. Returns structured TrafficSummary items with matched_fields and match_reasons. Use get_traffic_entry_detail to drill down into a specific entry_id afterwards. |
| get_traffic_entry_detailA | Load one traffic entry detail view for drill-down inspection. Requires entry_id from a prior summary/query call. Use detail for one confirmed target, not bulk browsing. For history entries, pass recording_path from the summary. For live entries, pass capture_id from the summary. Keep include_full_body=false unless you specifically need the raw body text. |
| get_capture_analysis_statsC | Return coarse traffic class counts for a live capture or saved recording. |
| group_capture_analysisC | Group analyzed traffic so the agent can inspect hot spots with lower token cost. |
| query_recorded_trafficA | Query the latest saved recording. This tool never reads the live Charles session. HISTORY-PLANE TOOL — only use when the user explicitly references a saved recording (.chlsj file). For ongoing / live traffic, prefer start_live_capture + query_live_capture_entries instead. |
| list_recordingsA | List saved recording files using an explicit history-oriented tool name. HISTORY-PLANE TOOL — only use when the user explicitly references saved recordings (.chlsj files). For ongoing / live traffic, prefer start_live_capture instead. Start history analysis here, then preserve recording_path for summary/detail calls. |
| get_recording_snapshotA | Load a saved recording snapshot. This tool never reads the live Charles session. HISTORY-PLANE TOOL — only use when the user explicitly references a saved recording (.chlsj file). |
| throttlingB | Set a network throttling preset in Charles. |
| reset_environmentB | Reset the Charles environment and restore the saved configuration. |
| charles_statusA | Check Charles connectivity and active live-capture state. Returns recommended_next_action to nudge agents toward the live plane: when no active capture exists, agents should start_live_capture before falling back to history-plane tools. |
| reverse_import_sessionC | Import an official Charles XML/native session into the canonical reverse-analysis store. |
| reverse_list_capturesB | List imported captures from the local SQLite store. |
| reverse_query_entriesB | Query imported entries using route-level filters. Use this as the summary-first narrowing step for a reverse capture_id. |
| reverse_get_entry_detailA | Get the canonical detail view for one imported entry. Use after candidate selection; this is not a bulk-browsing endpoint. |
| reverse_decode_entry_bodyC | Decode a stored request/response body, including protobuf when a descriptor is provided. |
| reverse_replay_entryC | Replay one imported entry with optional mutations and store the experiment result. |
| reverse_discover_signature_candidatesC | Compare multiple requests and rank fields that look signature-related. |
| reverse_list_findingsC | List persisted findings from replay or signature-candidate analysis. |
| reverse_charles_recording_statusC | Inspect Charles recording state and optional reverse live-session state. |
| reverse_start_live_analysisB | Start a near-real-time live analysis session without using undocumented JSON export. Preserve and reuse live_session_id for follow-up reverse live tools. |
| reverse_peek_live_entriesC | Snapshot the current Charles session and inspect only new entries without advancing the live cursor. |
| reverse_read_live_entriesC | Snapshot the current Charles session and advance the live cursor to consume new entries. |
| reverse_stop_live_analysisB | Stop a reverse live-analysis session and optionally restore Charles recording. |
| reverse_analyze_live_login_flowB | Run a task-oriented live login/auth reverse-analysis workflow on new traffic. Read summary/report first and expand evidence only as needed. |
| reverse_analyze_live_api_flowC | Run a task-oriented live API reverse-analysis workflow on new traffic. Read summary/report first and expand evidence only as needed. |
| reverse_analyze_live_signature_flowC | Run a task-oriented live signature reverse-analysis workflow on new traffic. Read summary/report first and expand evidence only as needed. |
| mock_setup_hostA | One-time setup per host: create the mock directory and the Charles rules (Map Local https:///* -> directory, Rewrite text/plain -> JSON type). After that, mocks are plain files: present = served by Charles, absent = real server. apply=false returns manual steps (UI, no restart); apply=true writes the rules into the Charles config and only works while Charles is closed (Charles overwrites its config on quit). This tool never quits or starts Charles: ask the user to save the session, quit Charles, and start it after the write. A config backup is made first. |
| mock_create_from_entryA | Turn a captured response into a Map Local mock, optionally editing it.
Take entry_id from query_live_capture_entries (pass capture_id) or a history
summary (pass recording_path). The mock is written for the entry's host and
path; a previous mock at that path is archived, never deleted.
Read |
| mock_writeA | Write a mock response from scratch. Pass |
| mock_listA | List active mock files, optionally for one host. Archived versions are not listed. |
| mock_getC | Show the content of one active mock. |
| mock_removeA | Stop mocking one path: the file moves to the archive and requests pass through to the real server again. |
| mock_set_enabledA | Turn the whole Charles Map Local tool on or off. Off means every request goes to real servers; mock files stay on disk. |
| mock_route_setupA | Send a host (or domain glob) through the dispatcher; once per host/domain. One Charles Map Remote mapping (https:// -> local dispatcher, empty destination path, preserve host header) covers every path and action under it; after that, mocks are only data. Unmocked requests pass through unchanged. apply=true writes the mapping into the Charles config; only while Charles is closed, because Charles overwrites its config from memory on quit. This tool never quits or starts Charles: ask the user to save the session and quit Charles, not to reopen it until the write is done, then to start it. apply=false returns manual steps that work in the UI without a restart. |
| mock_discover_variantsA | Overview of the whole captured session: API requests grouped by method, host, path and the value of a request-body field (default /action; "null" for GETs and bodies without it), with counts, sample entry_ids and response statuses. Use it right after reading a session so the user can name what to change. Filter with host_contains / path_contains / methods. live needs capture_id. |
| mock_rule_create_from_entryA | Create or extend the rule for one request variant (method + path + body/query
values) from a captured entry.
match_body_fields picks the variant, e.g. ["/action"] for POSTs; leave it empty
for GETs. host_scope="any" (default) applies the rule on every routed host, since
the same API runs on several hosts; "exact" limits it to the entry's host, and
|
| mock_rule_writeA | Write a rule document directly (advanced; prefer mock_rule_create_from_entry). Shape: {"id", "host", "match": {"method", "path", "query", "headers", "body": {"/action": "init"}}, "request": {"patches"}, "response": {"mode": "fixture"|"patch", "status", "headers", "patches"}, "priority", "enabled"}. Fixture rules need fixture_json or fixture_text unless a fixture exists. |
| mock_rule_listA | List dispatcher routes and rules, optionally for one host. Invalid rule
files are reported in |
| mock_rule_getB | Show one rule document and, for fixture rules, the stored fixture. |
| mock_rule_set_enabledB | Enable or disable one rule without deleting it. |
| mock_rule_removeA | Archive one rule (and its fixture); matching requests pass through again. |
| mock_dispatcherA | Start, stop or check the local dispatcher that Map Remote routes point to.
A dispatcher started here lives inside the MCP server and stops with it; for a
long-running one use the |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| agent-guide | How to use charles-mcp: rules, every tool, workflows, Charles restarts. |
TDQS
Scored across 47 tools
Many tools have intentionally duplicated surfaces across live/history/reverse planes (read_live_capture vs reverse_read_live_entries, query_recorded_traffic vs analyze_recorded_traffic vs reverse_query_entries, mock_* vs mock_rule_*), and descriptions carry most of the burden. Prefixes like mock_ and reverse_ help, but an agent could easily select the wrong capture/read/query variant without reading deeply.
Most tools follow a consistent [domain]_[verb]_[object] pattern (start_live_capture, mock_get, reverse_replay_entry), and the mock_/reverse_ prefixes make families recognizable. Minor deviations like throttling, reset_environment, charles_status, and mock_dispatcher break the verb-first pattern but do not obscure meaning.
47 tools is well into the 'too many' range and reflects substantial duplication: several near-parallel subsystems (live/history/reverse/mock-rule) each re-implement list/read/query/stop-style operations. The broad Charles domain justifies many tools, but consolidation would meaningfully improve the surface.
The surface is broad and covers the main lifecycle: live capture, saved recordings, filtering/detail drill-down, mocking, replay, reverse analysis, and environment control. Minor gaps such as no way to start/quit Charles or delete recordings/imports can be worked around, but they are not fatal dead ends.