okta-auth
This server authenticates to Okta-protected sites and manages stored browser sessions and cookies.
Sign in to a target URL via Okta SSO, including TOTP MFA, and persist the session per domain.
Check whether a stored session for a URL is still valid.
List all stored sessions with metadata such as domain, saved time, and cookie/origin counts.
Delete a stored session for a URL.
Retrieve raw cookies from a stored session, optionally filtered by domain substring.
Use explicit credentials, environment variables, or OS keyring/op-backed credentials for login.
Enable a headed browser for debugging and configure page-load timeouts.
Provides tools for authenticating with Okta, managing sessions, and retrieving cookies for AI agents.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@okta-auth check my Okta session status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
okta-auth
Sign in to Okta apps without a browser.
Give it a URL, your university username, password and TOTP secret. It walks Okta's sign-in over plain HTTP, MFA included, and hands back the cookies the app set. The same fetch-only core runs in Node, Bun, Python and Cloudflare Workers, so a remote MCP server can sign itself in.
Use it as a CLI, a TypeScript or Python library, or the sign-in step of your own Worker.
🦄 Part of unicorn. The sign-in step the live tools share, so none of them needs a browser.
📖 Read the docs: TypeScript · Python
Set up
Ask your agent (Claude Code, Codex, or anything with a terminal):
Install okta-auth-cli from npm, run `okta-auth setup`, then sign me in to https://learning.monash.edu/login/index.php.okta-auth setup opens a page in your browser. It finds your Okta login in 1Password or saves it to the macOS Keychain, then tries a sign-in. Your password never passes through the agent.
Or by hand:
npm install -g okta-auth-cli
okta-auth setup
okta-auth login https://learning.monash.edu/login/index.phpWith Python, uv tool install okta-auth-cli gives you the okta CLI and an okta-auth MCP server instead.
Related MCP server: Agent Identity MCP Server
Use it from
Where | How |
Your terminal and scripts |
|
TypeScript: Node 22+, Bun, Workers |
|
Python 3.11+ |
|
OpenConnect |
|
What it signs in to
Ask your agent | Command |
“Sign me in to Moodle.” |
|
“Give curl my Moodle session.” |
|
“Get me a VPN cookie for OpenConnect.” |
|
“Which sessions do I have?” |
|
“Sign me out of everything.” |
|
It follows whatever Okta Identity Engine and the app ask for:
Apps: SAML apps that redirect or post their request to Okta, Okta app links (the tiles on your Okta dashboard), OIDC apps that Okta redirects back to, and GlobalProtect gateways and portals.
MFA: a TOTP code from Google Authenticator or Okta Verify. It picks the code over push, and can ask 1Password for the code so the secret stays there.
Policies: it skips optional prompts such as a password-expiry warning or an optional new authenticator. When Okta needs a browser instead (an expired password, a required new authenticator, an external identity provider), it says so.
Devices: it keeps Okta's device token, so Okta doesn't see a new device each time. The library can also reuse Okta's session to sign in to a second app without MFA.
Push-only MFA, SMS, email codes, FastPass and Okta Classic Engine orgs are not supported.
Safe by design
It never retries a sign-in by itself. A wrong password stops after one attempt, so it can't lock your account.
Your password only goes to the Okta host that served the sign-in page. Cookies only go to the host that set them.
Errors and logs name hosts and paths only: no passwords, codes, tokens, query strings or cookie values. Tests check this.
No runtime dependencies. The core uses only
fetchand WebCrypto.
Learn more
TypeScript library and CLI: options, results, error codes, GlobalProtect, Workers
Contributing: two packages, one protocol, the same test cases in each
Security: reporting a vulnerability
🦄 Part of unicorn
Live tools answer what is there now; unicorn answers what changed. okta-auth signs them in.
Project | Layer | What it does |
Memory | Remembers your campus sources and tells your agent what changed. Remote MCP. | |
Live | Moodle. CLI, local and remote MCP. | |
Live | Ed Discussion. CLI, local and remote MCP. | |
Live | OnTrack and Doubtfire. CLI only. | |
okta-auth (you are here) | Sign-in | Okta sign-in without a browser. CLI and library for Node, Bun, Python and Workers. |
License
MIT. See LICENSE.
Available Tools
5 toolsokta_check_sessionARead-onlyIdempotent
Verify if a stored session for a URL is still valid.
Launches a headless browser with the stored session cookies, navigates to the URL, and checks whether the session is still authenticated (not redirected to Okta login).
Args: url: URL to verify session against. Must match the URL used during login. timeout_ms: Maximum time in ms to wait for page load (5000-120000, default 30000).
Returns: JSON: {"valid": bool, "domain_key": str|null, "message": str, "url": str}
Inputs: url (required), timeout_ms. Returns: result
okta_delete_sessionADestructiveIdempotent
Delete a stored session for a given URL.
Removes the session file and metadata from ~/.okta-auth/sessions/. The agent will need to re-authenticate to access the service again.
Args: url: URL whose stored session should be deleted.
Returns: JSON: {"deleted": bool, "message": str, "url": str}
Inputs: url (required). Returns: result
okta_get_cookiesARead-onlyIdempotent
Retrieve cookies from a stored session.
Returns the raw cookie data from a stored Playwright session. Useful for making authenticated HTTP requests without launching a browser.
Args: url: URL whose stored session cookies to retrieve. domain_filter: Optional domain substring to filter cookies (e.g., 'okta.com').
Returns: JSON: {"count": int, "cookies": [{name, value, domain, path, ...}], "url": str} Error: {"error": str, "url": str}
Inputs: url (required), domain_filter. Returns: result
okta_list_sessionsARead-onlyIdempotent
List all stored authentication sessions.
Returns metadata for every saved session including the domain, when it was saved, and cookie/origin counts. Does NOT verify if sessions are still valid — use okta_check_session for that.
Returns: JSON: {"count": int, "sessions": [{url, domain_key, saved_at_iso, cookie_count, origin_count}]}
Inputs: no named parameters. Returns: result
okta_loginAIdempotent
Authenticate to a website via Okta SSO and persist the session.
Launches a headless browser, navigates to the target URL, performs Okta login (including TOTP MFA if configured), and saves the browser session for later use. Sessions are stored per-domain in ~/.okta-auth/sessions/.
Credentials are resolved in order: explicit parameter → environment variable
→ OS keyring when the local provider is set to keyring. When the provider
is set to op, launch the server through op run so the environment is
populated at process start.
Args: url: Target URL to authenticate against (e.g., 'https://portal.company.com'). username: Okta username or email. Falls back to OKTA_USERNAME or stored keyring data. password: Okta password. Falls back to OKTA_PASSWORD or stored keyring data. totp_secret: Base32 TOTP secret for automated MFA. Falls back to OKTA_TOTP_SECRET or stored keyring data. headed: Show the browser window during login. Set to true for debugging. timeout_ms: Maximum time in ms to wait for page loads (5000-300000, default 60000).
Returns: JSON: {"success": bool, "domain_key": str|null, "message": str, "url": str}
Inputs: url (required), headed, password, username, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: login, check, list, delete, and get cookies. No overlap or ambiguity.
All tools follow a consistent pattern: okta_ + verb_noun (e.g., check_session, list_sessions). Even login is an action verb, fitting the pattern.
5 tools cover the core operations for Okta session management: create, verify, list, delete, and export cookies. Not too few or too many for the scope.
Covers the main lifecycle: login, check, list, delete, and get cookies. Minor gaps like session refresh or logout are handled implicitly (delete functions as logout), but still a solid set.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP Server for AI agent identity and authorization. Create, verify, and manage agent identities with trust scores and scoped authorization tokens.48 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for managing Okta users (CRUD operations) with full OAuth 2.1 compliance, enabling secure integration with Claude Desktop and other MCP clients.-
- AlicenseNot gradedqualityBmaintenanceMCP server for managing Ory Kratos identities, sessions, and authentication flows, enabling AI assistants to perform identity management tasks via natural language.17 npm1MIT