autologin-mcp 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -152,7 +152,7 @@ No. It goes from the local credentials file straight into the page, through the
152
152
  No. Bridge mode needs no browser setup. Remote debugging enables CDP mode, which also works when the app's Content-Security-Policy blocks the bridge.
153
153
 
154
154
  **Does it support SSO, 2FA or multi-step logins?**
155
- Not yet: it handles username + password forms on the app's own page. Multi-step logins, iframes, SSO hosts and TOTP are on the roadmap.
155
+ It handles username + password forms on the app's own page, including identifier-first logins that ask for the email and then swap in the password field. Logins that move to another document, iframes, SSO hosts and TOTP are on the roadmap.
156
156
 
157
157
  **Is it free?**
158
158
  Yes, MIT licensed.
@@ -162,7 +162,7 @@ More questions: [FAQ](docs/faq.md).
162
162
  ## Roadmap
163
163
 
164
164
  - [ ] Opt-in auto-login (CDP mode): watch a profile's URL and log in without the agent asking
165
- - [ ] Multi-step logins (username → next → password), iframes, SSO login hosts
165
+ - [ ] Logins that navigate between documents, iframes, SSO login hosts
166
166
  - [ ] TOTP codes
167
167
  - [ ] `doctor` and `test <profile>` commands
168
168
  - [ ] Installers that write the config for Codex CLI, Gemini CLI and Cursor (`print-config` prints it today); a Claude Code plugin
@@ -17,13 +17,75 @@ export async function bridgeLogin(inpage, creds, timing) {
17
17
  };
