Install
Get your LinkedIn session cookie into the OS keyring, then point your MCP client at the server.
Get your session cookie
The server never sees your password. It borrows the session your browser already has.
- Log in to linkedin.com as normal
- Open DevTools, ⌥⌘I on macOS, F12 on Windows
- Application → Cookies →
https://www.linkedin.com - Find the row named
li_atand copy its Value
It's a long opaque string, around 200 characters.
This cookie is your account
Anyone holding that string is logged in as you. It survives a password change, and LinkedIn gives you no list of active sessions to revoke. Never paste it into a chat, an issue, or a config file you might commit. If you think it has leaked, log out of LinkedIn everywhere, that is the only thing that invalidates it.
Store it
uvx linkedin-api-mcp authIt prompts, the input is hidden and never echoed, and the value goes into your OS keyring, macOS Keychain, Windows Credential Manager, or Secret Service on Linux. Not a dotfile.
Verify before wiring anything up
uvx linkedin-api-mcp --testThis loads your feed and prints the resolved configuration with the cookie redacted, you'll see "cookie": "<set, 216 chars>", never the value. If it reports
not_authenticated, the cookie is stale: grab a fresh one and re-run auth.
Point your client at it
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"linkedin": {
"command": "uvx",
"args": ["linkedin-api-mcp"]
}
}
}No env block is needed, the cookie is already in the keyring. Restart the client and ask
it something like "what's my LinkedIn headline?" to confirm.
Environment variables
All optional. The cookie belongs in the keyring; the rest tune behaviour.
| Variable | Default | What it does |
|---|---|---|
LINKEDIN_COOKIE | , | Overrides the keyring. Useful for a throwaway or containerised run; skip auth entirely if you set it. |
LINKEDIN_HEADLESS | true | Set to 0 to watch the browser work, useful when a selector breaks. |
LINKEDIN_MIN_INTERVAL | 2 | Seconds between LinkedIn actions. |
LINKEDIN_MAX_PER_HOUR | 120 | Hard ceiling per rolling hour. Past it, calls fail immediately rather than queueing. |
LINKEDIN_NAV_TIMEOUT_MS | 30000 | Page load timeout. |
If something goes wrong
| Error | Means | Do |
|---|---|---|
not_authenticated | LinkedIn redirected to login, the cookie is stale | Get a fresh li_at, re-run auth |
checkpoint | LinkedIn wants a CAPTCHA or verification | Open linkedin.com in your normal browser and complete it. Repeated checkpoints mean LinkedIn has noticed, slow down rather than retrying |
rate_limited | You hit the hourly ceiling | Stop making calls. linkedin_status shows when the next slot frees |
parse_failed | LinkedIn changed its markup | A bug in the server, not you, report it |
missing_browser | Chromium isn't installed | uvx --from linkedin-api-mcp patchright install chromium |