{
  "markdown": "# OneLogin MCP Server\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server providing comprehensive access to the OneLogin API. Enables Claude Desktop, OpenCode, and other MCP clients to manage users, apps, roles, authentication, and security settings.\n\n## Overview\n\nThis server provides tools covering a comprehensive set of supported OneLogin API endpoints:\n\n- **Identity Management**: Users, roles, groups\n- **Applications**: Apps, connectors, SAML, OAuth\n- **Authentication**: MFA, sessions, risk rules\n- **Security**: API authorization\n- **Configuration**: Brands, mappings\n- **Operations**: Events, reports, rate limits\n\nAll tools include comprehensive descriptions with warnings, best practices, and return data specifications.\n\n## Demo\n\nhttps://github.com/user-attachments/assets/512abc44-6bb4-42e4-bb47-c0bc16f29beb\n\n## Installation\n\n### Prerequisites\n\n- OneLogin API credentials (OAuth2 client ID and secret)\n- An AI client such as [OpenCode](https://opencode.ai), [Claude Desktop](https://claude.ai/download), [Copilot CLI](https://github.com/features/copilot/cli/), or [Claude Code](https://www.claude.com/product/claude-code)\n\n### Setup\n\n#### Option 1: Environment Variables (Recommended)\n\nConfigure credentials directly in Claude Desktop config - no separate setup required.\n\nEdit the config file:\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n**Single environment:**\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://mycompany.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"your_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"your_client_secret\"\n      }\n    }\n  }\n}\n```\n\n**Multiple environments** (production/test separation):\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin-prod\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://company.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"prod_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"prod_secret\"\n      }\n    },\n    \"onelogin-test\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://company-test.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"test_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"test_secret\"\n      }\n    }\n  }\n}\n```\n\n**Optional environment variables:**\n- `ONELOGIN_USE_PREPROD`: Set to `\"true\"` for preprod environments\n- `ONELOGIN_LEGACY_KEY`: Legacy API key (rarely needed)\n- `ONELOGIN_SERVER`: Server name for logging (defaults to \"default\")\n\nRestart Claude Desktop completely after configuration.\n\n#### OpenCode Configuration\n\nFor [OpenCode](https://opencode.ai) users, add to `~/.config/opencode/mcp.json`:\n\n**Single environment:**\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://mycompany.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"your_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"your_client_secret\"\n      }\n    }\n  }\n}\n```\n\n**Multiple environments:**\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin-prod\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://company.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"prod_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"prod_secret\"\n      }\n    },\n    \"onelogin-test\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_URL\": \"https://company-test.onelogin.com\",\n        \"ONELOGIN_CLIENT_ID\": \"test_client_id\",\n        \"ONELOGIN_CLIENT_SECRET\": \"test_secret\"\n      }\n    }\n  }\n}\n```\n\nRestart OpenCode after configuration.\n\n#### Option 2: Setup Script (servers.json)\n\nAlternative method using a configuration file:\n\n1. Install the package:\n\n```bash\nnpm install -g @onelogin/onelogin-mcp\n```\n\n2. Configure OneLogin credentials:\n\n```bash\nnpx onelogin-mcp-setup\n```\n\nEnter your OneLogin server details when prompted:\n- Server name (e.g., \"Production\", \"Test\")\n- OneLogin subdomain URL (e.g., `https://mycompany.onelogin.com`)\n- OAuth2 client ID and secret\n\nConfiguration is stored in `~/.config/onelogin-mcp/servers.json`.\n\n3. Add to Claude Desktop config:\n\nEdit the config file:\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n**Single environment:**\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"]\n    }\n  }\n}\n```\n\n**Multiple environments** (reference servers by name):\n\n```json\n{\n  \"mcpServers\": {\n    \"onelogin-prod\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_SERVER\": \"Production\"\n      }\n    },\n    \"onelogin-test\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@onelogin/onelogin-mcp\"],\n      \"env\": {\n        \"ONELOGIN_SERVER\": \"Test\"\n      }\n    }\n  }\n}\n```\n\n4. Restart Claude Desktop completely.\n\n## Usage\n\nUse natural language to interact with OneLogin:\n\n```\nList all users with email ending in @example.com\nGet details for user ID 12345\nCreate a user john.doe@example.com with firstname John, lastname Doe\nAssign roles [123, 456] to user 789\nGenerate MFA token for user 101112\nList all SAML apps\n```\n\nClaude will select the appropriate tool, call the OneLogin API, and present results.\n\n## API Coverage\n\nThis server provides 155 tools organized into 7 major categories:\n\n**Identity & Access** (59 tools)\n- Users (14)\n- Roles (13)\n- Privileges (11)\n- Groups (6)\n- Mappings (15)\n\n**Applications** (18 tools)\n- Apps (15)\n- Connectors (3)\n\n**Authentication** (21 tools)\n- MFA (10)\n- Sessions (5)\n- SAML (2)\n- OAuth Tokens (2)\n- Invite Links (2)\n\n**Security** (40 tools)\n- Policies (7)\n- Risk Rules (6)\n- Smart Hooks (11)\n- API Authorization (16)\n\n**Customization** (6 tools)\n- Brands (6)\n\n**Monitoring** (7 tools)\n- Events (2)\n- Reports (3)\n- Rate Limits (2)\n\n**Account Management** (4 tools)\n- Accounts (4)\n\n## Configuration\n\n### Credential Management\n\nThe server supports two configuration methods:\n\n1. **Environment Variables** (recommended): Set `ONELOGIN_URL`, `ONELOGIN_CLIENT_ID`, and `ONELOGIN_CLIENT_SECRET` in your MCP client config (see Installation above)\n2. **Configuration File**: Use `npx onelogin-mcp-setup` to store credentials in `~/.config/onelogin-mcp/servers.json`\n\nEnvironment variables take precedence over the configuration file. See the Installation section above for complete configuration examples.\n\n### Optional Environment Variables\n\n- `ONELOGIN_USE_PREPROD`: Set to `\"true\"` for preprod environments\n- `ONELOGIN_LEGACY_KEY`: Legacy API key (rarely needed)\n- `ONELOGIN_SERVER`: Server name for logging (defaults to \"default\") or to select a named server from servers.json\n\n## Response Format\n\nAll tools return structured responses:\n\n```json\n{\n  \"success\": true,\n  \"request_id\": \"68F194DE-0A0D05A2-55F8-0A0F6C42-01BB-62EAE-0008\",\n  \"status\": 200,\n  \"data\": {\n    // Tool-specific data\n  }\n}\n```\n\nThe `request_id` matches the `x-request-id` HTTP header for tracing in Datadog and OneLogin logs.\n\n## Troubleshooting\n\n### Server not appearing in Claude Desktop\n\n1. Verify JSON config syntax\n2. Ensure absolute path to `index.js`\n3. Restart Claude Desktop completely (quit and reopen)\n\n### \"spawn bun ENOENT\" error\n\nClaude cannot find the Bun runtime. Solutions:\n\n```bash\n# Verify Bun is installed\nwhich bun\n\n# If not found, install Bun\ncurl -fsSL https://bun.sh/install | bash\n\n# Or use full path in config\n{\n  \"command\": \"/Users/yourname/.bun/bin/bun\",\n  \"args\": [\"run\", \"/path/to/index.js\"]\n}\n```\n\n### Authentication errors\n\n1. If using environment variables: Verify `ONELOGIN_URL`, `ONELOGIN_CLIENT_ID`, and `ONELOGIN_CLIENT_SECRET` in Claude Desktop config\n2. If using servers.json: Verify credentials in `~/.config/onelogin-mcp/servers.json`\n3. Ensure OAuth2 client has API permissions in OneLogin admin panel\n4. Check client_id and client_secret are for API v2\n\n### Wrong environment\n\n**Using environment variables**: Each MCP server entry has its own credentials - verify you're talking to the correct server instance in Claude.\n\n**Using servers.json**: Check the `ONELOGIN_SERVER` environment variable in Claude Desktop config matches a server name in `servers.json`.\n\n## Project Structure\n\n```\nonelogin-mcp/\n├── index.js                    # MCP server entry point\n├── setup.js                    # Interactive credential setup\n├── lib/\n│   ├── config.js               # Credential management\n│   ├── onelogin-api.js         # OAuth2 client with token caching\n│   └── tools/\n│       ├── registry.js         # Tool registry and dispatcher\n│       ├── users.js            # User management (14 tools)\n│       ├── roles.js            # Role management (13 tools)\n│       ├── privileges.js       # Privilege management (11 tools)\n│       ├── apps.js             # App management (15 tools)\n│       ├── mfa.js              # MFA management (10 tools)\n│       ├── mappings.js         # User mappings (15 tools)\n│       ├── smart-hooks.js      # Smart Hooks (11 tools)\n│       ├── policies.js         # Security policies (7 tools)\n│       ├── risk-rules.js       # Risk rules (6 tools)\n│       ├── api-authorization.js # OAuth scopes (16 tools)\n│       ├── sessions.js         # Session tokens (5 tools)\n│       ├── brands.js           # Branding (6 tools)\n│       ├── connectors.js       # App catalog (3 tools)\n│       ├── reports.js          # Analytics (3 tools)\n│       ├── rate-limits.js      # API throttling (2 tools)\n│       ├── saml.js             # SAML assertions (2 tools)\n│       ├── invite-links.js     # Password resets (2 tools)\n│       ├── oauth-tokens.js     # OAuth tokens (2 tools)\n│       ├── events.js           # Audit logs (2 tools)\n│       ├── groups.js           # User groups (6 tools)\n│       └── accounts.js         # Child accounts (4 tools)\n├── package.json\n├── CONTRIBUTING.md\n├── PROGRESS.md\n└── README.md\n```\n\n## Development\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on adding new tools.\n\nKey conventions:\n- Tool descriptions include warnings, best practices, and return data structure\n- All modules export `tools` array and `handlers` object\n- Registry auto-discovers tools from module imports\n\n## Releasing\n\nTo publish a new version to npm:\n\n1. **Merge your changes** to the `main` branch\n\n2. **Create a GitHub Release**:\n   - Go to [Releases](https://github.com/onelogin/onelogin-mcp/releases) → \"Draft a new release\"\n   - Create a new tag with the version (e.g., `v1.1.0`)\n   - Set the release title (e.g., \"v1.1.0 - MFA API fixes\")\n   - Add release notes describing the changes\n   - Click \"Publish release\"\n\n3. **Automatic Publishing**: The GitHub Action will:\n   - Extract the version from the release tag (strips `v` prefix)\n   - Update `package.json` with the new version\n   - Publish to npm under `@onelogin/onelogin-mcp`\n\n**Version Format**: Use semantic versioning (`MAJOR.MINOR.PATCH`)\n- `MAJOR`: Breaking API changes\n- `MINOR`: New features, backward compatible\n- `PATCH`: Bug fixes, backward compatible\n\n**Manual Publishing** (if needed):\n- Go to Actions → \"Publish Package\" → \"Run workflow\"\n- Optionally specify a version override\n\n## Support\n\n- [GitHub Issues](https://github.com/onelogin/onelogin-mcp/issues)\n- [OneLogin API Documentation](https://developers.onelogin.com/api-docs)\n- [Model Context Protocol](https://modelcontextprotocol.io)\n\n## License\n\nMIT\n",
  "bytes": 11615,
  "sha": "8ca7b1eea88f456eaac4ab85e152ca02a521a749ff8cdb31cf35d75459b88a40",
  "repo_slug": "onelogin/onelogin-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_onelogin_onelogin_mcp_adf25a74/readme"
}