18
18
  try {
19
19
  const startedAt = Date.now();
20
+ // Same rules as the CDP engine (identifierSettleMs): an identifier step with a Next button counts once it
21
+ // has stayed for the settle time; with a Log in / Sign in button, only after the whole detect time.
22
+ const NAVIGATED_HINT = 'Only the username was sent: the page navigated after the username step. Call login again on the next page; if it asks for single sign-on, a passkey or a code, a human has to finish.';
23
+ const settleMs = Math.min(timing.detectTimeoutMs, Math.max(4 * timing.pollMs, timing.detectTimeoutMs / 2));
24
+ let identifierSince = null;
20
25
  let detected = inpage('detect', { selectors: creds.selectors });
21
- while (!detected.found && !detected.error && Date.now() - startedAt < timing.detectTimeoutMs) {
26
+ for (;;) {
27
+ if (detected.found || detected.error)
28
+ break;
29
+ const now = Date.now();
30
+ if (detected.step === 'identifier') {
31
+ identifierSince ??= now;
32
+ if (detected.nextButton && now - identifierSince >= settleMs)
33
+ break;
34
+ }
35
+ else {
36
+ identifierSince = null;
37
+ }
38
+ if (now - startedAt >= timing.detectTimeoutMs)
39
+ break;
22
40
  await sleep(timing.pollMs);
23
41
  detected = inpage('detect', { selectors: creds.selectors });
24
42
  }
25
- if (!detected.found)
26
- return finish('no_login_form', { hint: detected.error ?? 'No visible password field was found on the page.' });
43
+ if (!detected.found) {
44
+ if (detected.step !== 'identifier' || !detected.hasUsername) {
45
+ return finish('no_login_form', { hint: detected.error ?? 'No visible password field was found on the page.' });
46
+ }
47
+ // Identifier-first login: send the username, then wait for the password step.
48
+ // A message already on the page (say "Your session has expired") is not an answer to the username.
49
+ const beforeStep = inpage('state', { successSelector: creds.successSelector });
50
+ const stepField = document.querySelector(`[${ATTR}="username"]`);
51
+ window.addEventListener('beforeunload', onLeave, { once: true });
52
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(stepField, creds.username);
53
+ stepField.dispatchEvent(new Event('input', { bubbles: true }));
54
+ stepField.dispatchEvent(new Event('change', { bubbles: true }));
55
+ if (inpage('submit', {}) === 'none') {
56
+ for (const type of ['keydown', 'keypress', 'keyup']) {
57
+ stepField.dispatchEvent(new KeyboardEvent(type, { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true, cancelable: true }));
58
+ }
59
+ }
60
+ const stepStart = Date.now();
61
+ let next = inpage('detect', { selectors: creds.selectors });
62
+ while (!next.found) {
63
+ if (leaving)
64
+ return finish('submitted', { reason: 'username_step_navigated', hint: NAVIGATED_HINT });
65
+ const current = inpage('state', { successSelector: creds.successSelector });
66
+ const newError = current.errorText !== null && current.errorText !== beforeStep.errorText;
67
+ if (newError && Date.now() - stepStart >= timing.earlyFailAfterMs)
68
+ return finish('failed', { reason: 'identifier_rejected', hint: scrub(current.errorText) });
69
+ if (Date.now() - stepStart >= timing.detectTimeoutMs) {
70
+ // No password was sent, so this is not a failed login (and does not count toward the rate limit).
71
+ return finish('needs_human', {
72
+ reason: 'password_step_timeout',
73
+ hint: 'The page did not ask for a password after the username step. It may use single sign-on, a passkey or a second factor, so a human has to finish this login.',
74
+ });
75
+ }
76
+ await new Promise((resolve) => {
77
+ const timer = setTimeout(resolve, timing.pollMs);
78
+ wake = () => {
79
+ clearTimeout(timer);
80
+ resolve();
81
+ };
82
+ });
83
+ if (leaving)
84
+ return finish('submitted', { reason: 'username_step_navigated', hint: NAVIGATED_HINT });
85
+ next = inpage('detect', { selectors: creds.selectors });
86
+ }
87
+ detected = next;
88
+ }
27
89
  const before = inpage('state', { successSelector: creds.successSelector });
28
90
  const fill = (role, value) => {
29
91
  const field = document.querySelector(`[${ATTR}="${role}"]`);
@@ -33,7 +33,7 @@ export class BridgeServer {
33
33
  this.ttlMs = options.ttlMs ?? 60_000;
34
34
  this.timing = options.timing ?? BRIDGE_TIMING;
35
35
  this.now = options.now ?? Date.now;
36
- this.reuseWaitMs = options.reuseWaitMs ?? 15_000;
36
+ this.reuseWaitMs = options.reuseWaitMs ?? 25_000;
37
37
  this.releases = new FailureLimiter(options.maxReleases ?? 20, 5 * 60_000, this.now);
38
38
  }
39
39
  /** The first run's result, waiting for it (up to reuseWaitMs) when it is still in progress. */
package/dist/inpage.js CHANGED
@@ -6,6 +6,14 @@ export const FIELD_ATTR = 'data-autologin-mcp';
6
6
  export function autologinInpage(action, arg) {
7
7
  const ATTR = 'data-autologin-mcp';
8
8
  const SUBMIT_TEXT = /^(log ?-?in|sign ?-?in|login|signin|submit|continue|giri[sş]( yap)?|oturum a[cç]|anmelden|connexion|entrar|iniciar sesi[oó]n)$/i;
9
+ // The button that moves an identifier-first page to its password step: Next / Continue, or a
10
+ // Log in / Sign in button (which may also belong to a one-page form still rendering its password field).
11
+ // "Submit" is deliberately absent: a comment or contact form has a username field and a Submit
12
+ // button, and typing a login there is worse than reporting that no login form was found.
13
+ const NEXT_TEXT = /^(continue|next|weiter|suivant|siguiente|continuar|devam( et)?|ileri)$/i;
14
+ const IDENTIFIER_TEXT = /^(log ?-?in|sign ?-?in|login|signin|giri[sş]( yap)?|oturum a[cç]|anmelden|connexion|entrar|iniciar sesi[oó]n)$/i;
15
+ // Field names and ids of login identifiers (Google, Microsoft "loginfmt", Okta "identifier", most in-house forms).
16
+ const LOGIN_FIELD = /^(user(_?name|_?id)?|login(_?(id|name))?|loginfmt|identifier|e-?mail|mail|email_?address|account(_?name)?)$/i;
9
17
  // Most specific first. Labels and field wrappers (e.g. MUI's red "Password *" label) are skipped below.
10
18
  const ERROR_SELECTORS = [
11
19
  '[role="alert"]',
@@ -40,6 +48,8 @@ export function autologinInpage(action, arg) {
40
48
  const tagged = (role) => document.querySelector(`[${ATTR}="${role}"]`);
41
49
  const precedes = (a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;
42
50
  const text = (el) => el.textContent.replace(/\s+/g, ' ').trim();
51
+ /** What a button says: an input's value, or an element's text. */
52
+ const label = (el) => (el instanceof HTMLInputElement ? el.value.trim() : text(el));
43
53
  if (action === 'state') {
44
54
  const findError = () => {
45
55
  // 1. The message an invalid field points to (aria-errormessage / aria-describedby).
@@ -84,7 +94,7 @@ export function autologinInpage(action, arg) {
84
94
  button.click();
85
95
  return 'clicked';
86
96
  }
87
- const form = tagged('password')?.form;
97
+ const form = (tagged('password') ?? tagged('username'))?.form;
88
98
  if (form) {
89
99
  form.requestSubmit();
90
100
  return 'submitted';
@@ -109,8 +119,59 @@ export function autologinInpage(action, arg) {
109
119
  }
110
120
  else {
111
121
  const el = Array.from(document.querySelectorAll('input[type="password"]')).find(usable);
112
- if (!el)
122
+ if (!el) {
123
+ // Identifier-first login: a username step before the password one. Only the heuristic path
124
+ // does this: an explicit password selector means the caller expects that field to exist.
125
+ const textLike = (el) => usable(el) && ['text', 'email', 'tel'].includes(el.type);
126
+ // A login identifier says so: autocomplete="username", or a name / id that is exactly a login word.
127
+ // `type="email"` alone is not enough: invite, share and newsletter fields are email fields too.
128
+ const loginField = (el) => (el.getAttribute('autocomplete') ?? '').toLowerCase().split(/\s+/).includes('username') ||
129
+ [el.name, el.id].some((word) => LOGIN_FIELD.test(word));
130
+ // Controls a person types into or picks from. Hidden fields, checkboxes and buttons do not count.
131
+ const NOT_TYPED = ['hidden', 'checkbox', 'radio', 'submit', 'button', 'image', 'reset'];
132
+ const typedControls = (controls) => controls.filter((el) => (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) &&
133
+ visible(el) &&
134
+ !el.disabled &&
135
+ !(el instanceof HTMLInputElement && NOT_TYPED.includes(el.type))).length;
136
+ const BUTTONS = 'button, [role="button"], input[type="button"], input[type="submit"]';
137
+ // A button after the field that means "continue", and not, say, "Subscribe" or "Invite".
138
+ const continueButton = (buttons, field) => buttons.find((el) => visible(el) && !el.disabled && precedes(field, el) && (NEXT_TEXT.test(label(el)) || IDENTIFIER_TEXT.test(label(el)))) ?? null;
139
+ // A username step is a form, or a small container, whose only typed field is the username: not a signup,
140
+ // checkout or invite form with more fields, and never a button far away (a header "Sign in" next to a
141
+ // footer newsletter field).
142
+ const buttonFor = (field) => {
143
+ if (selectors.submit)
144
+ return find(selectors.submit);
145
+ const form = field.form;
146
+ if (form !== null) {
147
+ // form.elements also holds controls outside the element that point at it with form="…".
148
+ if (typedControls(Array.from(form.elements)) !== 1)
149
+ return null;
150
+ return continueButton([...Array.from(form.querySelectorAll(BUTTONS)), ...Array.from(form.elements)], field);
151
+ }
152
+ let node = field.parentElement;
153
+ for (let depth = 0; depth < 3 && node !== null && node !== document.documentElement; depth += 1, node = node.parentElement) {
154
+ if (typedControls(Array.from(node.querySelectorAll('input, textarea, select'))) !== 1)
155
+ return null;
156
+ const button = continueButton(Array.from(node.querySelectorAll(BUTTONS)), field);
157
+ if (button !== null)
158
+ return button;
159
+ }
160
+ return null;
161
+ };
162
+ const candidates = selectors.username
163
+ ? [find(selectors.username)].filter(textLike)
164
+ : Array.from(document.querySelectorAll('input')).filter((el) => textLike(el) && loginField(el));
165
+ for (const field of candidates) {
166
+ const button = buttonFor(field);
167
+ if (!visible(button))
168
+ continue;
169
+ field.setAttribute(ATTR, 'username');
170
+ button.setAttribute(ATTR, 'submit');
171
+ return { found: false, hasUsername: true, hasSubmit: true, step: 'identifier', nextButton: NEXT_TEXT.test(label(button)) };
172
+ }
113
173
  return { found: false, hasUsername: false, hasSubmit: false };
174
+ }
114
175
  password = el;
115
176
  }
116
177
  let username = null;
@@ -1,5 +1,12 @@
1
1
  import { FIELD_ATTR } from '../inpage.js';
2
+ import { hostOf, matchesUrl } from '../store/match.js';
2
3
  export const DEFAULT_TIMING = { detectTimeoutMs: 5_000, verifyTimeoutMs: 10_000, pollMs: 250, earlyFailAfterMs: 1_500 };
4
+ /**
5
+ * How long an identifier step with a Next / Continue button must stay before the username is sent alone:
6
+ * half the detect time (2.5 s by default), so a one-page form whose password field renders late is not split.
7
+ */
8
+ export const identifierSettleMs = (timing) => Math.min(timing.detectTimeoutMs, Math.max(4 * timing.pollMs, timing.detectTimeoutMs / 2));
9
+ export const PASSWORD_STEP_HINT = 'The page did not ask for a password after the username step. It may use single sign-on, a passkey or a second factor, so a human has to finish this login.';
3
10
  export const realClock = {
4
11
  now: () => Date.now(),
5
12
  sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
@@ -13,14 +20,24 @@ async function attempt(fn) {
13
20
  return null;
14
21
  }
15
22
  }
16
- async function typeInto(page, role, value) {
23
+ /** Types into a tagged field; `beforeInsert` runs between focusing it and typing (the site check). */
24
+ async function typeInto(page, role, value, beforeInsert) {
17
25
  await page.run('clear', { role });
18
26
  const field = await page.element(selectorFor(role));
19
27
  if (field === null)
20
28
  throw new Error(`The ${role} field disappeared before it could be filled.`);
21
29
  await field.focus();
30
+ beforeInsert();
22
31
  await page.insertText(value);
23
32
  }
33
+ /** Thrown when the tab left the profile's site right before something would be typed. */
34
+ class LeftSiteError extends Error {
35
+ result;
36
+ constructor(result) {
37
+ super(result.hint);
38
+ this.result = result;
39
+ }
40
+ }
24
41
  async function submitForm(page, hasSubmit) {
25
42
  if (hasSubmit) {
26
43
  try {
@@ -41,24 +58,92 @@ async function submitForm(page, hasSubmit) {
41
58
  */
42
59
  export async function performLogin(page, profile, timing = DEFAULT_TIMING, clock = realClock) {
43
60
  const base = { profile: profile.name };
61
+ // The tab can leave the profile's site while we wait (a redirect, or the username step sending it to a
62
+ // single sign-on host). Nothing is typed into a page of another site: the site is checked before each
63
+ // step and again right between focusing a field and typing into it.
64
+ const leftSite = () => {
65
+ const url = page.url();
66
+ if (matchesUrl(profile.root, url))
67
+ return null;
68
+ return {
69
+ status: 'needs_human',
70
+ ...base,
71
+ url,
72
+ reason: 'left_profile_site',
73
+ hint: `The login moved to ${hostOf(url)}, which is not part of profile "${profile.name}" (${profile.url}), so nothing was typed there. ` +
74
+ 'If it is single sign-on, a human has to finish this login. If that site belongs to the app, give the profile a root URL that covers it (for example *.example.com).',
75
+ };
76
+ };
77
+ const onSite = () => {
78
+ const away = leftSite();
79
+ if (away !== null)
80
+ throw new LeftSiteError(away);
81
+ };
44
82
  const detect = () => attempt(() => page.run('detect', { selectors: profile.selectors }));
45
83
  const state = () => attempt(() => page.run('state', { successSelector: profile.selectors.success }));
46
84
  const clearPassword = () => attempt(() => page.run('clear', { role: 'password' }));
47
85
  try {
48
86
  const detectStart = clock.now();
87
+ const settleMs = identifierSettleMs(timing);
88
+ let identifierSince = null;
49
89
  let detected = await detect();
50
- while (!detected?.found && !detected?.error && clock.now() - detectStart < timing.detectTimeoutMs) {
90
+ // Wait for a password field. An identifier step (username + Next) counts only once it has stayed for
91
+ // the settle time; with a Log in / Sign in button, only after the whole detect time, since a one-page
92
+ // form may still be rendering its password field.
93
+ for (;;) {
94
+ if (detected?.found || detected?.error)
95
+ break;
96
+ const now = clock.now();
97
+ if (detected?.step === 'identifier') {
98
+ identifierSince ??= now;
99
+ if (detected.nextButton && now - identifierSince >= settleMs)
100
+ break;
101
+ }
102
+ else {
103
+ identifierSince = null;
104
+ }
105
+ if (now - detectStart >= timing.detectTimeoutMs)
106
+ break;
51
107
  await clock.sleep(timing.pollMs);
52
108
  detected = await detect();
53
109
  }
54
110
  if (!detected?.found) {
55
- return { status: 'no_login_form', ...base, url: page.url(), hint: detected?.error ?? 'No visible password field was found on the page.' };
111
+ if (detected?.step !== 'identifier' || !detected.hasUsername) {
112
+ return { status: 'no_login_form', ...base, url: page.url(), hint: detected?.error ?? 'No visible password field was found on the page.' };
113
+ }
114
+ // Identifier-first login: send the username, then wait for the page to ask for the password.
115
+ // A message already on the page (say "Your session has expired") is not an answer to the username.
116
+ onSite();
117
+ const beforeStep = await state();
118
+ await page.bringToFront().catch(() => undefined);
119
+ await typeInto(page, 'username', profile.username, onSite);
120
+ await submitForm(page, detected.hasSubmit);
121
+ const stepStart = clock.now();
122
+ let next = await detect();
123
+ while (!next?.found) {
124
+ onSite(); // a message on a single sign-on host is not a rejection of the username
125
+ const current = await state();
126
+ const newError = current?.errorText != null && current.errorText !== beforeStep?.errorText;
127
+ if (newError && clock.now() - stepStart >= timing.earlyFailAfterMs) {
128
+ return { status: 'failed', ...base, url: page.url(), reason: 'identifier_rejected', hint: current.errorText };
129
+ }
130
+ if (clock.now() - stepStart >= timing.detectTimeoutMs)
131
+ break;
132
+ await clock.sleep(timing.pollMs);
133
+ next = await detect();
134
+ }
135
+ if (!next?.found) {
136
+ // No password was sent, so this is not a failed login (and does not count toward the rate limit).
137
+ return { status: 'needs_human', ...base, url: page.url(), reason: 'password_step_timeout', hint: PASSWORD_STEP_HINT };
138
+ }
139
+ detected = next;
56
140
  }
141
+ onSite();
57
142
  const before = await state();
58
143
  await page.bringToFront().catch(() => undefined);
59
144
  if (detected.hasUsername)
60
- await typeInto(page, 'username', profile.username);
61
- await typeInto(page, 'password', profile.password);
145
+ await typeInto(page, 'username', profile.username, onSite);
146
+ await typeInto(page, 'password', profile.password, onSite);
62
147
  await submitForm(page, detected.hasSubmit);
63
148
  const submittedAt = clock.now();
64
149
  let goneStreak = 0;
@@ -95,6 +180,8 @@ export async function performLogin(page, profile, timing = DEFAULT_TIMING, clock
95
180
  };
96
181
  }
97
182
  catch (error) {
183
+ if (error instanceof LeftSiteError)
184
+ return error.result;
98
185
  await clearPassword();
99
186
  return { status: 'error', ...base, url: page.url(), hint: error instanceof Error ? error.message : String(error) };
100
187
  }
package/dist/results.js CHANGED
@@ -1,6 +1,12 @@
1
1
  /** How long a login outcome counts as "previous" for a later `no_login_form`. */
2
2
  export const RECENT_MS = 5 * 60_000;
3
3
  const WENT_THROUGH = new Set(['success', 'submitted']);
4
+ /**
5
+ * Bridge mode: the page navigated right after the username step of an identifier-first login. That is
6
+ * `submitted`, but not a login that went through: only the username was sent.
7
+ */
8
+ export const USERNAME_STEP_NAVIGATED = 'username_step_navigated';
9
+ const wentThrough = (login) => WENT_THROUGH.has(login.status) && login.reason !== USERNAME_STEP_NAVIGATED;
4
10
  export function alreadyLoggedInHint(previous) {
5
11
  return (`No login form on this page, and the previous login for this profile (${previous.status} at ${previous.at}) went through: ` +
6
12
  'the tab is most likely already logged in. Look at the page and continue; call login again only if it shows a login form.');
@@ -20,13 +26,23 @@ export class ResultLog {
20
26
  * `no_login_form`) when it is recent. An agent whose result was cut off often just logs in again.
21
27
  */
22
28
  noFormContext(profile) {
29
+ const previous = this.recent(profile);
30
+ if (previous === null)
31
+ return null;
32
+ return wentThrough(previous) ? { previous_login: previous, hint: alreadyLoggedInHint(previous) } : { previous_login: previous };
33
+ }
34
+ /** The profile's latest real login outcome (not an earlier `no_login_form`) when it is recent. */
35
+ recent(profile) {
23
36
  const latest = this.latest.get(profile);
24
37
  const previous = latest?.status === 'no_login_form'
25
38
  ? latest.previous_login
26
- : latest && { status: latest.status, at: latest.at, ...(latest.url === undefined ? {} : { url: latest.url }) };
27
- if (previous === undefined || this.now() - Date.parse(previous.at) > RECENT_MS)
28
- return null;
29
- return WENT_THROUGH.has(previous.status) ? { previous_login: previous, hint: alreadyLoggedInHint(previous) } : { previous_login: previous };
39
+ : latest && {
40
+ status: latest.status,
41
+ at: latest.at,
42
+ ...(latest.url === undefined ? {} : { url: latest.url }),
43
+ ...(latest.reason === undefined ? {} : { reason: latest.reason }),
44
+ };
45
+ return previous === undefined || this.now() - Date.parse(previous.at) > RECENT_MS ? null : previous;
30
46
  }
31
47
  record(profile, result, via) {
32
48
  const context = result.status === 'no_login_form' ? this.noFormContext(profile) : null;
@@ -34,6 +50,7 @@ export class ResultLog {
34
50
  const entry = {
35
51
  profile,
36
52
  status: result.status,
53
+ ...(result.reason === undefined ? {} : { reason: result.reason }),
37
54
  ...(hint === undefined ? {} : { hint }),
38
55
  ...(result.url === undefined ? {} : { url: result.url }),
39
56
  ...(context === null ? {} : { previous_login: context.previous_login }),
package/dist/server.js CHANGED
@@ -14,6 +14,7 @@ export const INSTRUCTIONS = [
14
14
  "autologin-mcp signs the browser tab you are testing into its app with credentials that stay on the user's machine; you never see them.",
15
15
  '- When a page under test shows a login form, a "session expired" message, a 401/403, or redirects to a login URL, call `login`, then continue the task. Pass `url` (the tab URL) and, when several accounts exist for the app, `profile`.',
16
16
  `- If \`login\` returns \`run_in_page\`: ${RUN_IN_PAGE_HINT} On \`submitted\`, check the page to confirm you are logged in.`,
17
+ '- On `needs_human`, the page wants something only a person can do (single sign-on, a passkey or a second factor): tell the user the hint and do not retry.',
17
18
  '- `list_profiles` shows which apps (root URLs) and usernames are configured; `login_status` shows the latest login outcome per profile.',
18
19
  '- Never ask the user for a password, never type credentials into a page yourself, never read files under ~/.autologin-mcp, never modify the login script, and do not inspect the login request body in network logs or read password field values.',
19
20
  `- If no profile matches: ${ADD_HINT}`,
package/dist/templates.js CHANGED
@@ -37,6 +37,7 @@ The \`autologin\` MCP server fills the login form for you and only tells you the
37
37
  3. \`success\`: continue the task where you left off. \`submitted\`: the page navigated; take a look to confirm you are logged in.
38
38
  4. \`failed\`: tell the user the \`hint\`; do not retry more than once.
39
39
  \`no_login_form\`: the page has no login form. If it carries \`previous_login\` with \`success\` or \`submitted\`, your earlier login went through: continue the task.
40
+ \`needs_human\`: the page wants something only a person can do (single sign-on, a passkey, a second factor). Tell the user the \`hint\` and wait; do not retry.
40
41
  5. \`no_profile\` / \`origin_mismatch\`: ask the user to run \`npx autologin-mcp add\` in a separate terminal (never in this chat), or call \`mcp__autologin__open_config\` so they can edit the file.
41
42
  6. \`browser_not_connected\` (only with AUTOLOGIN_MODE=cdp): ask the user to enable chrome://inspect/#remote-debugging in Chrome.
42
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autologin-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Auto-login MCP server for AI coding agents (Claude Code, Claude in Chrome, Playwright MCP, chrome-devtools-mcp). Logs your agent into the app under test; credentials stay on your machine and never reach the model.",
5
5
  "type": "module",
6
6
  "bin": {