@@ -43,9 +43,18 @@ The base URL must be reachable **from wherever this code runs**:
4343 their own token via an ` Authorization: Bearer <token> ` header (configured on the
4444 MCP client), so ` brainkb_login ` may be unnecessary there. Locally, use
4545 ` brainkb_login(email, password) ` — it scopes the token to that session only.
46+ - ** Recommended: a Personal Access Token (PAT).** The simplest, browser-free way
47+ to authenticate. Log in once, run ` brainkb_create_token(name, days) ` to mint a
48+ ` brainkb_pat_… ` token, and set it as ** ` BRAINKB_TOKEN ` ** in the MCP config (or
49+ pass it once via ` brainkb_use_token(pat) ` ). After that no login/browser is
50+ needed until it expires. A PAT is ** revocable instantly** (` brainkb_revoke_token ` )
51+ and its roles are re-checked live on every use — so a ban/demotion takes effect
52+ at once. Treat it like a password.
4653- ** Never print, echo, or store the password or the JWT token.** Pass them
4754 straight to the login step. When using curl, read the token into a shell
48- variable — do not paste it into chat.
55+ variable — do not paste it into chat. (The one exception is the PAT returned by
56+ ` brainkb_create_token ` , which is shown to the user ** once** so they can copy it
57+ into their config — never re-display it afterward.)
4958- Confirm before mutating actions (creating a space, ingesting, changing
5059 visibility, adding members). Reads are safe.
5160- ** Authorization is role-based, not just JWT** (see the section below). A ` 403 `
@@ -104,6 +113,15 @@ adjust the space's access rules.
104113 The browser sign-in is unavoidable (only the user can consent at the provider),
105114 but the rest stays in the skill. First OAuth login auto-creates/links the
106115 profile + a default ` Curator ` role.
116+ - ** Personal Access Token (PAT) — recommended for repeated use, no browser:**
117+ 1 . Log in once (password or Globus, above).
118+ 2 . ` brainkb_create_token(name="laptop", days=90) ` → returns a ` brainkb_pat_… `
119+ token ** once** . Give it to the user to copy.
120+ 3 . The user sets it as ` BRAINKB_TOKEN ` in the MCP config (or calls
121+ ` brainkb_use_token("<pat>") ` for this session). No login/browser afterward
122+ until it expires.
123+ - Manage: ` brainkb_list_tokens() ` (metadata only), ` brainkb_revoke_token(id) `
124+ (instant). PATs are the cleanest way to avoid re-authenticating every session.
107125
108126### 2. Create / choose a workspace (space)
109127- Individual/private workspace (any write-capable role):
0 commit comments