Routing, limits and optimizer reference¶
The subsections the README used to carry inline: key rotation, fallback chains, output budgets, limits and resilience, and the token optimizer. Moved out of the README in 6.57.0; nothing here changed. Task-oriented versions of the same material are in the Usage Guide.
Multi-Key Rotation¶
Put multiple API keys in one variable, comma-separated, and choose a policy with {ENV}_ROTATION:
Policies:
| Policy | Behavior |
|---|---|
single |
Always the first key (default when one key is set). |
round_robin |
Spread requests across healthy keys in turn. |
least_used |
Healthy key with the fewest requests goes first. |
failover (alias on_error) |
Stick to the first healthy key until it fails, then move to the next (default when multiple keys are set). |
Each key gets its own upstream client and its own rate-limit window, so one key saturating or stalling never throttles the others.
The order in the pool is the order these policies read. failover serves the first healthy key, single serves the first key and nothing else, and round_robin cycles in that sequence. Since 7.29.0 that order is editable without retyping the variable: open Configure on the provider's card and drag a key by its grip, or use Move up / Move down (or ArrowUp / ArrowDown on a focused grip). It applies at once with no restart. It does rebuild the pool, so that pool's health counters and benches start again -- exactly as they do when you add or remove a key.
A key can also carry a name. Type one beside the key, or in the optional Name field when you add it, and that key then reads as its name wherever a credential is shown: the card, the request log row and modal, the Analytics Key filter (which still matches the key's rows by its mask, so a renamed key keeps its history; two keys given one name read name (mask) there), the retry ladder, the per-key analytics and the CSV. Its masked label stays on hover, and the exports keep their key_label column and gain a key_name one beside it. Names live in ~/.mcc/credential_names.json, keyed by sha256(key)[:16] and never by the key itself; they never reach an upstream request, the request log or a rollup. A name is a display join resolved from the pool as it stands now, so renaming a key rewrites no history -- and a masked label two keys share resolves to no name at all rather than to a guess.
Health model — a key is only ever judged on signals about the key. There are exactly three:
- 401/403 — the provider rejected the credential. It is locked out on an escalating ladder (
CREDENTIAL_LOCKOUT_TIERS, 5 min → 1 h → 24 h by default), on its own counter. - 429 — the credential is throttled for that model. The (key, model) pair is benched for exactly as long as the provider asked via
Retry-After/x-ratelimit-reset-*, or forRATE_LIMIT_COOLDOWN_SECONDSwhen it sent no header, capped atRATE_LIMIT_COOLDOWN_MAX_SECONDS(default 3600, the number hard-coded before 7.22.0;0removes the ceiling).RATE_LIMIT_COOLDOWN_MODEdecides whether that happens at all:provider(default) is the behaviour described here,fixedignores the header and always usesRATE_LIMIT_COOLDOWN_SECONDS,offbenches nothing and keeps rotating. The key staysHEALTHYand every other model on it keeps serving, because a gateway that limits one model has said nothing about the key's others — measured on NVIDIA NIM, one model 429s on all three keys inside 0.1 s while two other models answer on those same keys in the same second. The key itself is benched only onceCREDENTIAL_MODEL_BENCH_ESCALATION(default 2) distinct models hold a live bench on it at the same time. No ladder, no escalation beyond that one step. - Exhausted credits (since 6.34.0) — the provider said in words that the account behind the key has no balance left: HTTP 402, or a 400/403 whose structured error body names an explicit billing phrase (
insufficient credits,purchase more credits,insufficient balance,NOT_ENOUGH_BALANCE,quota exceeded,insufficient_quota,payment required,out of credits,credit balance is too low,CreditsError). The whole key is benched forRATE_LIMIT_COOLDOWN_SECONDS— a wallet is not per-model — and the request rotates to the next key, then to the next model. A bare 402 with no recognisable phrase rotates and falls through but charges nothing: the matcher reads only the provider's own words, through the same echo-safe reader the recovery ladder uses, so a prompt that happens to contain "insufficient credits" can never bench a key.
Everything else — timeouts, 5xx, 410, and every other 4xx — leaves a key's health untouched.
| Setting | Default | What it does |
|---|---|---|
CREDENTIAL_LOCKOUT_TIERS |
300,3600,86400 |
The escalating bench for a key the provider keeps rejecting with 401/403, in comma-separated seconds. One step per consecutive rejection, staying at the last entry. This is the only ladder left — a 429 waits exactly as long as the provider asked, and nothing else changes a key's health. |
RATE_LIMIT_COOLDOWN_SECONDS |
60 |
Used only when a 429 carries no Retry-After, retry-after-ms or x-ratelimit-reset-* header at all. A header always wins in provider mode, and whatever the header asks for is capped at RATE_LIMIT_COOLDOWN_MAX_SECONDS. 0 does not pause. |
RATE_LIMIT_COOLDOWN_MAX_SECONDS |
3600 |
The longest wait a provider may ask for in a header and have MCC obey. Hard-coded at 3600 until 7.22.0. 0 removes the ceiling. It does not bound a wait published in the response body -- that is a statement about the account's daily allowance, is bounded at one day, and is ignored only by RATE_LIMIT_COOLDOWN_MODE. |
RATE_LIMIT_COOLDOWN_MODE |
provider |
What a 429 costs the key. provider obeys the published wait under the ceiling and falls back to the cooldown above; fixed always uses the cooldown above; off benches nothing at all -- no key bench, no (key, model) bench, no provider-wide pause -- while still rotating to the next key and still walking the fallback chain. |
CREDENTIAL_MODEL_BENCH_ESCALATION |
2 |
How many different models have to be rate-limited on one key at the same time before the key itself is benched instead of just the (key, model) pair. 1 benches the whole key on every 429 (the pre-6.19.0 behaviour, and the no-redeploy rollback); 0 never escalates past the pair. |
All four live on Admin UI → Limits & Resilience → Credential health. Rotation policy is not there: it is per pool, on each provider's card.
Everything else leaves every key untouched — timeouts, 5xx, 410 model gone, overloaded, 400s, context overflows, transport faults. Those are properties of the model, the request or the moment, and the same keys serve every model in a fallback chain, so charging them benched working credentials for faults they did not cause. A model that will not answer is the model's problem: the fallback chain moves to the next model, not the next key.
Rotation follows the same rule. The pool tries another key for an auth rejection, a 429, or a connection fault — cases where a different key or a different connection can genuinely help. Anything else is raised so routing can spend the time on a different model instead of on the rest of the pool.
Availability, not just health. A key can be perfectly healthy and still unable to serve right now: rate-limited, or out of daily budget. Rotation skips those keys and picks one that can answer immediately, instead of queueing behind a throttled key while an idle key sits unused. If every key is unavailable the request still goes out rather than failing — a soft guardrail should never become a self-inflicted outage.
Provider-declared backoff. On a 429, MCC reads the upstream's own Retry-After, retry-after-ms, and X-RateLimit-Reset-* headers (all the formats providers actually ship, including 6m0s and 250ms) and waits exactly that long, capped at an hour. Only when a provider says nothing does it fall back to a fixed minute.
No invented ceilings. MCC never caps a key at a number it made up. Every limit it applies comes from the provider's own response — the reset window on a 429, the status on a rejection. Providers change their limits without notice, so a hardcoded budget is wrong the moment it ships; reading what the upstream actually reports stays right.
When rotation happens. Exactly three cases, because they are the only ones a different key could fix: a 401/403, a 429, and a transport fault (a different key means a different connection). A timeout, a 5xx, an overload, a 410, a plain 400 — every key in the pool talks to the same model and would meet the same answer, so those raise out of the rotating loop and the fallback chain gets its turn instead. One consequence is worth stating: a timeout is not a transport fault here. openai.APITimeoutError subclasses APIConnectionError, and reading a model that never answered as a broken socket would spend the whole pool on it, so it is excluded by name.
Failover happens before the first streamed chunk; once output has started, switching credentials would corrupt the response, so a mid-stream failure is recorded against the key but propagated to the client.
The deliberate cost of that rule. A key that fails with a 5xx or a dropped connection on every request is no longer benched — rotation tries it once per request and the chain absorbs the wasted attempt. That was the trade: on a live three-key pool, the failure classes that could have identified a dead key were the same ones benching healthy keys 1,529 times in one day (a 410 model gone, a rejected top_p, a model that stayed silent). A truly dead credential still answers 401/403, and that still locks it out.
All of this is visible and manageable from Admin UI → Providers: press Configure on a provider's card to open its key pool, which lists every key with its own health and usage, lets you add keys (one, or several comma-separated), reorder them, give each one a name, and remove them individually, and carries the rotation policy. Refresh models on the card face makes a real call to the provider. For historical per-key request volume, error rate, tokens, and latency, see Per-Key Attribution.
Web search provider keys share the same rotation engine — see Web Search → Multi-key rotation.
Fallback Chains¶
Every tier can carry an ordered list of stand-ins. If the model a request routes to cannot serve it, MCC tries the next entry in that tier's chain, then the next, until one answers.
Model Config: one rail per tier. The struck-through rows with an amber Paused badge keep their place in the chain and are never tried.
What the chains actually did is on Analytics. The Failover panel counts the pairs that fired: which primary was replaced, by which stand-in, how often.
Failover, on Analytics: every primary → stand-in pair that actually fired, with its count, beside the upstream statuses that caused them.
| Setting | Chain used |
|---|---|
MODEL_FALLBACKS |
after MODEL, for any tier with no override of its own |
MODEL_MYTHOS_FALLBACKS |
after MODEL_MYTHOS |
MODEL_FABLE_FALLBACKS |
after MODEL_FABLE |
MODEL_OPUS_FALLBACKS |
after MODEL_OPUS |
MODEL_SONNET_FALLBACKS |
after MODEL_SONNET |
MODEL_HAIKU_FALLBACKS |
after MODEL_HAIKU |
A single request shows the same thing from the other end: the ladder it walked, with a reason beside every model it did not try.
One request's ladder: the first model sat out a rate-limit cooldown, the second answered, and the rest were never reached. The block below shows the request's shape with no prompt text in it.
Pausing one entry. Each row on a route rail has a Pause button. A paused model keeps its place in the chain and stays fully on screen, but the router never tries it: no attempt is spent, no deadline is consumed, and the request log still lists it as not tried with the reason paused. Unlike everything else on that page a pause is written the moment you click it, with no Apply, and the status panel offers an Undo. Pausing is per route — the same model paused on Opus keeps serving Sonnet — and it is stored in MODEL_PAUSED, MODEL_MYTHOS_PAUSED, MODEL_FABLE_PAUSED, MODEL_OPUS_PAUSED, MODEL_SONNET_PAUSED, MODEL_HAIKU_PAUSED, MODEL_VISION_PAUSED, MODEL_IMAGE_PAUSED, MODEL_TTS_PAUSED, MODEL_ASR_PAUSED and MODEL_VIDEO_PAUSED. Pausing is not hiding: the Models page's visibility lists change what appears in /v1/models and never change routing, and these change routing and never change listings. A route whose every model is paused fails with an error naming the key rather than quietly falling through to another route.
Media rails (7.60.0). MODEL_IMAGE + MODEL_IMAGE_FALLBACKS (the Image rail card on Model Config) serve POST /v1/images/generations and POST /v1/images/edits; MODEL_TTS + MODEL_TTS_FALLBACKS (the Speech rail) serve POST /v1/audio/speech; MODEL_ASR + MODEL_ASR_FALLBACKS (the Transcription rail) serve POST /v1/audio/transcriptions and /v1/audio/translations; MODEL_VIDEO + MODEL_VIDEO_FALLBACKS (the Video rail) serve POST /v1/videos, walked only until a provider accepts the job, which then stays on that provider and key. Gemini-shaped requests reach the same rails (7.65.0): generateContent asking for IMAGE or AUDIO output, and :predictLongRunning with GET /v1beta/operations/{id}; a Gemini request without those output modalities is chat as before. Gemini models can sit on the Speech and Transcription rails too (7.66.0), called through Gemini's native generateContent. The Models page lists every media-rail model with its declared endpoints and media health, Analytics has a separate Media card, and a custom provider can declare media endpoints with checkboxes on its form (7.67.0). Media requests are priced like chat ones -- provider figure, models.dev, LiteLLM when on, else unpriced (7.69.0). A media rail is not a chat tier: nothing on it is listed in /v1/models or offered to a coding agent. Since 7.78.2 every picker offers only its own kind of model (chat routes chat models, each media rail its own), and a discovered model whose kind is stated and is not chat -- by its provider's own model list (7.80.0), its models.dev modalities, its provider's model type or endpoint names, or by being saved on a media rail and on no chat rail, in that order -- is left out of /v1/models and the harness catalogues; a model of unknown kind stays listed, and a saved value is never dropped (see Which lists offer a model). It walks its chain under the same rules as a chat route -- FALLBACK_SKIP_KINDS, FALLBACK_RETRY_FIRST, the 429 route-around and probe, key rotation and lockouts, proxy chains, the deadlines and pauses -- through a separate copy of the engine held to chat's decisions by tests/contracts/test_media_chat_parity.py, and it keeps its own key, model and proxy health records, so a media failure never benches anything for chat. A model on a provider that declares no image endpoint is skipped without being charged. See Media routing.
An entry that cannot serve says so. When a rail entry's provider has no usable credential right now, the row shows a warning under the ref with a link to that provider's card. There are three warnings. No usable credentials — sign in means a ChatGPT or Claude subscription has nothing signed in, which includes a setting that still points at a retired store. No usable credentials — add a key means the provider has no key. Every key benched until HH:MM means every key in the pool is benched. Routing is unchanged: the router still tries the entry, fails it at once and moves to the next one, exactly as the request log records. The server works out the warning from what it already holds: the settings, the sign-in stores on disk, and the key health of providers it has already built. It never calls upstream to do so. The warning refreshes whenever the page reloads its status, for example after Apply or after you add a key. On Analytics, every widget that aggregates history shows the window it covers. Failover, Vision adapter and Provider performance also show when the settings were last saved, so a chain from before a change is not read as the current config.
Each is a comma-separated list of provider/model refs, in priority order — for example MODEL_OPUS_FALLBACKS="cerebras/qwen-3-coder-480b,groq/moonshotai/kimi-k2". Edit them in Admin UI → Model Config, where each chain sits directly under the model it backs up. Drag a row by its grip to reorder it, Ctrl/Cmd-click or Shift-click to pick several, drag onto another tier to copy (hold Shift to move), hold Ctrl/Cmd while dropping within one card to copy a row into the same chain, and drop onto a card's top slot to make that model the route's own. The up/down arrows still do the same job one step at a time, Ctrl+Z undoes the last drag, and nothing is saved until you press Apply.
A tier with its own override uses only its own chain; the two are never merged. So MODEL_OPUS set means Opus tries MODEL_OPUS then MODEL_OPUS_FALLBACKS, while an unset MODEL_SONNET means Sonnet tries MODEL then MODEL_FALLBACKS.
A model may be listed more than once (7.82.0). MODEL_OPUS=a/x with MODEL_OPUS_FALLBACKS="b/y,a/x" tries a/x, then b/y, then a/x again — every listing is one more try, in the place it is listed. This holds for every chat chain (the six tiers, MODEL_VISION_FALLBACKS, a coding agent's own tier override) and every media rail (MODEL_IMAGE_FALLBACKS, MODEL_TTS_FALLBACKS, MODEL_ASR_FALLBACKS, MODEL_VIDEO_FALLBACKS). A repeat gets no special handling: when its turn comes it is judged exactly like any other entry — a paused model is paused at every listing, a benched one is skipped at every listing, the same-key retries (PROVIDER_RETRY_ATTEMPTS) and key rotation run again, and a model whose provider is still in a rate-limit cooldown of at least FALLBACK_COOLDOWN_STEP_OVER_FLOOR seconds is stepped over (with a cooldown row) unless it is the last entry, when it is tried anyway. Up to 7.81.1 the second listing was silently dropped; Model Config and the agents' tier editor now keep it on Apply, and the request log shows one attempt row per listing. Pause lists stay sets: a pause names a model, so naming it twice means nothing.
Failover stops when the client has actually seen bytes. A model that fails while connecting, authenticating, rate-limiting, or before emitting anything is replaced silently. What counts as "seen" depends on the client:
- Streaming requests commit at the first chunk. A model that fails after it has begun answering is not replaced, because the reply is already on the wire and switching mid-answer would splice two different completions together.
- Non-streaming requests commit at the end. The response is assembled into a single message before the client sees anything, so a failure at any point still falls back, and the failed attempt's partial output is discarded with it.
Requests that name a provider and model directly (open_router/…) are never redirected — an explicit choice is honoured as given.
A silent model counts as a failure too — but only once you say when. A provider that accepts the request and then produces nothing holds it until the transport read timeout, and the chain gets its turn long after the client gave up. These settings bound it, on Admin UI → Limits & Resilience (deadlines on the Deadlines card, the last two on Chain benching).
Since 6.16.0 all four deadlines ship at
0, meaning no limit. With the shipped zeros MCC never ends a silent or stalled upstream on its own: the fallback chain moves only on an error the provider actually returns. A model that thinks for forty minutes is left to think; a stream that goes quiet and never resumes is left open until the transport gives up (HTTP_READ_TIMEOUT, 300 s by default, applied per read rather than per request). This is deliberate — a deadline that kills real work is a worse failure than a stall you can see in Analytics, and MCC is configured by the operator who runs it. To get time-based failover, set the ones that matter to you:FALLBACK_FIRST_TOKEN_TIMEOUT(silence before any output — the only one that produces a failover, since nothing has streamed yet),FALLBACK_STALL_TIMEOUT(silence after output started — ends the request; no failover is possible past the first token),FALLBACK_TOTAL_TIMEOUT(the whole request, across every attempt and retry). The Deadlines calculator on that page shows the resulting per-model allowance for your own chains. An install that already sets any of these keys keeps its own value; nothing is rewritten on upgrade. Every error MCC raises from one of these limits now names the env var that set it and the card that edits it.
| Setting | Default | What it does |
|---|---|---|
FALLBACK_FIRST_TOKEN_TIMEOUT |
0 (no limit) |
The first-token deadline: seconds a model may stay silent before the next model takes over. Nothing has streamed yet, so the handover is invisible — this is the only deadline that produces a failover rather than an ending. 0 (shipped) waits indefinitely. When you set it, each attempt also gets an equal share of what is left of FALLBACK_TOTAL_TIMEOUT, counting itself and every model still behind it, and what applies is whichever is smaller — unless FALLBACK_ATTEMPT_SHARE_FLOOR raises that share. Admin UI → Limits & Resilience computes it per route for your own chains. |
FALLBACK_ATTEMPT_SHARE_FLOOR |
3600 (one hour) |
Changed in 6.68.0 — was 0. Smallest slice of FALLBACK_TOTAL_TIMEOUT one attempt may be cut down to. A chain-side allowance — it bounds each model's first-token wait, never a retry of the same model. Without it the equal share alone decides, and on a long chain it silently undercuts the deadline above: 600 ÷ 8 models = 75s, so a box reading 120 logged produced no first token after 74.9494s. 3600 (shipped) is an hour-wide floor that cannot fire while FALLBACK_TOTAL_TIMEOUT is 0 — there is no budget to divide — and becomes a real floor the moment you set a budget; 0 divides the budget equally with no floor. It is moot out of the box either way, because the budget ships at 0. The trade once you set both: N silent models can spend up to N × this floor before the budget clamps them, and the models after that get less, or nothing — the Deadlines calculator shows both numbers and warns when the floor cannot fit. |
FALLBACK_TOTAL_TIMEOUT |
0 (no limit) |
Whole-request budget across every attempt, retry and recovery — the backstop for a stream that committed and then stalled. Divided between the models still to try, floored by FALLBACK_ATTEMPT_SHARE_FLOOR. 0 (shipped) disables it: a request may run for as long as the upstream keeps the connection open. |
FALLBACK_STALL_TIMEOUT |
0 (no limit) |
Seconds a stream that has started producing may then go quiet. Measured from the last chunk that moved the answer forward, so keepalives cannot hold a dead stream open and a model producing steadily is never cut. 0 (shipped) allows an unlimited pause. No failover is possible here — the reader has already seen the first model's words — so this ends the request rather than moving the chain. |
FALLBACK_END_CLEANLY_AFTER_COMMIT |
true |
What happens when a model that has already started answering then fails. The chain cannot step in — the reader has seen its words — so instead of an API error printed under a half-written answer, the message is ended: the open block is closed and the client is told the answer was cut short. The session continues with a short but complete reply. Set false to go back to the error. |
FALLBACK_RESUME_AFTER_COMMIT |
true |
Goes one step further than the row above: rather than only ending a half-written answer, the next model on the route is handed the text already on screen and asked to carry on from it, and its output is spliced into the same message — so the turn survives. Same chain, same bench, same budget as an ordinary fallback; nothing new is retried. Continuation is model-dependent (many models answer nothing, and one that starts the answer over is rejected rather than shown twice), and every one of those outcomes falls back to the short message above rather than an error. A half-written tool call is never continued. Set false to stop at the short message. |
FALLBACK_EJECT_SECONDS |
10 |
Changed in 6.68.0 — was 30. How long a benched model stays out of the chains that name it. Half a minute outlives most of the sessions that bench a model. |
FALLBACK_COOLDOWN_STEP_OVER_FLOOR |
5 |
Seconds of remaining rate-limit cooldown that make it worth trying the next model rather than waiting. Shorter waits are waited out, because stepping over costs the chain a slot. |
A model that dies after it started answering ends the message, not the turn. The commit boundary above cuts both ways: once real text has reached the client no other model can take over, and until 6.15.0 that meant every failure past that point — the stall deadline, the total budget, a mid-stream 5xx, a dropped connection — reached Claude Code as an API error under a partial answer, and the turn was dead. One incident streamed 1,333 characters, went quiet, and was reported as API Error … stopped producing output, with seven healthy fallback models recorded as not tried. Since 6.15.0 the stream is closed properly instead: the open text or thinking block is stopped, a message_delta carrying stop_reason: max_tokens says the answer was cut short rather than finished, and message_stop ends it. Nothing about when the stream is stopped changed — only what the client is handed. The answer is genuinely incomplete, and the request detail says so: the attempt still reads failed with its real cause, alongside ended early after N chars. One case still errors and cannot be rescued — a stream that stopped halfway through a tool call's arguments, because a tool call cannot be completed honestly and Claude Code would run it.
And since 6.18.0 it can be finished rather than only ended. With FALLBACK_RESUME_AFTER_COMMIT on (the default), the next model on the route is given the text already on screen and asked to continue from it, and its output is spliced into the same message: one envelope, one text block, one ending. There is no visible seam, deliberately — the reader gets an answer, not a report about routing — and the model change is recorded in the request detail instead, as continued here after <model> stalled at N chars. It is the same chain as an ordinary fallback: benched models are skipped, FALLBACK_SKIP_KINDS still ends a route, the attempt shares the same budget, and no new retry layer or deadline exists. What the second model does with the request is not guaranteed: measured across thirteen live model/host pairs, some continue cleanly, most answer nothing, and a few start the answer over — and a restart is detected and thrown away rather than shown twice. Every unusable continuation lands on the truncated message above, never on an error, which is why this can ship on.
Ejection can never empty a chain: if every model on a route is benched, they are tried in order anyway — skipping a bad model is an optimisation, refusing to try anything is an outage.
What benches a model. FALLBACK_BENCH_ENABLED is the master switch, and it ships off: every model in the chain is tried every time, so a model failing half its requests is still retried at chain position 0 on every single request. It reads on two pages — Model Config, at the top of the routing view, beside the routes it governs, and Limits & Resilience → Chain benching, where it gates the tuning below. They are the same setting; changing either changes both. With it off every control below is inert. Turn it on and FALLBACK_BEHAVIOR picks the evidence:
Only model-shaped failures count. With benching on, a failure benches a model only when it says something about the model: an upstream 5xx, an overloaded response, or a 401/403 from the provider. Timeouts (first-token, stall, budget), 429s, exhausted credits, context_length and malformed requests are facts about the request or the account — they fail identically on a healthy model and a dead one — and never bench anything. That distinction is why the switch could be turned off by default: the bench used to count everything, so one prompt larger than any model's context window ejected the entire chain and the request was answered by whichever model was left holding the 400.
| Setting | Default | What it does |
|---|---|---|
FALLBACK_BENCH_ENABLED |
false |
Master switch for benching. Off (the default) tries every model every time; on makes the whole card live. Set on Model Config or on this card — one setting, two places. |
FALLBACK_BEHAVIOR |
rate_based |
rate_based benches on a failure rate over a window; legacy restores the older consecutive-count rule. |
FALLBACK_EJECT_WINDOW / FALLBACK_EJECT_FAILURE_RATE |
10 / 0.5 |
rate_based only: benched once 5 of the last 10 requests fail. |
FALLBACK_EJECT_MIN_SAMPLES |
8 |
rate_based only: nothing is benched until that many of its requests have been seen, so one failure on a barely-used model cannot trip it. |
FALLBACK_EJECT_AFTER_FAILURES |
3 |
legacy only: consecutive failures. 0 turns counting off. |
FALLBACK_RETRY_FIRST |
skip |
retry_once gives the primary only one more attempt on a transient error before the chain moves on. An already-failed fallback is never retried. |
The card keeps the unselected mode's fields visible but disabled, each carrying its own note — "Not used while eject mode is legacy", "Not used while benching is off" — rather than dimming them and leaving you to infer why. Disabled fields are skipped by the change tracker, so switching modes cannot save the other mode's values by accident.
A rate-limited model follows the chain order by default. With RATE_LIMIT_ROUTES_AROUND_MODEL=false (the default since 7.78.10) a 429 is retried on the same key per PROVIDER_RETRY_ATTEMPTS, with a short wait between tries, then on each other key of the provider, and only then does the request move to the next chain entry, in order. RATE_LIMIT_ROUTES_AROUND_MODEL=true (the default from 6.20.0 to 7.78.9) never sleeps and never spends a retry on a 429: the (key, model) pair is benched and the request moves to a later model on the same provider, because a gateway that limits one model usually still answers another on the same key in the same second; the chain entries in between are skipped for that request.
One model is still retried on a 5xx before the chain is used. An upstream 5xx or a dropped connection is retried against the same model on an exponential backoff — that is the one failure a second knock on the same key can fix — and four settings shape it:
| Setting | Default | What it does |
|---|---|---|
PROVIDER_RETRY_ATTEMPTS |
2 |
Changed in 6.68.0 — was 3, and 5 before 6.20.0. Tries one model gets on the same key after a 5xx or a dropped connection. A 429 uses none of them. The third try lands about six seconds after the first, by which time a healthy model behind it could have answered. |
PROVIDER_RETRY_BACKOFF_BASE_SECONDS |
2 |
How long a provider waits before its first retry of a 5xx. Each further retry doubles it. |
PROVIDER_RETRY_BACKOFF_MAX_SECONDS |
5 |
Changed in 6.68.0 — was 10. The longest single wait — the ceiling the doubling backoff stops growing past. The chain is not consulted until the ladder is spent, so this is added to how long a request waits before another model is tried. A 429 walks no ladder at all. |
PROVIDER_RETRY_BACKOFF_JITTER_SECONDS |
0.5 |
Changed in 6.68.0 — was 1, and is kept below the ceiling above. Random spread added to each wait, so several clients hitting the same limit do not retry in lockstep. |
A context overflow is not a malformed request. Both usually arrive as HTTP 400, and until 5.43.0 MCC treated every 400 the same way — as a client error that would fail identically everywhere, so the whole chain was abandoned. That is right for a malformed body and wrong for a conversation that outgrew the model's window, which is exactly the case a larger-window fallback exists to cover. Context-length failures are now classified as their own kind and fall through to the next model.
| Setting | Default | What it does |
|---|---|---|
FALLBACK_SKIP_KINDS |
invalid_request |
Comma-separated failure kinds that abort the chain instead of falling through. Known kinds: invalid_request, model_rejected, context_length, authentication, permission, quota, rate_limit, overloaded, timeout, upstream, unavailable, free_tier. Since 6.46.0 invalid_request means only a 400 whose own message says the request is malformed; every other 400 is model_rejected and falls through. Set FALLBACK_SKIP_KINDS=invalid_request,model_rejected,context_length to restore the pre-5.43.0 behaviour of giving up on any 400. quota is deliberately absent from the default: an account out of credits says nothing about the request, and the next key or the next model may well answer it. |
Thinking is not answering. A reasoning model that streams its thoughts and never writes an answer used to commit the route on its very first thought: from that moment no other model could take over, the stall guard never fired because thoughts kept arriving, and the request ran until the whole budget ended it. Measured across 21 days of real traffic, 44 of 499 budget exhaustions were a stream that had only reasoned, and 490 of the 499 never left the first model on the chain.
Since 5.50.0 reasoning is held back like an envelope frame, so the attempt stays abandonable and the next model can still answer. Two settings control it, both on Admin UI → Limits & Resilience → Deadlines — beside the first-token deadline they pre-empt, rather than on Model Config where the reasoning deadline used to sit:
| Setting | Default | What it does |
|---|---|---|
FALLBACK_ON_REASONING_ONLY |
true |
Hold reasoning back so a model that only thinks does not commit the route. The cost is that thinking no longer streams live — it arrives with the answer, or once 64 KB have accumulated. Set false to watch a model think in real time and accept that it commits the route. |
STREAM_COMMIT_HOLDBACK_CHARS |
0 |
Visible characters that must arrive before output is released to the client, on top of STREAM_COMMIT_HOLDBACK_SECONDS — both conditions, or the stream ending. While output is held a failure is still invisible, so the route can start over on the next model with nothing shown; raising it buys that for a model that writes a word and dies, and costs exactly that much time-to-first-visible-word on every request. 0 (shipped) asks only the clock. |
FALLBACK_REASONING_ANSWER_TIMEOUT |
0 (no limit) |
Seconds a model may think before the chain moves on. A flat allowance on purpose: the attempt's share of FALLBACK_TOTAL_TIMEOUT is sized for a model that has shown nothing, and 600s split across an eleven-model chain leaves 54s, far too little to think in. 0 (shipped) lets a thinking model run to the whole request budget — and, while that is 0 too, to no limit at all. |
Silence is not a closed connection. Since 7.46.0 a streaming response that has been silent for a while -- no model has produced a frame yet, or one has and then gone quiet -- gets a keepalive frame its protocol defines as meaningless: event: ping on /v1/messages, an SSE comment on /v1/chat/completions, /v1/responses and Gemini. It is written at the HTTP boundary, outside the request log's view, so it never moves ttft_ms or any other measurement, and every other byte of the answer is identical with it on or off. It helps OpenAI and Gemini SDK clients and any proxy between the client and MCC that closes idle connections. It does not help Claude Code by default: the official Anthropic SDK drops ping before its idle timer sees it, and only _CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL=1 in Claude Code's environment makes the bytes count. Settings on Admin UI → Limits & Resilience → Stream keepalive, where a card also says when a deadline above outlasts Claude Code's 300 s idle floor.
| Setting | Default | What it does |
|---|---|---|
STREAM_KEEPALIVE_IDLE_SECONDS |
30 |
Seconds of silence before the first keepalive. A keepalive sent before any model answered commits the HTTP 200, so a failure after it arrives as an error inside the stream instead of an HTTP status. 0 never sends one. |
STREAM_KEEPALIVE_INTERVAL_SECONDS |
20 |
Seconds between keepalives while the silence lasts; a real frame resets the clock. |
STREAM_KEEPALIVE_MAX_SECONDS |
300 |
Longest single stretch of silence kept alive. Past it nothing more is written and the client's own idle timer runs exactly as with keepalives off. 0 = no cap. |
STREAM_KEEPALIVE_MODE |
ping |
7.47.0, opt-in. What the keepalive is on /v1/messages. ping is Anthropic's event: ping, which Claude Code drops. frames: while the model's own text or tool-call block is open (after its content_block_start, before its content_block_stop), the keepalive is an empty delta of that block -- text_delta with "" or input_json_delta with "" -- which Claude Code's idle timer does count. The text and tool arguments the client assembles are identical with it on or off; the bytes on the wire are not, which is why it is off by default. Anywhere else -- before message_start, before the first block, between blocks, inside a thinking block -- it is still a ping, and it never invents a thinking block. The request log records how many frames each request carried (keepalive_frames). Other surfaces keep their SSE comment. |
Every attempt is recorded, and since 6.12.0 so is every try inside an attempt. Analytics shows the model that actually answered rather than the one the route started from, and the request detail draws the whole chain — every model the chain reached, and under each one every upstream try it made, with the status it met, the credential it used and the seconds it spent waiting — see Route tracing.
Output Token Budget¶
Each model is asked for what it can actually produce. MCC reads the routed model's published output limit — the provider's own /models payload first, the models.dev catalog second — and sizes max_tokens from it:
- The client asked for less than the limit → it gets exactly what it asked for.
- The client asked for more → the request is lowered to the model's maximum and a
MAX TOKENS CLAMPEDwarning names the model, the ask and the limit. Sending the original value instead just buys a 400 from the provider. - The client asked for nothing → the model's full limit is sent. A model that can write 230,400 tokens is used as one.
- The request is going to think → the ask is raised to the model's published limit first, and the clamps above then apply to that. Thinking tokens and answer tokens are spent from one
max_tokens, so a client that sized the number for an answer unknowingly sized the thinking too — and the model, not the client, is the one that knows what it can emit. An unknown limit is never widened: a number nobody published has no standing to raise an explicit request, exactly as it has none to lower one.
For a 64,000-token ask at the max reasoning tier on a 262,144-output model, that is the difference between starving the answer and not:
| before | after | |
|---|---|---|
wire max_tokens |
64,000 | 131,072 (the model's limit, held to the ceiling) |
| answer reserve | 16,384 | 16,384 |
| thinking budget | 47,616 | 114,688 |
| answer room left | 16,384 | 16,384 |
The rung does not widen anything — the presence of reasoning does. low and max produce the same max_tokens; the rung then decides how much of that allowance the thinking may spend. On a host that takes an effort word rather than a number, nothing about the level changes at all — only the answer stops being squeezed out by the thinking in front of it. With reasoning off, the wire is byte-identical to 6.7.0 apart from the ceiling, which now applies to every request.
This replaces a flat 81,920 that every model got regardless. On real routes that number was simultaneously too high (minimaxai/minimax-m3 and thinkingmachines/inkling both stop at 16,384) and too low (tencent/hy3:free does 128,000, meituan/longcat-2.0:free 131,072).
These cover what the model itself cannot answer, all on Admin UI → Limits & Resilience → Output & thinking budgets:
| Setting | Default | What it does |
|---|---|---|
MAX_OUTPUT_TOKENS_UNKNOWN_DEFAULT |
32768 |
Used only when no source publishes a limit for the routed model. A fallback for a missing client value, never a cap on a present one — a number nobody published has no business shrinking an explicit request. |
MAX_OUTPUT_TOKENS_FLOOR |
8192 |
New in 6.47.0, and it changes behaviour on update. The smallest allowance any request is sent with — the one setting here that raises a number rather than lowering it. A client that hardcodes a tiny max_tokens gets a truncated answer out of a model that could have finished it. Bounded twice: never above the routed model's own published limit, and applied before the context headroom so it can never re-inflate a budget the context cannot hold. It stands down on an explicit max_tokens: 0, and the ceiling below beats it. Not the same setting as MAX_OUTPUT_TOKENS_CONTEXT_FLOOR. Set MAX_OUTPUT_TOKENS_FLOOR=0 to turn it off and restore 6.46.0. |
MAX_OUTPUT_TOKENS_CEILING |
131072 |
Absolute head on every request, whatever the model can do — reasoning or not. It ships set because a thinking request is sized from the routed model's full published limit, and OpenAI/Azure-style limiters reserve max_tokens against the TPM bucket before generating — so an unbounded thinking turn on a 262,144-output model can 429 a request that would otherwise have been served. It never raises a model above its own limit. Range 0–1048576; 0 is the sentinel for "no ceiling", and blank resolves to the default rather than to off. |
MAX_OUTPUT_TOKENS_CONTEXT_MARGIN |
1024 |
Tokens reserved for the prompt when a model's output limit is as large as its whole context window — about 15% of the catalog reports exactly that, and on those, asking for the full output leaves no room for the messages. |
MAX_OUTPUT_TOKENS_CONTEXT_FLOOR |
4096 |
Smallest budget the reserve above may produce. A wrong or small published context can leave a handful of tokens, and a request carrying max_tokens: 3 succeeds with a one-token answer — which looks like a useless model rather than a misconfigured catalog. Below this, the request is sent unchanged so the provider reports the real context error. 0 sends any positive headroom. |
REASONING_ANSWER_FLOOR_MAX |
16384 |
Most tokens ever held back from the output allowance for the visible answer while extended thinking is on. Thinking and the answer share one max_tokens. The reserve applied is min(this, output // 2), so a 16,384-output model keeps a working thinking budget instead of zero. |
ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS |
81920 |
Settable since 6.47.0 — it was a hardcoded literal threaded through every provider profile. The max_tokens written onto a request that reached a provider with none of its own and no published limit to take one from. A fallback, never a cap: a routed request was bound to the model's real limit long before this applies. 0 sends no max_tokens at all. |
REASONING_EFFORT_BUDGET_RATIOS |
0.10,0.20,0.50,0.80,0.95,0.95 |
New in 6.47.0. Share of the output allowance each effort may spend on thinking, in order: minimal, low, medium, high, xhigh, max. Six values, each strictly between 0 and 1, never decreasing. A small ratio does not disable thinking — Anthropic's 1,024-token minimum is applied afterwards and wins above an allowance of 1,025. |
Two of these are overridable per model, since 7.25.0. A row in ~/.mcc/model_overrides.json -- or the Models page, which writes it -- may carry reasoning_preference and max_output_tokens. The reasoning word outranks REASONING_POLICY and the REASONING_* tier settings for that model: precedence runs model row, provider row, tier setting, per-harness tier override, REASONING_POLICY, then the client's own ask, and "reasoning_preference": "client" hands one model back to the client. max_output_tokens is a cap -- min(published limit, your number) -- so it only ever lowers, and the ceiling and context headroom in this table still have the last word. Both are opt-in: with neither set, every number here resolves exactly as it did in 7.24.0. See USAGE.
A third, and it is not a number: response_surface. It names which wire API one model is posted to -- chat_completions, responses or messages -- and it never reaches a body. Precedence for it is its own: the override, then what a probe of this deployment proved, then -- 7.114.0 -- a dated measurement shipped with the build, then what the vendor's published registry says (models.dev's per-model provider.npm), then -- 7.35.0 -- the surface the profile declares for the case nobody has an opinion, and only then Chat Completions.
Since 7.114.0 a model's known doors are a set, and the inbound client's format orders them. The vocabulary is override -> learned -> measured -> registry -> upstream -> floor; the first rung that names anything is the whole set, and the floor is a candidate only when every rung above it is empty. The order is a sort key, never a filter:
| inbound door | order |
|---|---|
POST /v1/messages |
messages -> responses -> chat_completions |
POST /v1/chat/completions, POST /v1/responses |
responses -> chat_completions -> messages |
| anything else, and no request in flight (Models page, admin, probes) | discovery order |
A door the family does not name is kept and tried last, so a model whose only known door is messages keeps it for an OpenAI-format client too. When a door answers wrong-door evidence (a 400/403/405/422/500/501 naming an endpoint, a bare 500, or a 404 on a door MCC guessed), it is pruned from the learned set for seven days and the request continues on the next known door inside the same attempt; 429s, timeouts and credit refusals never teach, and a country refusal never does on a door MCC already knows. Forget on the Models page re-opens it at once, and TTL expiry does so by itself. On a model the vendor places on an API this build cannot speak (@ai-sdk/google), an opted-in host -- the two OpenCode profiles -- probes the door its client prefers, once, ~16 tokens, instead of refusing; the vendor's statement stays on the page until a probe answers. Every other provider, every single-surface profile and every operator override is untouched.
Since 7.115.0 a host may guess, once. A model whose surface nobody published -- no provider.npm at all, or one this build cannot map, which is 88 of the 167 OpenCode rows -- would otherwise sit on the profile's floor for ever. On the two OpenCode profiles such a model is tried once on the door its client family prefers, before your request: one ~16-token probe, then the floor if it answers wrong, and the answer is remembered through the same seven-day learned fact. The next request goes straight to the door that worked, with no probe. A caller with no request in flight -- the Models page, an admin route, a capability probe -- has no preference and keeps the floor, so the page does not move; a declared door, an operator override, a learned fact and every other provider never guess at all.
Which providers declare more than one surface: opencode and opencode_go by profile, and -- since 7.33.0 -- any custom provider whose entry ticks a second wire API. Every other provider declares nothing, which means one surface and no resolution at all. The Models page offers the override only where there is more than one door to choose between, and offers only the doors that host declares.
One more ceiling lives off this card. NVIDIA NIM carries its own max_tokens in the nested NIM settings, and where it is set it lowers whatever the table above resolved — for NIM routes only. It ships unset, so it is inert on a default install. It is deliberately not on the Budgets card: the nested NIM group has no flat environment variable of its own, and giving it one is a change of its own rather than part of this table.
Context is respected. Where the provider publishes a context window, the budget is bounded by what the prompt left of it, minus the margin. If the prompt already fills the window the request is sent unchanged, so the provider reports the real error rather than MCC guessing at it.
A provider's own rejection still wins. Some upstreams cap output below what they publish and say so in a 400 (max_completion_tokens must be less than or equal to 40960). MCC parses that, retries once, and remembers the cap for that model — and a learned cap always beats a catalogue value, because it came from the deployment actually serving the request.
Limits & Resilience¶
Everything above that is a number rather than a model lives on one page, Admin UI → Limits & Resilience. It was a single flat grid of 37 fields until 6.2.0; it is now six cards behind a sticky section rail, each stating in one line what it decides:
| Card | What it decides |
|---|---|
| Output & thinking budgets | How large one answer may be, and how it is split between thinking and the answer. A per-model limit published by the provider always wins over anything here. |
| Deadlines | How long one model may hold a request before the chain moves on — including FALLBACK_REASONING_ANSWER_TIMEOUT, which used to sit on Model Config away from the deadline it pre-empts. |
| Chain benching | Whether a model that keeps failing is skipped, and on what evidence. |
| Provider retries & throughput | How hard one model is retried, and how fast requests may leave — HTTP_*_TIMEOUT, PROVIDER_RATE_* and PROVIDER_MAX_CONCURRENCY moved here from Providers, where the transport ceiling underneath every deadline had no description at all. |
| Credential health | What one API key's failures cost it. Nothing else can bench a key. |
| Diagnostics | Logging and debugging flags, LOG_LEVEL included. |
Two groups deliberately left: the nine REQUEST_LOG_* settings are at the bottom of Analytics, and the nine DESKTOP_* ones on Providers — the page that shows the consequence owns the control. FALLBACK_SKIP_KINDS stays on Model Config with a cross-link, because it is a routing decision, not a limit.
The number in the box is not the number you get unless the floor holds it there. The allowance is min(first-token deadline, this attempt's share of the total budget), and that share is total ÷ models still to try. On a ten-model Opus chain with a 600 s budget a field reading 120 gives each model 60 s — the field is a ceiling, not the allowance. FALLBACK_ATTEMPT_SHARE_FLOOR stops that share falling below the deadline you set, so the box means what it says; 0 is the pure equal share and 3600 (shipped since 6.68.0) is a floor wider than any interactive request. With the budget at the shipped 0 none of this arithmetic runs whatever the floor says, and the calculator agrees: every route reads no limit, and the headline names HTTP_READ_TIMEOUT as the only thing left that ends a silent model.
The trade is real and the page states it rather than hiding it: a floor of 180 s across a ten-model chain would need 1,800 s of budget, so with 600 s only the first three silent models can use the whole floor and the rest get what is left, then nothing. The Deadlines card carries a calculator that computes all of this per route from your own chains, names the floor in the formula when the floor is what decides, and warns with the fix rather than the complaint: the budget that would fit the floor, the total budget that would honour the deadline you configured, or that HTTP_READ_TIMEOUT sits below the deadline above it — in which case a slow model produces a transport error instead of a clean handover.
The deadline calculator: one row per route, the real first-token share, and the budget that would honour the number you typed.
What it deliberately does not model: time already spent on the request, a primary retried under FALLBACK_RETRY_FIRST, benched models shortening the chain, or the reasoning deadline taking over once a model starts thinking. It is the worst case for the first model on a route, not a fixed slot — time an attempt does not use flows to the models behind it.
The card below it is the one that decides how hard a single model is retried before the chain is used at all, and how fast requests are allowed to leave.
Proxy Chains: More Than One Way Out¶
Every provider has had a <PROVIDER>_PROXY setting for a long time. It is one string, read once in the provider's constructor and baked into a long-lived client: if it dies, every request to that provider dies with it, and if the provider meters a free tier per source address there is nothing to switch to. Admin UI → Proxying is the resource that expresses the other shape — an ordered list of addresses for one provider, a rotation policy, and the failures that move a request to the next one.
A provider with no chain behaves exactly as it always has. Its <PROVIDER>_PROXY is used as the single static address, the .env is never rewritten, and nothing about the request path changes — which is every provider on every install until somebody opens the page. When you do add a chain, the first entry can be seeded from that stored address, and the key keeps its value: the chain simply becomes what gets used while it has entries.
Where the chain sits¶
Inside the credential pool, not above it. A provider with two keys and a three-entry chain is one credential pool over two proxy pools over six clients, and everything above the proxy pool — credential rotation, the (key, model) bench, the route-around, the retry ladder, the deadlines — is untouched. When a chain is exhausted, the same error escapes that would have escaped with no chain at all, and the request follows your model fallback chain exactly as it does today. The only behaviour that changes direction is the intended one: with a chain configured, fewer 402s and 429s reach the credential pool.
What moves a request to the next address¶
Two separate rules.
The failures you select, from the chips on the card. quota, rate_limit and timeout are on by default. authentication and permission are refused outright and cannot be armed, in the store, in the API and in the runtime: a new address does not fix a rejected key, and rotating on a 401 burns the whole chain in one request and benches every address it touched. Everything else is selectable and off, with a line on the chip saying why a new address is unlikely to help.
A failure of the proxy itself — connection refused, connect timeout, or the proxy answering 407 — always moves to the next entry, whatever you selected. The thing that failed is the address; making that configurable would let you build a chain that cannot route around a dead entry. A 502 or 503 is deliberately not in that set, because a proxy and an origin send byte-identical ones; select upstream or unavailable if you want those to move the chain too.
The two benches¶
| Bench | What earns it | How long | How wide |
|---|---|---|---|
| Reachability | the address would not carry the request at all | escalating 60s → 5m → 1h, clamped at the last — the ladder is PROXY_REACHABILITY_TIERS since 7.32.0, and 60,300,3600 is what it ships as |
the address, across every provider on this install — a dead proxy is dead for everybody, and discovering that once per provider is three connect timeouts instead of one |
| Trigger | the provider answered with a failure you selected | the provider's own published Retry-After if it sent one — capped by PROXY_COOLDOWN_MAX_SECONDS (3600) — else PROXY_COOLDOWN_SECONDS (300) |
the address and the provider, across all its keys, because the allowance is metered by address. Switch Quota is metered per to address and key on a provider that meters per (address, account) |
Both are live on the card: each entry says healthy, failing, cooldown 4m, unhealthy — next check in 5m (reason), or not checked yet — which means exactly that, an address no request has gone through, not a bad measurement. A fourth state, refused — TLS intercepted, is not a bench at all: see Testing an address below.
A bench running out is not a way back (7.19.0)¶
Up to 7.18 a reachability tier expiring made an address selectable again, with nothing having measured it. On a list of free proxies that meant a dead address was re-tried on a live request every minute, forever, at the cost of a connect timeout each time.
Since 7.19.0 the tier expiring means the address is due for a re-check, and the only thing that puts it back in the rotation is a check that passes — the same check the Check now button on its row runs, against that provider's own host. PROXY_HEALTH_REPROBE_ENABLED on Limits & Resilience (default on) is the loop that runs those checks for you, on the same 60s → 5m → 1h cadence. It contacts only provider hosts you already route to, only for addresses that have already failed on your own traffic, and only inside chains you have switched on — a chain that is off is never probed. Turn it off and an address that fails stays out until you press Check now.
An address already known to be unhealthy is skipped for free: it spends no switch, no live-failure budget and no connect timeout. That is what makes a three-hundred-entry chain of mostly-dead free proxies usable.
The bench is also written down now, in ~/.mcc/proxy_chains.json beside the address it describes, and re-armed at startup. A restart used to make every dead proxy look healthy again; a bench that expired while MCC was not running comes back as unhealthy and due, never as healthy, because nothing checked it.
How long a chain may be¶
There is no limit on a fresh install. 7.13 capped a chain at twelve entries because each one was a client, a rate limiter and a recovery ladder built for every credential at startup; 7.19.0 builds a rung's leaf the first time a request goes out through it and closes it again when it has been idle longest, so a three-hundred-entry chain is three hundred strings and at most PROXY_MAX_OPEN_LEGS (default 32) open clients. Set PROXY_CHAIN_MAX_ENTRIES on Limits & Resilience if you want a ceiling of your own; a longer chain is then refused with a message rather than silently truncated. A card longer than fifty rows draws fifty and offers Show 50 more / Show all.
The bounds, and why they are real¶
PROXY_MAX_SWITCHES_PER_REQUEST on Limits & Resilience (default 2, range 1–5) is the most any chain on this install may move inside one request because a trigger you armed fired; each card carries its own number, and the smaller of the two applies. Every switch spends wall-clock inside a single attempt and the deadlines above it do not move to make room.
PROXY_MAX_LIVE_FAILURES (default 5, 0 = no bound) is the companion bound on the other kind of move: how many addresses may fail while actually carrying the request — a refused CONNECT, a connect timeout, a 407, a failed SOCKS handshake, or a reply MCC could not decode before the first byte of output — before MCC stops walking the chain. Addresses already known unhealthy are skipped for free and do not count against it.
PROXY_CONNECT_TIMEOUT_SECONDS (default 10, range 1–120) is what one dead address actually costs. It bounds establishing the proxied connection and nothing else: read, write and pool timeouts stay on the provider's own settings, and a provider with no chain is not affected. Since 7.36.1 "establishing" includes the SOCKS5 handshake, which httpcore 1.0.9 performs with no deadline of any kind — a socks5/socks5h rung that completed the TCP accept and then never answered the greeting held the request for ever, and neither this setting nor HTTP_READ_TIMEOUT nor the pool timeout reached that read. An HTTP CONNECT rung was never affected: its tunnel is carried by an ordinary HTTP/1.1 connection that already honours the request's own timeouts. An expired handshake is now the same ConnectTimeout-class failure a dead TCP dial produces, so the rung is benched and the chain switches exactly as it always did. Since 7.20.0 a proxied connect failure is also surfaced to the chain on the first dial — PROVIDER_RETRY_ATTEMPTS used to run its ladder inside the leg, so every dead address was dialled twice before the chain was told. Since 7.52.1 it is also surfaced without the retry backoff: the leg used to sleep its backoff (about 2.3 s, measured on 571 of 590 live connect failures) before stopping the second dial, so each dead address cost that much extra before the next one was tried. Status retries (429, 5xx) inside a leg are unchanged: the address answered, so a second knock can still help.
PROXY_KEEPALIVE_SECONDS (default 0, range 0–3600, since 7.94.0) is how long a proxied leg keeps an idle connection for the next request; see Keep-alive and recency below. It changes nothing about how long establishing a connection may take.
What counts as the address's fault (7.20.0)¶
Two failure shapes were previously filed against the model. Both are now read as the address's, and both only when the request was actually going out through a proxy and nothing had been yielded yet:
- a failed SOCKS handshake (
socksio— “Malformed reply”), which can only happen to a proxied connection by construction; and - a reply MCC could not decode, which in one measured day happened 293 times, on one host, and never once unproxied.
Both switch to the next address and bench the one that failed on the reachability ladder, and both count against PROXY_MAX_LIVE_FAILURES — so a chain of such addresses still ends at Direct. After the first chunk of output neither is read that way: the request cannot move address then, and a decode fault there is the origin's.
Separately, an error reply whose Content-Encoding does not describe its bytes no longer loses its status. MCC reads a >=400 body raw and decodes it afterwards, so a 403 or a 429 is classified as a 403 or a 429 whatever the body turned out to be — and the response head (status, content-type, content-encoding, length, server, cf-ray, retry-after, and the first 128 bytes as hex) is recorded on that try in the request-detail modal.
Direct is the last rung (7.19.0), and only once every proxy is unhealthy (7.79.2)¶
When a chain has no healthy address left, the request goes out with no proxy at all — on this machine's own address — once, and the request log's per-try proxy label says Direct on that try.
Since 7.79.2 "no healthy address left" means every one of them (your decision of 2026-10-06: only fall back to the real IP once all proxies are unhealthy). An address is unhealthy exactly when the chain itself holds it out of selection: unreachable (it failed to connect, or answered 407, and no check has passed since), refused (the checker measured it terminating TLS), or cooling down after a refusal you armed a chip for. An address nothing has tried yet is not unhealthy. Under the single policy only the first entry is asked about, because it is the only one that policy ever dials. Up to 7.79.1 a request that spent PROXY_MAX_LIVE_FAILURES (five dead addresses) went direct even with healthy addresses left untried; now Direct is withheld then: nothing is dialled, the answer is a 503 that names how many proxies are still healthy and the setting, and the request moves on to the next model of its fallback chain exactly as a chain with Direct fallback off does. The credential pool reads it as it reads a dead socket — another key may try, and this one is not charged. When the request's switch bound (PROXY_MAX_SWITCHES_PER_REQUEST) is spent, the request moves on as it always did and never reaches Direct.
This is a per-chain switch, Fall back to this machine's own address, on the card beside the switch bound. It is on for every chain including one stored before 7.19.0 and including a subscription-login provider, because the alternative is a provider that stops answering the moment its free proxies die, and an operator who added proxies to reach a provider did not ask for that. Turn it off on a provider that must never see this machine's address: with it off, a chain whose addresses are all benched behaves exactly as it did before 7.19.0 — it dispatches into a bench rather than answer nothing, and the failure reaches the model fallback chain as it always did.
An address the checker found terminating TLS is never used, in any of these branches, including the direct one: a bench is a preference and an interception is a prohibition. If the chain already contains an explicit Direct (no proxy) entry, that rung is an ordinary rung and no second direct try is added.
With it off, never this machine's address -- whatever state the chain is in (7.78.8). Up to 7.78.7 a switched-on chain with nothing usable in it -- every entry paused, every address removed from the catalogue, no entry at all -- was treated as no chain, and the provider was built to go out on this machine's own address even with this switch off; so was every provider when proxy_chains.json was blank, not JSON or could not be read. Now, with the switch off, such a provider is refused: every call (a request, the hourly model listing, Test, Probe, a media request) answers 503 with a sentence naming the provider, why the chain has nothing usable, and this switch on the Proxying page, and the request moves to the next model of its fallback chain exactly as it would for any provider that cannot serve. Nothing is dialled. The card shows the same sentence in red. A provider whose own <PROVIDER>_PROXY (or a custom provider's stored proxy) is set still goes out through that proxy, as before. With the switch on, nothing changed. A chain file that cannot be read is not "no chains": the table read before it keeps routing; at a start that finds it broken, the providers named in proxy_masking.json (written beside it on every save: the chains with this switch off) are refused and every other provider is built without its chain; a red banner on every dashboard page and a server.log line say so, and MCC never rewrites a file it could not read -- saves are refused with a 503 until you fix or remove it and restart. A save whose provider rebuild failed now says Saved -- not routing yet on the card and in its answer, instead of announcing the new chain as if it were in use.
With it on, the same refusal for a chain with nothing usable (7.79.2). Every entry paused, every address removed (a read drops entries whose address is gone, so this is a chain with no entry left), or a chain file that cannot be read is not "every proxy unhealthy": such a provider is refused exactly as above, and the sentence says how to send it from this machine on purpose — switch the chain off. The masking record proxy_masking.json now also lists, under direct_only_when_unhealthy, the switched-on chains with Direct fallback on (except a chain whose every entry is a Direct entry you wrote), so a start that finds the chain file broken refuses those too; a record written by 7.78.8 has no such list and is read as before.
What a proxy chain hides (7.79.2)¶
Each card on the Proxying page carries a box What
| Through the chain | model requests on every surface, the leg's own retries, fallbacks to the provider's other models; the model listing (hourly and Test); Probe capabilities; the credential health probe; token refresh for a sign-in (the request's own leg, and the card's Refresh button through the chain's first usable exit); media requests and their result downloads |
| Never through the chain | signing in (OAuth, from this machine, once); and not sent to the provider at all: web search and web fetch (their own proxy settings), models.dev and price lists, update checks |
| Direct fallback on | the provider sees this machine's address only once every proxy is unhealthy |
| Direct fallback off | the provider never sees this machine's address; with no proxy left the request moves on to the next model |
| One usable entry | no switching and no Direct fallback |
| Chain off, or a subscription chain not acknowledged | not in use: the provider sees this machine's address (or its own <PROVIDER>_PROXY) |
Token refresh through the leg's exit. A Claude or ChatGPT sign-in's token is renewed by the leg whose request found it ageing, through that leg's proxy — a provider reached through a chain no longer sees this machine's address on a refresh. With no proxy (no chain, or a Direct leg) the refresh is the very call it always was. The cards' Refresh buttons use the chain's first usable exit (the one the card's probes use); when nothing may carry it they answer 503 with the reason and send nothing. A <PROVIDER>_PROXY set for a sign-in provider now carries its refreshes too. A Vertex refresh through a socks5:// entry has the proxy resolve oauth2.googleapis.com (it is sent as socks5h), as every model request through such an entry already did.
The request log names the address. A one-entry chain (the entry's own name) and a static proxy (<PROVIDER>_PROXY or a custom provider's stored one, by its masked host:port) used to leave the proxy column empty ("not measured"); both are named now, per dial, and feed the speed ledger like any chain address. A Direct dial that the operating system's proxy carries — HTTPS_PROXY/HTTP_PROXY/ALL_PROXY, or the Windows/macOS setting, which any client with no proxy of its own follows — is labelled direct via system proxy host:port instead of direct, and the card's box names that proxy.
Keep trying exits until one answers (7.81.0)¶
For a provider whose allowance follows the address — OpenCode Zen's free models answer a spent address with 429 FreeUsageLimitError while other addresses still get answers — Keep trying exits until one answers moves the request to another exit. Since 7.81.1 it is on for every chain: a chain created from 7.81.0 on, and a chain stored before it too (the stored document has no until_served key, and that reads as on). Untick it on a chain's card to give that chain back the rotation of earlier releases; the store then keeps "until_served": false for it, and a chain left on is written without the key. With it ticked, and only then:
| What the exit did | Before 7.81.0 | Ticked |
|---|---|---|
429 / free-usage limit (with the rate_limit chip) |
retried on the same exit PROVIDER_RETRY_ATTEMPTS times when RATE_LIMIT_ROUTES_AROUND_MODEL is off, then the next exit, up to the switch limit; at the limit the 429 reached the key pool, which benched the model |
the next exit at once, same model; at the switch limit the request moves to the next model without benching it, and the key is not charged |
refusal for the exit's country (403, the host's own words: RegionError, "not available in your country") |
the next model, unless you ticked model_rejected (which also moves on every other model rejection) |
the next exit, same model, counted as a switch; no chip needed — the words say the address is the problem |
a proxy that cannot be reached (refused, timed out, 407, broken SOCKS) |
the next exit (unchanged) | the next exit (unchanged) |
| a connection dropped before the first byte (read/write/protocol error, read timeout) through a proxy | retried on the same exit by the leaf's retry ladder and the stream's early-retry ladder (one measured request lost 383 s on one exit), then usually the next model | the next exit at once; the dropped exit goes on the reachability ledger like an unreachable one (out until a check passes) |
| a drop after the first byte | never moves | never moves (unchanged) |
The bounds are the ones you already have (your decision of 2026-10-06: "respect the set var for max retries before going to next in chain"): a request moves on at most Switches per request times for refusals (the smaller of the card's number and PROXY_MAX_SWITCHES_PER_REQUEST), and at most PROXY_MAX_LIVE_FAILURES exits may fail while carrying it. No new limit is added and none is removed. When a ticked chain runs out — the switch limit reached, the live-failure bound spent with Direct not allowed, or no exit left to select — on what an exit causes (a rate limit, a country refusal, an exit that cannot be reached or drops the connection, or every exit remembered), the request ends with a 502 UNAVAILABLE that says what every exit answered, and moves to the next model of the fallback chain: the credential pool rotates on it without charging the key, the route's health does not count it, and the model is not benched for exits that refused. Anything else a chip moved the chain on — quota, timeout, a 5xx, a model rejection — still reaches the key pool exactly as before, so a key out of credits is still charged as one. Reaching the switch limit never ends in Direct.
Exit memory. A refused exit is remembered for that provider (and key): spent for as long as the provider's own published wait (capped by PROXY_COOLDOWN_MAX_SECONDS), else your PROXY_COOLDOWN_SECONDS; blocked for its country for PROXY_COOLDOWN_SECONDS. A later request skips a remembered exit without dialling it. The memory is process-wide, so a chain save, the automatic speed re-sort or any other rebuild of the provider does not forget it (the rotation's own bench used to be lost on every one). A success through the exit clears it; so does Forget exit memory on the card, which also lets the chain's unreachable exits be tried again. A restart forgets it (each spent exit then costs one try to re-learn). Media keeps its own memory, as it keeps its own reachability ledger. Each entry on the card shows what is remembered and until when.
The model is skipped only while no exit can serve. The executor's cooldown step-over asks the chain how long until it can serve; a ticked chain answers 0 while any exit is selectable — an exit nobody has dialled yet counts as free — instead of the minimum over the exits that happened to be opened, so one 429 on the first exit no longer makes the executor skip the model while dozens of exits were untried.
Direct fallback keeps the 7.79.2 rule: this machine's address only once every proxy is unhealthy, and a remembered exit counts as unhealthy (it is the rotation's own skip state that holds it out).
The request log shows, per dial, what MCC now remembers about that exit (remembered spent until 14:05:12 UTC (stated 412 s), remembered blocked for its country …, unreachable: skipped until a check passes), per attempt how many exits were skipped from memory (exits_skipped_by_memory), and — when the exits ran out — the exhaustion sentence as the attempt's root cause. Chains without the box record nothing new.
What it costs. Each bad exit costs what it costs today — a refused connect up to PROXY_CONNECT_TIMEOUT_SECONDS, a 429 a second or two, a silent exit up to HTTP_READ_TIMEOUT — but once per memory window rather than once per request. Nothing new bounds a request's total time; with the deadlines at 0 your client's own timeout is the outer bound. The request body (and so the prompt cache) and the OpenCode session id are the same on every exit.
A country refusal is not charged to the key (7.96.0)¶
A 403 whose host words say the caller's country was refused (RegionError, "not available in your country") is about the address the request came from, not the key. Since 7.96.0 it leaves the key's health untouched on every route: no lockout, no step up CREDENTIAL_LOCKOUT_TIERS. A ticked chain already worked this way since 7.81.0 (the exits run out as a 502 UNAVAILABLE that charges nothing); the change is for everything else — an unticked chain, a one-entry chain, a static proxy, no proxy at all, a Direct entry or the Direct fallback that was refused, and the media key pool. Before 7.96.0 those routes locked the key out, one tier per refusal: on one install, 1,450 lockouts in thirty days (3 s, 6 s and 60 s with a 3,6,60 ladder), all on OpenCode Zen, all through proxy exits.
Nothing else moves. The request still tries the next key, then the next model of your fallback chain, exactly as before. An unticked chain still does not move to another exit — unticked keeps meaning "don't keep trying exits". A body that also names a billing phrase is still a credits bench, a plain 401/403 still locks the key out, and a genuine 401 raised while a country refusal was being handled is still charged (only the error's explicit cause is read). Country words that appear only in the request the host echoed back are not the host's words. There is no setting: the only other position would re-create the wrong lockout. The request detail's credential row says 403 country refusal — the address it came from, not the key; nothing benched.
Exit refusal facts (7.96.0)¶
Each attempt's stored upstream tries are read for two things that are about the exit rather than the key or the model:
| Fact | What the stored try shows |
|---|---|
| country refused | a 403 whose body has the host's country words (RegionError, "not available in your country") |
| challenged | a 403 or 503 whose body or recorded response head is a bot challenge (Cloudflare's cf-mitigated, "Just a moment…", challenge-platform) |
The request detail marks the attempt with a chip — country refused ×2, challenged ×1 — and the Requests table's Exit cell counts them in its tooltip. They are counted when the row is read, from what the log already holds, so requests logged before 7.96.0 show them too; nothing new is stored, and an attempt that met neither renders exactly as before. The opt-in Exit export field gains Country refused and Challenged: the counts across the request's attempts, 0 where a ladder was stored and nothing was met, empty where no ladder was stored. OpenAI's own wording ("Country, region, or territory not supported") is not read as a country refusal yet.
Rotation policies¶
The same four names and the same meanings credential rotation uses: single, round_robin, least_used, failover (on_error is an accepted alias). failover is the default and the conservative one: it pins to the first healthy entry and changes nothing until something breaks. round_robin is the one that multiplies a per-address allowance — with four working addresses a per-IP limit applies four times over, from the first request rather than only after an error. Under failover and single the order of the entries decides which address is used, and since 7.56.0 MCC can keep the fastest healthy one first for you — see Keep the fastest healthy proxy first below.
Where the addresses come from: MCC ships no lists¶
You can type an address into a chain yourself, or you can point MCC at a published proxy list and choose from what it offers. MCC ships nobody's list. It knows how to read seven formats — three flavours of JSON keyed by a wrapper object, three flavours of bare JSON array, and plain ip:port text — and which lists to read is entirely your choice. Earlier releases bundled seven concrete public feeds; that made every release depend on seven strangers' uptime and on their URLs not moving, and it meant shipping a judgement about whose endpoints you ought to be fetching. Reading a format is a fact about a file; shipping a catalogue is a recommendation, and this one was not ours to make.
So the feed list on Admin UI → Proxying starts empty. Give a list a name and an https URL — plain http is refused, because a feed decides which addresses end up in front of your credentials and nobody on the path should get a vote — and press Detect format: MCC reads that URL once and proposes the format it recognises, saying what it found and how many addresses a trial read produced. The picker is always shown and always yours; the proposal just moves it, and whatever it says when you press Add to list is what gets stored. A list nothing recognises can still be added — something that 404s this afternoon may answer tomorrow. Nothing is fetched again until you switch the feed on and press Fetch, or turn on PROXY_FEED_REFRESH_ENABLED. Removing a list keeps the addresses it already offered: those are facts of their own, with their own test results, and often the reason you added it.
If you are upgrading from 7.17.x, the feeds you had switched on are converted to entries of your own on first start — same URLs, same readers, still switched on — and are then ordinary rows you can rename, re-point or remove.
Fetch tests what it found, and only offers addresses that work¶
Up to 7.20.0, pressing Fetch downloaded the lists, merged them, ranked them and offered the result. Every row was a claim somebody else had published, none of it had been measured, and you found out which addresses were real one Add at a time — a ten-second check each, mostly spent discovering that a free proxy had stopped listening months ago. Seven lists offered 1,572 addresses once; a handful of them worked.
Since 7.21.0 a fetch finishes the job. It reads the lists, merges and ranks them exactly as before, and then tests every address it found with the same check the Add button runs — a TCP connect, a CONNECT tunnel, and a strict-TLS request to the chosen provider's own host. Only the addresses that passed are stored and offered. An address that did not answer is not kept. An address whose tunnel broke certificate validation is recorded refused, durably, so no later fetch offers it again — and, as always, that verdict is lifted only by later tests that succeed. Since 7.52.4 it takes two passes in a row: over five runs on 1,000 feed addresses, 2 of the 69 ever refused were refused in some runs and passed in another, so one lucky pass could let an intercepting address back into a chain. A pass that does not yet lift the refusal is filed as refused, with a note on the row saying how far the lift has got ("passed 1 of the 2 checks in a row that lift this refusal"). A check that did not answer breaks the row, and a restart starts the count again. Your credential was never at risk either way: nothing is sent over a connection that failed verification.
Since 7.22.2 a sweep stops at the handshake by default. It still opens the tunnel and still completes a full TLS handshake to the chosen provider's own host through it, with ordinary strict trust — which is where the interception verdict comes from, so that control is unchanged — but it sends no HTTP request. The reason is the provider's side of it: the 1,592-address pass above arrived at opencode.ai as about a thousand HEAD requests from a thousand different source addresses, and the handshake had already answered the question those requests were asked. What this does not prove is that the provider would have answered a request through that address, which is why Test, Add and Add all working still send one. Set PROXY_FETCH_CHECK_DEPTH=request to have the sweep do it too.
A list's https label means an HTTP proxy (7.52.3). Lists publish https for an HTTP proxy that can tunnel HTTPS -- one that answers CONNECT -- not for a proxy you must reach over TLS yourself. Up to 7.52.2 MCC took the label literally and dialled those addresses as https:// proxies, and none of them could ever pass: measured on 160 such addresses, 0 passed as https:// and 23 passed as http://. Since 7.52.3 a labelled https address is dialled as http://, and the row still says what the list claimed about HTTPS. A plain-text list line that writes https:// in front of its own address keeps it, because that was written rather than labelled. Nothing already in a chain is rewritten: an https:// address you added earlier stays as it is, and the next fetch offers the same address again as http:// if it works that way.
Which provider it tests against is the one picked in Add to beneath the list, and each row says so: working for NVIDIA NIM · 190 ms. A check answers one question about one host, so a verdict without a destination would be a claim about providers nobody measured. The default is the first provider that already has a chain, otherwise the first configured provider with an https base URL. If no provider has one, the fetch is refused with the reason rather than falling back to storing addresses it could not test.
Screen, then confirm (7.53.0). Most addresses a single test calls dead are not dead, they are unreliable: on 1,000 feed addresses, re-tested patiently three times, 31 % of the ones a fetch had thrown away worked at least once, and an address that works at all passes about 46 % of its tries. So the sweep above is now only the screen. Everything it called dead — except a proxy that refused the connection outright, which recovered only 13 % of the time — is re-tested in up to PROXY_CHECK_CONFIRM_ATTEMPTS confirm rounds (default 3), PROXY_CHECK_CONFIRM_SPACING_SECONDS apart (default 30 s; the first round starts one spacing after the screen), at the fetch's own concurrency, with the live connect limit PROXY_CONNECT_TIMEOUT_SECONDS instead of the screen's 5 s — an address the confirm stage admits is one live traffic would also wait for. A pass in any round is stored like a screen pass; only an address that failed every round is confirmed dead. Measured: +162 working (166 → 328), about 3.5 minutes added. Stop ends the confirm stage at once, including a spacing wait. Every pass is labelled working, slow (setup above PROXY_CHECK_SLOW_MS) or flaky (passed on fewer than half of three or more tries in this fetch); all three are kept and addable, and the candidate row shows the label as a chip. With PROXY_CHECK_LINK_GUARD on, the fetch also pauses — marking nothing dead — while your own connection to the provider is failing.
The same rule reaches the other checkers. The health re-prober gives an address whose re-check is due a round of PROXY_CHECK_CONFIRM_ATTEMPTS tries: any pass puts it back; only when all fail does it move one rung down the 1 minute / 5 minutes / 1 hour ladder, and the row says so — unhealthy — failed 3 of 3 tries at 14:02; next round in 59m. Before, one unlucky try moved it a whole rung. Test all and Add all working use the same round; the single-row Test stays one try. And an address that fails on live traffic for the first time is re-tested once on the re-prober's next tick (within 30 s) instead of waiting out its 60-second rung: a pass puts it straight back, a failure changes nothing.
It runs in the background and you can watch it. A list of several hundred addresses takes minutes, so the press starts a job and returns; the page shows Tested 212 of 834 · 41 working · 12 slow · 163 confirmed dead · 2 refused, and confirming 612 addresses (attempt 2 of 3) while it re-tests, with a Stop. Stopping keeps everything that has already passed — it means "that is enough addresses", not "throw the work away". Reloading the page re-attaches to a sweep that is still running rather than losing it, and only one fetch runs at a time: a second press while one is going is refused, naming the one that is.
Nineteen settings, all on Limits & Resilience → Credential health. Six of them became settings in 7.24.0 and ship with exactly the number the code used before. The four added in 7.53.0 (PROXY_CHECK_CONFIRM_ATTEMPTS, PROXY_CHECK_CONFIRM_SPACING_SECONDS, PROXY_CHECK_SLOW_MS, PROXY_CHECK_LINK_GUARD) do change what a fetch does by default — see Screen, then confirm above. PROXY_ORDER_RESORT_MINUTES (7.56.0) paces the speed order, not a fetch.
| Setting | Default | What it does |
|---|---|---|
PROXY_FETCH_TEST_CONCURRENCY |
100 |
How many addresses are tested at once. The work is waiting on other people's networks, so it overlaps; this is also exactly how many sockets are open to strangers at one moment. Range 4–500. Measured: seven lists offered 1,592 addresses and 32 at a time had tested 848 of them after 186 seconds, because a dead address costs the whole connect timeout. The single Test and Add buttons are unaffected — those are one address with you watching a row. |
PROXY_FETCH_CONCURRENCY_MODE |
fixed |
How the number above is read. fixed is a count of addresses and is 7.21.0 exactly. percent reads it as a percentage of however many addresses the feeds actually offered this pass — 6 with 1,592 on offer tests 96 at a time — resolved after the lists are read, never below 4 and never above 500. The Proxying page says what it worked out to. A percent value outside 1–100 is a typo: it is reported on the page and read as a fixed count for that pass, never a crash and never a silence. |
PROXY_FETCH_CHECK_DEPTH |
tls |
How far each address's test goes. tls opens the tunnel, completes a full TLS handshake to the provider's own host through it with ordinary strict trust, and closes — no HTTP request is sent. request is 7.22.1's check: the same tunnel, then a HEAD. Both catch an intercepting proxy identically, because that verdict arrives during the handshake. Test, Add and Add all working always use request, whatever this says. |
PROXY_FETCH_CONNECT_TIMEOUT_SECONDS |
5 |
How long the TCP step waits before calling an address dead. Short on purpose: most of what a public list publishes has stopped listening. An address that does answer gets the checker's full ten seconds for the HTTPS handshake that follows — this shortens the first step only. |
PROXY_CANDIDATES_MAX |
0 |
How many of the ranked addresses are tested and offered. 0 is unlimited and is what ships — chains have held any number of entries since 7.19.0, so a ceiling on the offer would be one MCC invented. A number you set is applied in rank order, so a bounded fetch tests the best of what was found. |
PROXY_CHECK_TIMEOUT_SECONDS |
10 |
How long any single leg of an address check may take — the TLS handshake through the tunnel, and the HEAD that follows it when one is sent. Ten seconds is what every release up to 7.23.0 hard-coded. Raise it for a chain that has to reach the other side of the world, where a working but distant address is otherwise written off; lower it to give up on a slow address sooner. Range 1–120. This is the check, not the request path: a real request through a proxy is bounded by PROXY_CONNECT_TIMEOUT_SECONDS. Since 7.52.2 the background health re-prober honours it too; before, the re-prober always used ten seconds whatever this said. |
PROXY_CHECK_CONFIRM_ATTEMPTS |
3 |
How hard a check tries before it calls an address dead. A fetch re-tests everything its screen called dead — except a proxy that refused the connection outright — this many more times, with PROXY_CONNECT_TIMEOUT_SECONDS for the dial. The health re-prober, Test all and Add all working give an address this many tries in total and move it down the re-check ladder only when every try failed, once per round; there, 1 is every release before 7.53.0. So the number means "re-tests after the screen" for a fetch and "tries in all" for the others. The single-row Test is always one try. Measured on 1,000 feed addresses: a fetch called 775 dead, and three re-tests 30 s apart found 82, then 33, then 47 of them working — +162 working, about 3.5 minutes added to the fetch. Range 1–10. |
PROXY_CHECK_CONFIRM_SPACING_SECONDS |
30 |
How long MCC waits between one try of an address and the next — before the first confirm round, between rounds, and between the tries of a re-probe round. Thirty seconds is the spacing the measurement above used. 0 re-tests at once. Range 0–600. |
PROXY_CHECK_SLOW_MS |
3000 |
Setup time — connect, tunnel and TLS handshake added up — above which a passing address is labelled slow instead of working. A label, never a verdict: a slow address is kept and can be added to a chain. 3,000 ms marked the slowest 35 % of the passes a shipped fetch found on the measuring machine, and 58 % of the passes the re-tests recovered. Range 100–60000. |
PROXY_ORDER_RESORT_MINUTES |
30 |
With Keep the fastest healthy proxy first on for a chain, the shortest time between two orders MCC writes into it. A stability choice, not a measurement: together with the 25 % / 500 ms margin it keeps a chain from swapping back and forth between two addresses of similar speed, and it bounds how often that one provider is rebuilt for a new order. Sort by speed now is not held back by it. Range 5–1440. See Keep the fastest healthy proxy first below. |
PROXY_CHECK_LINK_GUARD |
true |
Whether a fetch watches your own connection while it runs: one direct TLS handshake — no proxy, no request, ordinary strict trust — to the provider host it tests against, before the sweep and every 15 seconds during it. If that fails or takes longer than 5 seconds the fetch pauses, says your own connection to … is failing — paused, and marks nothing dead for checks that failed while the link was down (they are tried again once it answers). Not adaptive concurrency: at 8, 32 and 100 checks at once the same half hour found 181, 183 and 182 working addresses, so there was no congestion to back off from. |
PROXY_CHECK_MAX_CONCURRENCY |
4 |
How many addresses the background health re-prober tests at the same time — the loop that, since 7.19.0, is the only way a benched address gets back into the rotation. That loop is the single consumer; the fetch sweep and Add all working are paced by PROXY_FETCH_TEST_CONCURRENCY. Four is what 7.19.0–7.23.0 hard-coded. Each check sends the full end-to-end request to your provider's own host, which is why the ceiling is 128 rather than the fetch sweep's 500. Range 1–128. Before 7.52.2 the re-prober was clamped at four whatever this said, so only lowering it had any effect. |
PROXY_FEED_TIMEOUT_SECONDS |
15 |
How long one feed has to answer before it is skipped for that pass. Feeds are read one after another, so this is what bounds the Fetch button by the number of lists rather than by the patience of the slowest one. Fifteen seconds is 7.20.0's number. Range 1–300. |
PROXY_FEED_MAX |
20 |
How many feed URLs the store will hold; saving a longer list on the Proxying page is refused, naming the count. Twenty is what 7.20.0–7.23.0 allowed. It bounds a list you type, not anything a chain holds: every feed is one request to somebody else's server on every refresh pass. Range 1–1000. |
PROXY_CANDIDATE_BULK_MAX |
100 |
How many addresses one press of Add all working, or one bulk Discard, may carry. A hundred is 7.21.0's number. It bounds one HTTP request and the sweep it starts — never how many entries a chain may hold, which has had no limit since 7.19.0. Raise it to hand a whole sweep to a provider in one press; every address is still proven end to end on the way in. Range 1–100000. |
PROXY_REACHABILITY_TIERS |
60,300,3600 |
How long an address that would not carry a request at all — a refused CONNECT, a connect timeout, a 407 — waits before it is re-probed. One step per consecutive failure, staying at the last entry; the same shape and the same rules as CREDENTIAL_LOCKOUT_TIERS, for the connection instead of the key. 60,300,3600 is the ladder 7.19.0 hard-coded, so the default changes nothing. Since 7.19.0 a failed address stays out of every chain until a check passes; this ladder only decides how soon that check is owed. Shortening it re-arms benches already on the books — including the ones read back from disk at startup — so a pending hour becomes the new last entry rather than running out the old numbers, and a stored failure count past the end of a shorter ladder reads as its last entry. Lengthening it never extends a bench already running. Applies on Save. |
PROXY_COOLDOWN_SECONDS |
300 |
How long one address sits out after the upstream answered with a failure class you armed on the Proxying page and published no wait of its own. Five minutes is what 7.19.0–7.31.0 hard-coded: long enough that a per-address allowance has a chance of rolling over, short enough that a chain of two recovers inside one working session. A wait the provider did publish is honoured instead, capped by the setting below. 0 benches nothing the provider did not time itself — the same reading RATE_LIMIT_COOLDOWN_SECONDS has for a key. Range 0–86400. Applies on Save. |
PROXY_COOLDOWN_MAX_SECONDS |
3600 |
The ceiling on a Retry-After the provider sent for an address. An hour, not the day a credential gets: a key the host refused until midnight really is refused until midnight, while an address is one of several and the cheap move is to try it again. Range 1–86400. Applies on Save. |
PROXY_FETCH_PERSIST_INTERVAL_SECONDS |
5 |
The longest a proven address may sit unwritten while a fetch is still running. Since 7.22.0 a sweep saves in batches as it goes rather than only at the end, so a server that stops mid-sweep keeps what it had already proven; this is that clock. Five seconds is 7.22.0's number. Addresses are also written whenever twenty-five have accumulated, and always once at the end. Range 0.5–300. |
Then one press to use them. Add all N working to <provider> takes the whole offer into that chain. It re-tests every address on the way in — with the full request check, and at the concurrency PROXY_FETCH_TEST_CONCURRENCY resolves to, so three hundred addresses are re-tested at the pace you set rather than four at a time — exactly as a hand-picked add does — the verdict you are looking at is about one destination, this button may be pointing at another, and the interception check is the one thing standing between a stranger's machine and your credentials. A few seconds is not worth skipping it for.
A fetch does not disturb the request path. The reachability ladder that tells the runtime which addresses are worth dialling holds a bounded number of rows and is about your addresses. A sweep of eight hundred strangers is not charged to it: an address no chain references gets no row at all. An address that is in one of your chains is charged normally — a fetch-test is the same three questions the Test button asks, so its answer about an address you route through is ordinary evidence.
Candidates stored by 7.18–7.20 were offered without being tested. They are not deleted on upgrade, and they are never shown as working: each is marked not tested — fetch again. The next fetch replaces the offer list, so they clear themselves the first time you press the button.
Measured speed and success rate (7.54.0)¶
A single verdict says little about a free proxy: an address that works at all passes about half its tries, and through the best proxy the first token of an answer arrived in 5.7 s while through the worst it took 186 s. So MCC now keeps, per address and per provider, a short history of how fast its connection sets up and how often it works, and the Proxying page can sort and filter by it. Nothing here reorders a chain; since 7.56.0 a chain can opt in to that — see Keep the fastest healthy proxy first below.
What is measured. Every check reaching the ledgers — a fetch's screen and confirm tries, Check now, Test all, a bulk add, the health re-prober and its early confirm (a pass only) — adds a sample: passed or not, and its connect, tunnel and TLS times (a request-depth check's first byte). With the request log on, every proxied request adds its dials too (connect and tunnel time, and whether the request it carried was answered), and each proxied attempt's time to first token, divided by the median time to first token of the same model on the same provider over the last 24 hours. With the request log off, nothing from live traffic is recorded — only checks. An interception is not a speed sample; refused and the reachability bench (dead) stay what they were.
The score, one number per row:
- success rate
r = (passes + 1) / (samples + 2)— a single pass is not 100 %; - setup
s= the median connect + tunnel [+ TLS] of the passing samples; - expected setup
E = s + (1 − r) / r × F, whereFisPROXY_CONNECT_TIMEOUT_SECONDS— what one failed dial costs a live request before the chain moves on (since 7.52.1 a proxied leg no longer sleeps before switching, so no retry sleep is added); - live factor
L= the median of those first-token ratios, clamped to 0.5–4.0, and 1.0 until three have been measured; - rank =
E × L, lower is better.
Labels: working (it passes, setup within PROXY_CHECK_SLOW_MS, and r ≥ 0.8 — below three samples, a record with no failure), slow (it passes, median setup above PROXY_CHECK_SLOW_MS), flaky (r below 0.5 over three or more samples), untested (no sample). A record between flaky and working carries no label; its "k of n ok" says why. Labels never take an address out of a chain.
Bounds — constants, not settings: the last 20 checks and dials per address and provider (and separately the last 20 first-token ratios), only samples from the last 24 hours count, at most 2,048 address/provider pairs (least recently updated dropped first), and a model's first-token baseline is its last 50 answers. The history is kept in ~/.mcc/proxy_speed.json, written by the health timer every 30 s when something changed; a missing or damaged file starts an empty history.
On the page. Candidates sort by measured setup (MCC), success rate (MCC) or rank (MCC); the feed's own number is still sortable and labelled latency the feed published — it is the feed's claim, never MCC's measurement. Filters: Max setup (ms) (an address MCC has not timed is hidden while a limit is set), Hide slow, Hide flaky. Select the fastest N ticks the N best-ranked rows matching the filters for the Add and Discard buttons; it adds nothing by itself. Each row shows its measured setup and "k of n ok". A chain entry reads, for example, ≈1.8 s · 4/5 ok · 12 samples · first token 1.4× with its label beside it.
Caveat. The first-token factor assumes the model mix and the proxies carrying each model are similar over a day: each answer is compared with the median of the same model on the same provider, so if one model is served mostly through a few slow proxies its median is slow too and they look ordinary, and a proxy that carried only one slow model on a provider whose baseline comes from other traffic can look slower than it is. Live data also exists only while the request log is on.
Keep the fastest healthy proxy first (7.56.0)¶
Picking a fast proxy matters more than anything else about a free one: through the best proxy the first token arrived in 5.7 s, through the worst in 186 s. Under failover a chain uses its first healthy entry, so the cheapest way to use the fast ones is to keep them at the top. That is what this switch does — and all it does: MCC rewrites the order of the chain's entries through the ordinary chain save. The selection engine itself is unchanged, byte for byte; failover still takes the lowest selectable entry, and every rule about benches, refusals and Direct applies exactly as before.
The switch. Keep the fastest healthy proxy first, on each chain card under its entries. It is on for a chain you create from 7.56.0 on, and off for every chain you already had: a chain saved before this release has no such setting, and MCC reads that as off, so your existing order is never rearranged until you click it. One click turns it on; that click writes only the switch and moves nothing. A save that does not mention the switch keeps what the chain had. It is offered for failover and single chains only — round_robin and least_used do not use the order to pick one address, so on those the switch is off, greyed out, and says why.
What gets sorted. Only entries that are not paused, not Direct, not refused (caught intercepting TLS), not unhealthy (benched by the reachability ladder) and not holding a trigger bench (the cooldown a 429, quota or timeout answer earns), by the rank described above for this chain's provider; lower is better, ties and addresses MCC has not measured keep the order you gave them. Everything else keeps its relative order below the sorted ones, so an unhealthy, refused or paused entry can only ever move down, never up. Two entries keep their exact place: Direct — counted from the end of the list, and the list never changes length — and an address on a trigger bench, which is neither promoted nor demoted while it is benched.
When MCC writes a new order. Once a minute it looks at every enabled chain with the switch on, and writes a new order only when all of these hold:
- the first healthy entry — the one failover actually uses — would change;
- the newcomer's rank is at most 0.75 × the current first entry's and at least 500 ms better (a first entry MCC has no measured setup for loses to any measured newcomer);
- the newcomer has at least 3 samples in the last 24 hours;
- no order was written into this chain in the last
PROXY_ORDER_RESORT_MINUTES(default 30).
A change further down the list is never written on its own: it rides along with a change of the first entry, or waits for Sort by speed now. So a re-sort is rare and does not flap between two addresses of similar speed. Each written re-sort is logged — PROXY ORDER: <provider> re-sorted by speed (automatic): first <old> (rank N ms) -> <new> (rank M ms) — and the card shows when it last happened. Writing an order is a chain save, so it rebuilds that provider only (see Saving a chain rebuilds that provider below); no other provider's pool, client or benches are touched, and the loop never makes a network request — it reads the measurements checks and live traffic already recorded.
Two buttons, never automatic.
- Sort by speed now sorts the saved chain once, by the same rules minus the three thresholds (margin, samples, interval). It still never moves an unhealthy, refused, paused or benched address up, and Direct keeps its place. It works whether the switch is on or off, and does not turn it on.
- Pause all but the fastest N pauses every address in the chain except the N best-ranked healthy ones. Nothing is removed and nothing is un-paused; each paused row's Resume (then Save) brings it back. It is refused, with a message, while MCC has measured no healthy address in the chain. MCC never does this by itself.
Never touched by any of this: the selection engine (core/proxy_rotation.py, providers/runtime/proxy_rotating.py), a chain with the switch off, a disabled chain (by the loop), what a pause, a refusal or a bench means, and which addresses are in a chain.
Keep-alive and recency (7.94.0)¶
Two settings on Limits & Resilience → Credential health, both 0 (off) until you set them. With both at 0 every client and every order is built exactly as in 7.93.0.
PROXY_KEEPALIVE_SECONDS — how long a connection through a proxy exit stays open while idle, so the next request through the same exit reuses it. The HTTP library MCC uses closes an idle connection after 5 seconds and MCC never said otherwise, so nearly every proxied request opened a new connection to the proxy, ran its tunnel handshake (CONNECT or SOCKS5) and then the TLS handshake through it. Through free proxies that handshake has been measured at 2.8–51.9 s (opencode-lite's measurement, quoted in the 7.94.0 investigation). 60 is recommended when your chains use proxies: requests up to a minute apart through the same exit then skip all of it.
- Which requests gain. Chat Completions, Responses and Messages streams, and every request that is not streamed, hand their connection back to the pool when they finish, so the next one reuses it. Until 7.111.1 a Chat Completions stream did not: MCC's reader for that endpoint (a copy of the OpenAI client's) stopped at
data: [DONE]and closed the response before the body's end, which closes the connection — with or without this setting. Since 7.111.1 it reads the few bytes that end the body first (waiting at most half a second for a host that holds its body open after[DONE], then closing as before); a request abandoned mid-answer is still closed at once and never read on. - Measured (7.94.0, a local chain of SOCKS5 proxies that each add 1.5 s to a new tunnel, 30 streaming requests per endpoint, the same provider asked again every 8–12 s): median time to first token 1.61 s → 0.08 s on the Responses and Messages endpoints (30 new connections → 1), 1.61 s → 1.61 s on Chat Completions (30 → 30); 180 of 180 answered. Against a proxy that closes idle tunnels itself, 16 of 16 answered, each on a fresh tunnel.
- Measured for Chat Completions (7.111.1, the same rig, setting at 60): median time to first token 1.589 s → 0.076 s (30 new connections → 0 beyond the first); Responses 0.069 → 0.068 s and Messages 0.071 → 0.070 s unchanged; 90 of 90 answered, and every request body and header byte-identical to 7.111.0. Against a proxy that closes idle tunnels after 4 s, 24 of 24 answered, each on a fresh tunnel.
- Which clients. Every HTTP client a chain leg with an address builds: the OpenAI-compatible chat client (the SDK's own pool sizes are kept), the Responses and Messages clients, the Anthropic, ChatGPT-OAuth, Cloudflare, GitHub Models and Vertex clients, and a media leg's client. Only how long an idle connection lives changes; pool sizes, timeouts, redirects and certificate checks are untouched.
- Which are not. A provider with no chain, a single fixed proxy (
<PROVIDER>_PROXY, or a chain with one usable entry), a chain's Direct entry and the Direct fallback are built with exactly the arguments they had before — the release proves it by recording every client constructor's arguments with the setting unset, 0 and 60. - When it applies. On Save, to requests that start after it: saving rebuilds the providers, as every proxy setting does. A request already running keeps the connections it had.
- What still dials. A request's dial rows keep naming the exit exactly as before; a reused connection simply has no connect or tunnel time on its row, which is how the request log already shows "not measured".
- The catch. A proxy that drops an idle connection without telling the other side can make the first request after a pause fail on that exit; MCC then treats it as any dropped connection — the chain moves on, as it always has. A proxy that closes the connection properly costs nothing: the closed connection is discarded and a new one opened.
PROXY_ORDER_RECENCY_HALF_LIFE_MINUTES — prefer exits a real request succeeded through lately, in the order Keep the fastest healthy proxy first and Sort by speed now write. At 0 the order is by measured speed only, exactly as above. With a number, each address's rank is multiplied by 2 ^ (age ÷ half-life), where age is how much longer ago a real request last succeeded through it than through the chain's most recently proven address:
- the most recently proven address keeps its plain speed rank; one a half-life staler ranks as if it were twice as slow, two half-lives four times; past 16 half-lives (or never proven in the last 24 hours, while another address is) the factor stops at 2^16;
- a real success is a dial whose request the provider answered (below 400) or a first token through the address. A health check alone never counts: it proves the tunnel opens, not that the provider serves through it;
- a chain where nothing has been proven yet sorts exactly as it does at 0;
- the same rules decide whether an automatic order is written — the 0.75× / 500 ms margin, the three samples,
PROXY_ORDER_RESORT_MINUTES— compared on the recency-weighted rank, which is also the rank thePROXY ORDER:log line prints; - live requests are measured only while the request log is on (it is by default). 10 is a good start.
It changes only which entry is first in a chain's saved order. The selection engine, PROXY_MAX_SWITCHES_PER_REQUEST, PROXY_MAX_LIVE_FAILURES, health checks, benches, exit memory, the Direct rule, the page's speed readout and Pause all but the fastest N are untouched.
Testing an address before you rely on it¶
Every saved entry has a Test button, and each card has Test all. One press does three things, in order:
- A TCP connect to the proxy itself. A free address that has stopped listening is the commonest thing in any list of them, and one socket finds out.
- An HTTPS request through the proxy to that provider's own host, with the ordinary strict certificate verification every other client here uses. Not a third-party IP-echo service: the destination has to be the thing the chain will actually talk to, and it is a host you already chose to talk to.
- The latency of step 2 — a real handshake through the tunnel, not a ping.
Step 2 is a security control. If the certificate that comes back does not verify, the tunnel is not being relayed, it is being read: something between you and the provider terminated the TLS and is looking at the plaintext. That address is marked TLS intercepted and refused — it cannot be saved into a chain, and one already in a chain is held out of selection immediately rather than waiting for you to edit anything. There is no override; the way out is a later Test that passes, which is a measurement rather than a confirmation dialog. In one published study of 640,000 open proxies, 16,923 of them were manipulating traffic, and this is the one check that tells them apart from the honest ones — up to the handshake they are indistinguishable, so a TCP check alone would call them healthy.
Nothing is measured until you ask. Pressing Fetch is asking — that is what starts the sweep described above — and so is this button. Set Check proxies in the background on Limits & Resilience to have MCC re-measure every address in a chain on a timer (Minutes between proxy checks, default 30, floor 5, 0 for off). It ships off: an install that never opens this page makes no outbound request it was not asked to. An address the checker finds dead walks the reachability ladder above with no action from you, so the chain routes around it.
The exit-IP check is yours to enable. Exit-IP check URL is empty by default and MCC names no default host for it. Set a URL that answers with the address it saw and the checker fetches it through each proxy, so the row can show the address the far end reported — proof that the source address really changed. It is the one leg of the check that contacts somebody you did not already choose to talk to, which is why it happens only if you name them, and it never decides whether an address passes. Since 7.89.0 it can also be the word provider — see Where each exit comes out below.
Where each exit comes out (7.89.0)¶
PROXY_CHECK_EXIT_IP_URL=provider (the Proxying page's Use each provider's own trace) makes every Test, Test all and Add also fetch https://<the provider's own host>/cdn-cgi/trace through the tunnel being tested. That is the host the check already talks to, so nobody new is contacted, and the trace never follows a redirect to another host. A provider behind Cloudflare (OpenCode Zen and Anthropic's API among them) answers with the address it saw, the country (loc) and whether the exit is Cloudflare WARP (warp=on); a provider that is not behind Cloudflare publishes no trace, and the row says exit not available rather than guessing. A fetch's sweep runs at tls depth, which promises the provider no request at all, so it never asks. An address of your own choosing keeps working as before and is now read three ways: a trace, JSON (ip, a country under country_code, countryCode or country, a network under asn or org), or plain text kept as it always was. The record gains exit_country, exit_asn, exit_warp and exit_via, each written only when it says something.
- Exit groups. Entries whose last check came out of the same address are grouped on their card ("3 entries share exit 104.28.x.x (NL, WARP)"): the provider sees one address for all of them. Keep one per exit pauses every live entry that shares an exit with an earlier one, removing nothing (Resume brings one back). Adding an offered address whose exit the chain already holds adds it — it is still another tunnel — and says so.
- Where Direct comes out. Where does Direct come out? on a card fetches the same check with no proxy at all, so a VPN app that is on (Proton free, for one) shows as the address Direct really uses. It runs only where that provider's traffic may leave from this computer right now — no chain, a chain with a Direct entry it uses, or every proxy unhealthy with Direct fallback on (7.79.2) — and everywhere else nothing is sent and the card says why. An entry that comes out of the same address as Direct is grouped with it: it does not change the address the provider sees.
Two addresses on one host:port (7.89.0)¶
Every book MCC keeps about an address — reachability, the TLS refusal, cooldowns, speed, exit memory, the request log's Exit — is keyed by its name: your label, or its host:port. Two addresses that differ only in their login (sessions of one gateway, one VPN proxy host with two accounts, Tor's IsolateSOCKSAuth) used to share all of them. Since 7.89.0 such addresses are named host:port#1a2b, a four-character digest of each login — never the login — and only when they would otherwise collide; every other address keeps exactly the name it had. An address a chain uses is only ever renamed by a change to the chains themselves (a feed's offer steps around it), and the save rebuilds every provider whose names it changed. Requests logged before the rename keep the old name. A chain that would hold the same address twice, or two addresses you gave the same label, is refused with a sentence naming both entries; Direct entries never count.
Proxies on this computer (7.89.0)¶
A proxy you already run on this machine — Cloudflare WARP in proxy mode, ssh -D, Tor, gluetun, wireproxy — can go into a chain like any address. Scan this computer (Proxying page) asks 127.0.0.1, and nothing else, on ports 1080, 8888, 9050, 9052, 9150, 25344 and 40000: the SOCKS5 greeting first and, if the port does not speak SOCKS5, an HTTP CONNECT to this computer's own port 9, so a forwarding proxy that tries it stays on the machine. Each port that answers as a proxy is offered as Local SOCKS5 · 127.0.0.1:9050 (the name is a fact; the tool usually behind the port is shown beside it, never stored). Add to chain is the same bulk add a feed's address uses: tested against the provider's own host first, refused if its tunnel breaks certificate validation. A listener that asks for a login gets a username and password box; the login is stored in proxy_sources.json and carried in that address's URL in proxy_chains.json, both written readable by you only (POSIX 0600; on Windows an access list of you, SYSTEM and Administrators with nothing inherited), and is never shown again. A rescan keeps each address's id, so chains and checks follow it; a port that stopped answering is withdrawn from the offers, and a chain that took it keeps it. MCC installs, starts and contacts nothing for this, and scans only when you press the button. The kinds that come next — an account's hosts, a gateway's sessions, a list — slot into the same proxy_sources.json.
Bring your own Tor (7.90.0)¶
A tor you run yourself, on ports you choose — MCC never downloads, installs or starts tor. Under Proxies on this computer → Tor you run yourself give its SOCKS ports (one per identity, two or more) and its control port, and press Save Tor ports. Any free ports work: on some Windows computers 9050, 9052 and 9150 sit inside a range Windows reserves and nothing can listen there (netsh int ipv4 show excludedportrange protocol=tcp lists the ranges). Saving contacts nothing. It offers each SOCKS port as an ordinary socks5h://127.0.0.1:<port> chain address named Tor · 127.0.0.1:<port> — its own name, so every book MCC keeps (reachability, cooldowns, exit memory, the request log's Exit) is per identity — and shows the torrc lines that match what you typed: one SocksPort 127.0.0.1:<port> per port, ControlPort 127.0.0.1:<port>, and CookieAuthentication 1 (or a HashedControlPassword line to fill in with what tor --hash-password prints). Tor keeps streams from separate SocksPort lines on separate circuits. An address already in the catalogue for the same loopback port — typed by hand, or found by Scan this computer — is reused, never doubled.
- Chain entries, not a retry loop. Add the ports to a chain (Add all to chain does every port at once, each tested against the provider's own host first) and tick Keep trying exits until one answers: a 429 or a country refusal on one Tor port moves the same request to the next port at once, and the refusing exit is remembered (7.81.0). A chain with only one entry never switches and never falls back to Direct.
- New Tor identity sends
SIGNAL NEWNYM: new requests on every port get new circuits. A connection already open keeps its exit until it closes (httpx lets an idle one go after five seconds). Tor allows one per 10 seconds; a second press inside that window is refused by MCC with the seconds left, and nothing is sent. MCC never sends one by itself — not after a refusal, not on a timer. - Check Tor logs in and reads
status/circuit-established,status/bootstrap-phaseandnet/listeners/socks, so the card says whether tor has a circuit and which of your ports it really listens on. The reading is kept in memory only. - Logging in. MCC first asks
PROTOCOLINFOwhich logins tor takes and where its cookie file is, then prefersSAFECOOKIE(tor proves it knows the cookie before MCC answers; the cookie never crosses the connection), then plainCOOKIE, or a control password (sent hex-encoded). The cookie file is read only at the moment a button is pressed, only if it is tor's 32 bytes, and is never copied into MCC's files, logs or responses. A control password is kept inproxy_sources.json(owner-only) and never sent back. Both buttons connect to127.0.0.1:<control port>and nowhere else: never through a chain, never to a provider. - Slow circuits. A fresh circuit can take longer than the 10-second default of
PROXY_CONNECT_TIMEOUT_SECONDS; raise it (to 30, say) when your chains use Tor. - The Tor Project asks people not to push heavy or automated traffic through its volunteer exits; the Tor card says so.
VPN accounts, gateways and proxy lists (7.91.0)¶
Three more kinds of source under Proxies on this computer, each yielding ordinary chain addresses offered on its own card — Add to chain / Add all to chain test each against the provider's own host first, as for any address. MCC ships readers, not sources: a preset fills the form with what the vendor documents (host, port, session syntax, a link to the page and the day it was read), you confirm or change every field, and nothing is stored or contacted until you save. Every address has its own name, so its health, cooldowns, exit memory and the request log's Exit are its own, and exit identity (PROXY_CHECK_EXIT_IP_URL=provider) checks it like any other.
- VPN account (
account): hosts × the account's service credential. NordVPN (nl|se|us.socks.nordhold.net:1080, service credentials from Nord Account → Set up NordVPN manually; its SOCKS5 servers are in NL, SE and US only), Private Internet Access (proxy-nl.privateinternetaccess.com:1080, generated SOCKS credentials), IPVanish, TorGuard (host:portfor its other ports). Optionally NordVPN's own server list (its public API, filtered to the SOCKS technology; the preset fills the URL) read by thenordvpn_serversreader: its servers in the countries you keep become addresses. Mullvad (10.64.0.1:1080and<cc>-<city>-wg-socks5-<n>.relays.mullvad.net) and IVPN (10.1.0.1) are reachable only while their app's tunnel is connected, take no login, and the card says so. NordVPN's HTTPS proxy on port 89 is untested with MCC and not offered. - Gateway (
gateway): one host, N sessions, each spelled in the vendor's own syntax with its own session id —brd-customer-<id>-zone-<zone>[-country-<cc>]-session-<id>(Bright Data, SOCKS5 22228 or HTTP 44445),customer-<user>[-cc-<CC>]-sessid-<id>-sesstime-<min>(Oxylabs,pr.oxylabs.io:7777), the password suffix[_country-<cc>]_session-<id>_lifetime-<min>m(IPRoyal,geo.iproyal.com:12321),user-<user>[-country-<cc>]-session-<id>-sessionduration-<min>(Decodo,gate.decodo.com:7000). A session id is a random part and a counter that only goes up for that gateway, so New sessions never hands the vendor an id it used before. Bright Data residential and mobile zones are refused: they need Bright Data's certificate authority installed (TLS interception), which MCC never accepts. - List (
list):ip:port:username:passwordrows (orip:portfor a list authorised by source address), pasted or fetched from your provider's download link — Webshare's free plan first. The link carries the vendor's token, so it is stored as a secret and shown by its host only; each row's login lives only in its address's URL. - Fetching. Only Fetch now or the source's own schedule (off until you choose every 6 h, 24 h or 7 days) fetches, and only the https URL you confirmed — strict TLS, no redirects followed, at most 6 MB read. Name a provider's chain for the fetch and it leaves through the exit that provider's probes would take (its first usable proxy; this computer only where that chain would use it) and sends nothing where the chain refuses; name none and it leaves from this computer, like a feed. Reading the answer and writing the stores happen off the event loop.
- Where the secrets are. A service login, a gateway's password and a list's download link are kept in
proxy_sources.json; every address's URL carries its login inproxy_chains.json; both are written readable by you only. No route, page, log line or label carries a password, a user name, a session password or a download link — the card shows a user name'sfirst4…last4and a link's host. - Tunnel-only VPNs — Proton VPN (free and Plus), Surfshark, ExpressVPN, Windscribe — have no proxy to add. Turn the app on and Direct goes out through it (Where does Direct come out? shows the country); Proton Plus and ExpressVPN can split-tunnel only MCC's program. A VPN that only gives OpenVPN or WireGuard files can run in gluetun, a Docker container you start yourself, whose HTTP proxy is then a chain entry. Step by step, with the exact program to include in a split tunnel: Tutorial: route a provider through a VPN, WARP or Tor.
- No VPN vendor found allows automated API traffic in its terms, and commercial proxies bind you to the use you declared to them: using them for a coding assistant is your call.
WireGuard runners (7.108.0)¶
The last of the five source kinds, runner: a WireGuard file your VPN account exports, which MCC runs through wireproxy (a userspace WireGuard client: no network adapter, no route change, no service, no administrator) and offers as socks5h://<local user>:<local password>@127.0.0.1:<port> — one named chain address (Proton · NL-FREE#12, from the file's # name comment or its file name).
- Import (Import a WireGuard file, or
PUT /admin/api/proxy-sourceswithkind: "runner"and arunnerblock): one[Interface]and exactly one[Peer], every key and address checked. Proton VPN (Free and Plus), Mullvad, IVPN, Surfshark, Windscribe, AirVPN, the file PIA'smanual-connectionsscript writes, andwgcf-profile.conf.PostUp,PreDown,Tableand the otherwg-quicksystem keys are dropped and the card says so; an AmneziaWG file is refused. Importing contacts nothing and starts nothing. - The binary is pinned in source: wireproxy 1.1.3 (
windtf/wireproxy, ISC, released 2026-07-16), one sha256 per platform (Windows x86-64, Linux x86-64 and arm64, macOS x86-64 and arm64). Download wireproxy is the only thing that downloads it: the release'schecksums.txtfirst, which must agree with the pin, then the archive, which must match both; exactly one executable is extracted into~/.mcc/bin/wireproxy/1.1.3/withwireproxy.receipt.jsonbeside it, and both are re-checked at every start. Use my own binary records a path, the version it reports (-v) and its digest; a binary that changed since is refused. There is no Windows arm64 build, and MCC does not fall back to the 32-bit x86 one (Windows Defender flags it).MCC_WIREPROXY_BASE_URLpoints the download at another copy of the release for a test; the digests are still checked against the pin. - The config is written to
~/.mcc/runners/<source>/wireproxy.conf(readable by you only) fromproxy_sources.jsonat every start and deleted with the source:[Socks5] BindAddress = 127.0.0.1:<port>with a random localUsername/Password(no other program here can borrow the tunnel),CheckAlive= the file's own DNS server (the vendor's, inside the tunnel),PersistentKeepalive = 25,ResolveStrategy = auto. - Ports come from
PROXY_RUNNER_PORTS(default41000-41999, Limits & Resilience → Credential health): the SOCKS5 port, the health port (-i 127.0.0.1:<port>,/readyz) and one per in-tunnel exit, chosen once — each must bind on127.0.0.1at that moment — and kept, so the address keeps its URL and name. Pick new ports chooses again. - Running it. Start runs
wireproxy -c <config> -i 127.0.0.1:<health port>with no console window, nothing on stdin, its own process group (Windows) or session (POSIX), and on Windows inside a kill-on-close Job Object, so a server that dies hard takes it along. Its pid and creation time go topid.json; a later start stops a runner an earlier server left only when both still match. Its output goes, redacted (the private key, a preshared key and the local login never), into a cappedrunner.logand the card. Ready means the SOCKS5 port accepts and/readyzanswers 200 — the tunnel is up, not that a provider is reachable (a chain's Test proves that). A started runner starts again with the server; Stop keeps it stopped; the server's shutdown stops every runner, gracefully and then by its exact process tree, each step bounded. - When it exits on its own: the card says
stoppedwith the exit code and a Restart button. Restart automatically after a crash (off by default) restarts it after 1 s, 5 s, 30 s and 5 min, then marks itcrasheduntil you press Start. - Mullvad and IVPN multi-exit: list the vendor's in-tunnel SOCKS5 hosts, one per line, in its documented shape (
<country>-<city>-wg-socks5-<NNN>.relays.mullvad.net:1080,socks5.<server>.gw.ivpn.net:1080); each becomes a[TCPClientTunnel]and an addresssocks5h://127.0.0.1:<port>of its own through the one tunnel. Those ports take no login (the vendor's proxy takes none), so while the runner runs another program here could use them too; the card says so. MCC ships no hostname. - WARP (
wgcf-profile.conf, and optionally thewgcf-account.tomlbeside it, read only to check its key matches — its token and licence are never stored): MCC never registers a device or calls Cloudflare. Test the address with exit identity on and the card shows Cloudflare'swarp=flag. - Not yet verified on a real service: every vendor shape — Proton VPN, Mullvad, IVPN and WARP included — was tested against stand-in servers only (a fake wireproxy and a loopback provider); the one approved Proton try has not been run yet. The card marks each vendor UNVERIFIED. wireproxy has no field for WARP's reserved bytes.
- Where the secrets are: the private key and a preshared key in
proxy_sources.json(awireguardsecret) and the generated config, the local login there and in the address's URL inproxy_chains.json— all readable by you only. No route, page, log line, label or request-log row carries any of them.
Telling whether it worked¶
Two places, both in the request log. Every rung of the ladder in an attempt's modal names the address that try went out through, and each attempt row carries a proxy_label column you can group by. The value is host:port with any user:pass stripped — never the URL, and host:port#1a2b since 7.89.0 when two addresses share a host:port — and the literal direct is a rung you chose, distinct from an empty cell, which means "not measured".
Since 7.88.0 the Analytics requests table shows it too, in the Exit column (where Folder was): the proxy_label of the attempt that answered, +N when the request went out through more exits (every dial below and every attempt's label, in order, in the tooltip), a dash when nothing was recorded. The Exit box in the toolbar filters the page — and its exports — to the requests that went out through an exit whose name contains what you typed.
proxy_label is the address the attempt ended on. Every address it dialled is listed under the attempt, in order, as proxy dials (since 7.45.1): the address, the TCP connect to the proxy and the tunnel handshake after it (the SOCKS5 negotiation or the HTTP CONNECT) when a new connection was opened, what the address answered and how long that took, and what the chain did next:
- switched in N ms: another address followed. The row names the answer that made the chain move on (
429,ConnectTimeout, …) and the time MCC took to move. - answered: the address's last try was answered.
- then N without a switch: the address failed and the chain never moved on while the attempt lasted.
- never completed: the dial began and no try on it ever finished. It is written when the dial starts, so a dial that hangs is still on the record.
A term that was not measured is left out rather than shown as zero: a dial that reused an open connection has no connect time. The same rows are stored as params.ladder.dials on the attempt. The try count and proxy_label do not change.
Two more things worth knowing¶
Direct is a legal entry. "Try my addresses, then fall back to my own IP" has to be expressible, and it is the recommended last rung.
Saving a chain rebuilds that provider, and only that one. The address is read when a provider is constructed, so the save has to republish the provider generation for the chain to route — which resets that provider's credential pool, so its key health on the Providers page reads zeros immediately afterwards. The old numbers were not wrong; the pool they were measured on no longer exists. Since 7.55.0 every other provider keeps the very object it had across the save — its client, its credential pool with its counters and benches, its limiter and its proxy engine — because a chain is read by its own provider alone and saving one chain never rewrites another chain's addresses (an address two chains share is reused under one id). Removing a chain, the last batch of Add all working, and Undo after a bulk add are scoped the same way: an undo rebuilds exactly the providers whose chain it put back. A bulk add you Stop part-way rebuilds the providers its batches wrote; if a stopped run's rebuild is lost (the page was closed), the next chain save of any provider picks those up too. Saving settings, adding or editing a custom provider, and the reasoning-dialect probe still rebuild every provider, as they always did.
Subscription logins are behind an acknowledgement. anthropic_oauth and chatgpt_oauth carry a personal subscription rather than a revocable key, and changing source address between requests is the behaviour most likely to be read as account sharing. Their chain stays inert — in the page and in the runtime — until you say you understand that.
Model catalogue, prices and learned facts¶
Three caches sit behind the model picker, and until 7.32.0 every clock in them was a literal in the module that read it. They are settings now, at exactly the numbers those modules shipped with, on Model Config → Model catalogue & learned facts (and the two price ones on Analytics → Cost estimation, beside the source that fetches them).
Nothing here is on the request path. A refresh that does not land leaves the last good answer in place, and expiry never deletes: an expired learned fact is still loaded, still shown on the Models page marked stale, and simply not applied — so the next real request re-pays one rejection and the row is fresh again.
| Setting | Default | What it does |
|---|---|---|
MODELS_DEV_CACHE_TTL_SECONDS |
86400 |
How long the models.dev catalogue on disk counts as current. Past it the next refresh revalidates with the ETag models.dev served, so an unchanged catalogue costs one conditional request rather than 4.4 MB, and the stale copy is still used while that runs. Lower it to pick up a newly published model sooner; 0 revalidates every pass. Applies without a restart. Range 0–31536000. |
MODELS_DEV_FETCH_TIMEOUT_SECONDS |
10 |
How long one fetch of that catalogue may take before the pass is written off. Raise it on a slow link. Applies without a restart. Range 1–300. |
MODEL_METADATA_OPENROUTER_LIVE |
true |
OpenRouter's own public model list as a metadata rung for every provider (7.84.0): kinds, image input, reasoning and tool support ahead of models.dev's copy where models.dev has no bucket for the provider and only gaps where it does; window, output limit and prices last, gaps only; plus description, knowledge cutoff and the day OpenRouter listed the model. Models page, kind lists and agent catalogues only — routing never reads it. Fetched in the background on the two models.dev clocks above, through the OpenRouter proxy chain. false: no fetch, and nothing differs from before the rung existed. Applies without a restart. |
LITELLM_CACHE_TTL_SECONDS |
86400 |
The freshness clock for LiteLLM's price table, while COST_SOURCE_LITELLM_ENABLED is on. Since 7.97.0 the table is downloaded — in the background after a catalogue sweep, and at once when you turn the source on — whenever ~/.mcc/cache/litellm-prices.json is absent or older than this; past it the next pass revalidates with the ETag, so an unchanged table costs one conditional request. Before 7.97.0 nothing fetched it and the source read the file only if it already existed. With the source off nothing is fetched. Range 0–31536000. |
LITELLM_FETCH_TIMEOUT_SECONDS |
10 |
How long one fetch of that table may take before the pass is written off (the copy on disk keeps pricing). Range 1–300. |
STATED_FACT_TTL_SECONDS |
2592000 (30 d) |
How long a fact the host stated in its own words — an output cap, an effort enum, a tool-name length — stays applicable. Read per fact, so a change applies to the next row rather than to the next restart. Range 60–31536000. |
INFERRED_FACT_TTL_SECONDS |
604800 (7 d) |
The same clock for a refusal nobody stated, proven only by a retry that worked once a field was dropped. Shorter than a stated fact on purpose: a gateway rearranges which of its APIs serves a model far more often than it changes a published ceiling. Read per fact. Range 60–31536000. |
WITHHELD_FACT_TTL_SECONDS |
259200 (72 h) |
How long a model id that went missing from a provider's catalogue stays hidden. The shortest clock here, and deliberately so — a 404 that was really an outage, or a model the vendor has since launched, must not become a permanent hole in your picker. Read per fact. Range 60–31536000. |
DESCRIBE_CONCURRENCY |
3 |
How many pictures of one request describe mode has in flight at once — only VISION_ADAPTER_MODE=describe reads it. Concurrency is what keeps a five-screenshot turn from costing five round trips in series; the bound is what keeps it from opening five upstream connections on a vision provider that meters by concurrency. Applies on Save: the adapter is built per request, so the next one uses it. Range 1–64. |
Saving Settings: Blank Means Unset¶
Pressing Apply writes only what you actually changed. Until 6.1.0 it did the opposite: the first Save of any field materialised every manifest default into ~/.mcc/.env as a real value — and a value on disk outranks a code default forever, so on any install that had pressed Save once, no shipped default could ever change again. FALLBACK_BENCH_ENABLED=false outliving the release that flipped its default to true is the casualty people actually hit — and the same rule cuts the other way now that the default is false again: an install with FALLBACK_BENCH_ENABLED=true written into ~/.mcc/.env keeps benching on until that line is removed.
Now the managed file is the starting point, and an untouched field is written as a commented placeholder that records what it would do:
The rules that follow from that:
- Blank means unset. Clearing a field removes its line and the code default applies again. Every field carries its default underneath it and a Use default button that does exactly that.
- Setting a field to its current default still writes it. That is an explicit choice, and it survives a later change to the shipped default — which is the whole point of the distinction.
- Unless the repo
.envsets the key. Then blanking writesKEY=to mask it where the type accepts an empty string, and Save returns a named warning where it does not — surfaced in the dashboard rather than swallowed. - Booleans are three-state selects —
Default (On)/On/Off— and selects carry an explicitDefault (…)option. Before, an unset select rendered its first option as if you had chosen it, and merely loading the page could save it. - A source chip reads "set here" for a value the managed file owns, so "this is my value" and "this is the shipped default" are never the same pixel.
No migration ran: defaults already materialised in an existing .env are left alone, because a value on disk is effective configuration and silently rewriting it would be the worse bug. Clear them yourself with Use default if you want the shipped default back.
Token Optimizer¶
A dedicated dashboard page — Admin UI → Token Optimizer — reports what MCC kept off the wire, what is keeping it off, and what could keep more off. Every number on it is measured from your own request log. Nothing on the page is enabled for you.
Token Optimizer: 85.3M prompt tokens no provider ever received, and the per-rule counts behind that number.
| Panel | What it shows |
|---|---|
| Ledger | "Tokens never sent" — prompt tokens no provider ever received. Not a bill estimate: what a provider would have charged for the reply is unknowable and is deliberately not guessed at. |
| Local rules | Per-rule fire counts for the rules that answer a request inside the proxy. |
| Candidates | Recurring request families that no rule covers, ranked by tokens actually spent. |
| Cache effectiveness | Prompt-cache hit rates per provider — the largest lever on the page, and not one the optimizer controls. An em dash means the provider never reported the field, which is a different fact from reporting zero. |
The local rules, and how to switch one off. Each answers a request MCC can answer correctly without a provider, and each has its own kill switch — set it to false and that request goes upstream exactly as it did before.
| Rule | What it matches | Env key |
|---|---|---|
| Title generation | Claude Code asking for a short conversation title. | ENABLE_TITLE_GENERATION_SKIP |
| Suggestion mode | A [SUGGESTION MODE: turn, which expects no model output. |
ENABLE_SUGGESTION_MODE_SKIP |
| Model routing probe | An agent harness's startup reachability check: one Say OK user turn, no system text, no tools, not streaming, max_tokens ≤ 32. The reply echoes the model that would have answered — the first model on the route your fallback health registry has not benched — so a proxy silently substituting a different model is still detected. |
ENABLE_PROBE_AUTO_RESPONSE |
Candidates are scanned on demand only. Pressing Scan the log runs a fresh, bounded scan of the request log (GET /admin/api/requests/discover-optimizations). It is never scheduled and never runs on page load, it proposes nothing and changes nothing about how any request is answered, and asked for more rows than its ceiling it returns 422 rather than silently sampling a subset and reporting the result as if it were complete.
The page also reports RTK's measured savings, read from rtk gain --all --format json and served at GET /admin/api/rtk/gain, and tells you when the RTK binary on your machine has drifted from the version MCC pins.
Tool-Result Trimming — Off By Default, And Probably Should Stay Off¶
Claude Code resends the whole conversation every turn, tool results included, so one large file read is paid for again on every later turn. MCC can shorten oversized Read, Grep and Glob results before they reach the model. The controls live on the Token Optimizer page (they were on Limits before 5.48.0).
This is not a recommended optimization, and it is not presented as one. A controlled 24-turn experiment against a prefix-caching model found that at the shipped TOOL_RESULT_TRIM_PROTECT_RECENT_RESULTS=2 trimming costs 10.9% more fresh input tokens than leaving it off entirely. Rewriting bytes in the middle of an already-established prompt invalidates the prefix cache, and the cache is worth more than the bytes removed. Switching it on mid-conversation costs one near-total cache miss — a 3.8% hit rate on that turn. Break-even is a baseline cache hit rate of about 90.9%: below that trimming wins, above it trimming loses, and a healthy provider is usually above it.
The full measured table, including why the cheaper protect_recent_results=0 was not made the default, is in the docstring of core/anthropic/tool_result_trimming.py and in .env.example. Read it there before enabling anything.
What it does not do:
- It does not run unless you turn it on. The master switch
ENABLE_TOOL_RESULT_TRIMMINGdefaults tofalseand all three per-tool rules default tooff; both have to change. - It never touches
Bashresults — client-side compressors already own those, and two layers compressing the same bytes makes neither one's savings attributable. - It never trims silently. Every elision carries an inline marker naming MCC as the actor, stating how much was removed, and telling the model not to describe content it did not see.
- It leaves anything ambiguous byte-for-byte alone — an unmatched or duplicated
tool_use_id, an error result, or any content shape it does not fully understand.
Each rule has three states rather than two, and the middle one is the point:
| Setting | Default | What it does |
|---|---|---|
ENABLE_TOOL_RESULT_TRIMMING |
false |
Master switch. With this off, no rule runs whatever its own state. |
TOOL_RESULT_TRIM_READ / _GREP / _GLOB |
off |
Per-tool state: off, observe, or on. observe measures what the rule would have removed against your real traffic while the bytes on the wire stay exactly as the client sent them — the safe way to find out whether trimming would pay for you. |
TOOL_RESULT_TRIM_THRESHOLD_CHARS |
20000 |
A result smaller than this is never touched. |
TOOL_RESULT_TRIM_KEEP_HEAD_CHARS / _KEEP_TAIL_CHARS |
4000 / 4000 |
How much of the start and end survive the elision. |
TOOL_RESULT_TRIM_PROTECT_RECENT_RESULTS |
2 |
How many of the most recent results are exempt. This is the setting the measurement above is about. |
Measure with observe, check your cache hit rate on the Token Optimizer page against the 90.9% break-even, and only then decide.
Environment variables read at startup¶
Every setting MCC has is on a page. A contract test pins it both ways: each
Settings field has a field in the admin manifest, and each manifest section is
claimed by a page. If you can configure it, you can see it and change it in the
browser — and since 7.24.0 a second contract pins that each one also has a line
in .env.example, so the file and the form can never describe different
installs.
The names below are the exception, and they are an exception for one reason: a dashboard field for any of them would be a field that does nothing. Each is read before there is a settings file to read, or by a different process that never loads the server's settings at all. They are environment variables you set in your shell, your service unit or your CI job.
| Variable | Read by | What it does |
|---|---|---|
MCC_CONFIG_DIR |
every MCC process, first thing | Pins the config directory to an absolute path, overriding ~/.mcc. It decides which .env is read, so it can never be a line inside one. Set it for the mcc-* launchers too, or they will read a different directory than the server does. |
MCC_ENV_FILE |
the server, at load | Names the env file to load instead of the default. Same circularity. |
LOG_FILE |
the server and the CLI, at load | Where a startup failure is written — including a failure that is "the settings would not load". |
MCC_INSTALL_NO_START |
install.ps1 / install.sh / the npm wrapper |
1 installs without stopping or starting any server. The environment form of -NoStart / --no-start. |
MCC_INSTALL_NO_DESKTOP |
the installers | 1 restarts the server as usual but never opens the desktop app. |
MCC_INSTALL_ALLOW_ROOT |
install.sh / the npm wrapper |
1 installs for root even when the run is root through sudo on behalf of another user, which is otherwise refused (7.79.1). The environment form of --allow-root. |
MCC_INSTALL_LOG |
the update helper | Where the in-place update writes its progress. |
MCC_DESKTOP_SKIP_AUTOSTART |
mcc-desktop |
1 starts the tray without starting a server. |
MCC_DESKTOP_SHELL_DIR, MCC_DESKTOP_SHELL_BASE_URL, MCC_DESKTOP_SHELL_TRAY, DESKTOP_SHELL |
the desktop shell | Where the shell lives, what it points at, whether it shows a tray, and whether it is used at all. The shell is a separate binary and never loads the server's settings. |
MCC_SHELL_DESKTOP_COMMAND, MCC_SHELL_SERVER_COMMAND |
the desktop shell | The commands it launches. Packaging and test seams. |
MCC_WIREPROXY_BASE_URL |
the server, on Download wireproxy | Where the pinned wireproxy release is fetched from instead of GitHub — a copy of the release for a test, like MCC_DESKTOP_SHELL_BASE_URL. Its checksums.txt and archive must still match the digests pinned in MCC. |
CLAUDE_CONFIG_DIR, CODEX_HOME, NPM_CONFIG_PREFIX |
MCC, reading | Other programs' own variables. MCC looks at Claude Code's and Codex's configuration; it does not own where they keep it. |
PORT |
mcc-migrate |
Finds the running server before settings are loaded. PORT is also an ordinary setting, on Providers → Runtime, which is what the server itself binds to. |
MCC_OPEN_BROWSER is not in this list even though mcc-desktop reads it
from the environment: it is a real setting, and that read is the process-env
layer of the same setting. /admin/api/config reports it as process when it
is set that way.
A new name cannot be added quietly. tests/contracts/test_every_tunable_is_on_the_dashboard.py
fails on any os.environ read in src/ whose name is neither a Settings
alias nor listed in that file's BOOTSTRAP_ENVIRONMENT, whose entries carry
the reason a dashboard field could not work.



