UNPKG

@awesomate/hosting-mcp

Version:

Awesomate MCP server — lets Claude manage your Awesomate WordPress hosting, plan, limits, n8n automations, and build Node/static apps + databases

68 lines (54 loc) • 3.78 kB
# Multiple accounts on one machine `~/.awesomate/credentials.json` can hold several account **profiles** (one per slug), and each project folder is bound to one via a committable `.awesomate.json` pin (`{"account": "<slug>"}`) written by the bootstrap in the folder it ran in. ## Resolution order `AWESOMATE_PAT` env → `AWESOMATE_ACCOUNT` env → nearest folder pin (walking up, stopping at `$HOME`) → sole profile → `defaultProfile`. A pin naming a missing profile is a **hard error, never a fallback** — that's deliberate. ## Verifying which account is active `awesomate_whoami` reports the connected account and why (`source`: a `.awesomate.json` folder pin, `AWESOMATE_ACCOUNT`, the sole profile, or the default profile). Its `plan` is the hub's (`planSource: "hub"`, one short read the first time in a session); `planSource: "connect"` means the hub couldn't be asked and the plan is the one recorded when this computer connected. Every subsequent tool response is stamped `account: <slug> (source: …)` — treat a mismatch there the same as a wrong whoami result. ## Fixes - **Wrong account connected?** Compare `awesomate_whoami` against the folder's `.awesomate.json`. Fix by editing the pin (if the profile exists) or by running Connect Claude Code from the hub **while logged into the right hub account, from the right folder** — the connect command carries `--account <slug>` and the bootstrap aborts on a mismatch instead of storing anything. - **"Multiple accounts … folder isn't pinned" error?** Create the pin file or set `AWESOMATE_ACCOUNT`. Don't guess an account for the user. - Connecting a second account never disconnects the first; re-pairing an account just refreshes its profile. - **Folder moved to the wrong account by a connect?** The connect printed `! This folder used the account "<old>" before this run` with the command to switch back. With the user's yes, run it from that folder: `npx -y --package=@awesomate/hosting-mcp awesomate-hosting-bootstrap --switch <old>`. It uses the key already saved (no new code), rewrites the pin, and reads the account back from the hub. Then restart, and check `awesomate_whoami`. - Every connect, refresh and switch names `Active Awesomate account here: <slug> (...)` and the other accounts saved, just before its result line (at the end of a refresh). Read that line back to the user. ## Writes need a chosen account The default-profile step is only for reads. When more than one account is connected on the machine, a write tool refuses if the account came from the default profile, naming how to pin. With exactly one account connected there is nothing to choose between, so writes go through. Ask the user which account the change is for; do not choose for them. ## Brands inside one account A brand never chooses the account: the account is chosen first (above), then a brand is looked up inside it. The brand for a call is, in order: the tool's `brand` argument, `AWESOMATE_BRAND`, the pin's `"brand"` (only when the pin chose the account; a pin's brand never follows `AWESOMATE_ACCOUNT` to another account), else none. ```json {"account": "businessblueprint", "brand": "1brain"} ``` - Brand keys are lower-case letters, numbers and hyphens (up to 40). A key that is not one stops the server at start (pin or env) or the call (argument); a key the account does not have is refused by the hub (`brand_unknown`). - With no brand on a multi-brand account, reads cover every brand and a write that needs one (contact add, list join, event, form) is refused (`brand_required`). Ask the user which brand. - An unsubscribe is never refused for its brand. - The stamp reads `account: <slug> (source: pin) · brand: <key>` when a call was made for a brand.