mock_setup_host
Creates a mock directory and rules per host so local files serve as mocks, missing ones hit the real server. Writes rules to config (apply=true) while Charles is closed, or returns manual steps.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Bare hostname without scheme or port. | |
| apply | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| applied | No | ||
| host_dir | Yes | ||
| warnings | No | ||
| config_path | No | ||
| instructions | No | ||
| config_backup | No | ||
| rewrite_added | No | ||
| map_local_rule | Yes | ||
| map_local_added | No |