agent-login
# agent-login
MCP tools so an agent can sign into a website **without seeing your password**.
You stay in the browser you already use. We open that app with your existing profile (cookies and all) so a fresh Chromium does not force a new login. Tools: `sign_in`, `complete_sign_in`, `browse`, `list_sessions`, `revoke`.
Local only. Not a cloud vault.
## Why this is different: it reuses the browser you're already logged into
Most agent browser tools spin up a **blank Playwright profile**. Blank means no cookies, so every run dumps you back on a login screen — you re-authenticate, re-do 2FA, re-solve the bot check, every single time. The session dies with the process.
agent-login does the opposite. It finds the Chromium-based browsers you actually have (Chrome, Brave, Arc, Edge, Vivaldi, Opera, …), picks the one with the **freshest cookies** — i.e. the browser you were just using — and opens *that real profile*. So:
- **You're usually already logged in.** The sites you have open in your normal browser are open for the agent too. No fresh sign-in.
- **No credentials anywhere near the model.** The password lives in your browser's keychain, not in the chat or the logs.
- **Sessions persist.** Close the chat, come back tomorrow — the profile (and its logins) are still there.
"Freshest cookies" is the whole trick: instead of guessing which browser or making you configure a profile path, it reads the last-modified time on each browser's cookie store and uses the one you're living in. Override any time with `AGENT_LOGIN_BROWSER=chrome|brave|arc|msedge`.
## Install
Needs [Node](https://nodejs.org) (for `npx`). Nothing else — the first run installs its Python runtime by itself.
### Cursor
Add to `~/.cursor/mcp.json` (merge with your existing servers):
```json
{
"mcpServers": {
"agent-login": {
"command": "npx",
"args": ["-y", "github:omdivyatej/agent-login"]
}
}
}
```
Reload MCP / restart Cursor. You should see `sign_in`, `complete_sign_in`, `browse`.
### Claude Code
```bash
claude mcp add agent-login -- npx -y github:omdivyatej/agent-login
```
First launch takes a minute: it installs `uv` (a Python runner) if you don't have it, then fetches the server. After that it's instant.
## Try it
Ask the agent:
> Use agent-login. Sign into https://example.com/login as session `demo`, then tell me what you see.
1. **Quit the browser if it is already running** (one process per profile).
2. We pick the Chromium-based browser you actually use (freshest cookies: Chrome, Brave, Arc, Edge, Vivaldi, Opera, …) and open **that** profile — you should already be logged in.
3. Only sign in if that site still asks. Do not paste the password in chat.
4. Tell the agent you are signed in.
5. It calls `complete_sign_in`, then `browse`. Leave that window alone while the agent works.
Safari (and Firefox) are not in this path — Playwright cannot reuse Safari's profile. If Safari is your only browser, install Chrome/Brave/Edge or set `AGENT_LOGIN_ISOLATED=1` (empty profile, you log in once).
Force a browser with `AGENT_LOGIN_BROWSER=chrome|brave|arc|msedge|…`. Isolated empty profiles: `AGENT_LOGIN_ISOLATED=1`. Attach to a browser started with remote debugging: `AGENT_LOGIN_CDP=http://127.0.0.1:9222`.
## How it is shaped
- **Daemon** on `127.0.0.1:19876` owns Playwright and named profiles.
- **MCP stdio** is a thin client. If the daemon is down, it starts one.
`mcp` is the default command. We open whatever Chromium browser you already live in; we only download Playwright Chromium if none is installed. Sessions live in `~/.agent-login/`. Delete a site with `revoke`, or rm that folder.
## Already have uv?
Skip Node and run the Python entry point directly:
```json
{
"mcpServers": {
"agent-login": {
"command": "uvx",
"args": ["--from", "git+https://github.com/omdivyatej/agent-login", "agent-login"]
}
}
}
```
CLI checks:
```bash
npx -y github:omdivyatej/agent-login status
npx -y github:omdivyatej/agent-login serve
```
## Limits
This is session-sharing with your consent. Sites that bind logins to device/IP (Google, banks, some shops) may reject the headless replay. Device-bound cookies cannot be copied off the machine by design.
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: starting a login flow, completing it, browsing with a session, listing sessions, and revoking them. The sign_in/complete_sign_in pair is sequential rather than overlapping, and their descriptions make the boundary explicit.
All tool names use lowercase snake_case imperative verbs, and the naming pattern is consistent: sign_in, complete_sign_in, browse, list_sessions, revoke. The verb-first style is uniform and predictable.
Five tools is an appropriate size for a login/session management server. Each tool covers a necessary part of the workflow without redundancy or bloat.
The toolset covers the full session lifecycle: create a session, complete login, use the session, list sessions, and revoke sessions. It also handles the LOGIN_REQUIRED retry flow, so there are no obvious dead ends.