连接器指南阅读约 8 分钟51 个 MCP 工具7 种语言

如何通过 MCP 将 WorkOS 连接到 Meta Muse

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

HC作者:HelpCode 团队更新于 8 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

WorkOS

WorkOS

WorkOS API for B2B identity: organizations and their domains, AuthKit users, memberships, invitations and sessions, SSO connections, Directory Sync directories, users and groups, Audit Logs exports, the event stream, and RBAC roles and permissions. Can create and update organizations, users, memberships and invitations; deletes and revokes install switched off.

个工具

51

区域

INTL

类别

基础设施

身份验证

Bearer Token

所需环境变量

WORKOS_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 WorkOS,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

试试这样问

WorkOS 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

WorkOS · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → WorkOS、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

WorkOS + Meta Muse

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

WORKOS_API_KEY

步骤 1 — 获取凭证

设置大约需要 2 分钟。

  1. 打开 https://dashboard.workos.com,在顶部栏选择环境(Sandbox 或 Production),然后打开 API Keys。
  2. 创建一个密钥(sk_...,只显示一次),不带空格也不加 Bearer 前缀,粘贴到 WORKOS_API_KEY。
  3. 安装连接器并运行 workos_list_organizations:它会列出该环境的组织并确认密钥可用。

密钥属于单个环境,并拥有该环境 API 的全部权限:WorkOS 密钥没有 scope。先用 Sandbox 密钥开始,只有在 AI 需要处理真实数据时才使用 Production 密钥。

个人数据和敏感数据:该密钥可访问环境中每个组织的身份数据,AI 会读取工具返回的一切:姓名和邮箱地址、登录身份、会话的 IP 地址和 user agent、带职位的目录用户、组织的元数据和 Stripe 客户 id,以及审计日志内容。workos_get_directory_user 和 workos_get_directory_group 会完整返回提供方的原始属性,其中可能包含电话号码、上级、部门和员工编号;列表工具会省略这些属性。AI 只分享任务所需的内容。

机密值:连接器从不返回 API 密钥。邀请的响应中会移除 token 和 accept_invitation_url,因为任何拿到该链接的人都能加入组织。workos_get_audit_log_export 返回一个指向 CSV 的短时有效下载链接(url);AI 会像对待密码一样对待它,不会粘贴到其他地方。

组织和域名:workos_list_organizations(按名称文本或域名筛选)、workos_get_organization、workos_get_organization_by_external_id、workos_create_organization 和 workos_update_organization。workos_create_organization_domain 以待验证状态添加域名,并给出由域名所有者发布的 DNS TXT 记录(verification_prefix、verification_token);之后 workos_verify_organization_domain 启动验证,workos_get_organization_domain 显示状态。

用户、成员关系和角色:workos_list_users(按 email 或 organization_id)、workos_get_user、workos_get_user_by_external_id、workos_create_user(不设密码;本人通过 Magic Auth、社交登录、SSO 或邀请登录)和 workos_update_user;用 workos_list_user_identities 查看登录提供方,用 workos_list_user_sessions 查看会话。成员关系:workos_list_organization_memberships、workos_get_organization_membership、workos_create_organization_membership、用于更改角色的 workos_update_organization_membership,以及用于停用和恢复访问的 workos_deactivate_organization_membership 和 workos_reactivate_organization_membership。角色 slug 来自 workos_list_roles、workos_get_role 和 workos_list_organization_roles(自定义角色以 org- 开头),权限来自 workos_list_permissions。

邀请:workos_list_invitations、workos_get_invitation、workos_send_invitation(邮件由 WorkOS 自己发送)和 workos_resend_invitation。

SSO 和 Directory Sync:workos_list_connections 和 workos_get_connection 显示连接类型和 state(active 表示用户可以登录)。workos_list_directories、workos_get_directory、workos_list_directory_users(需要 directory 或 group)、workos_get_directory_user、workos_list_directory_groups(需要 directory 或 user)和 workos_get_directory_group 读取已同步的用户和群组;workos_sync_directory 会立即把一次同步加入队列。

Audit Logs 和事件:workos_list_audit_log_actions 和 workos_list_audit_log_schemas 显示记录了哪些内容。workos_create_audit_log_export 为某个时间段启动 CSV 导出(不会写入事件),workos_get_audit_log_export 会报告进度,直到 state 变为 ready;workos_get_audit_log_retention 说明事件保留多少天。workos_list_events 按类型(user.created、organization_membership.updated、dsync.user.created、connection.activated 等)并结合 range_start 和 range_end 读取事件流;order: asc 可按发生顺序回放。API 保留 90 天的事件,一次调用最多覆盖 30 天。

更新:workos_update_organization 和 workos_update_user 只修改传入的字段,但 domain_data 和 metadata 会替换已保存的值,因此 AI 会发送完整的列表或对象。修改用户的邮箱会把 email_verified 重置为 false。成员关系的新角色会替换当前角色。

安装时关闭:workos_delete_organization、workos_delete_organization_domain、workos_delete_user、workos_delete_organization_membership、workos_revoke_invitation、workos_revoke_session 和 workos_create_audit_log_event。它们都无法撤销(审计日志事件一旦写入就无法删除),因此由工作区管理员在团队需要时开启。

数据格式:id 带有类型前缀(org_、org_domain_、user_、om_、invitation_、session_、conn_、directory_、directory_user_、directory_group_、audit_log_export_、event_)。时间戳为 UTC 的 ISO 8601 格式。列表以 {"object": "list", "data": [...], "list_metadata": {...}} 的形式返回。metadata 的值都是字符串。

分页:列表默认返回 10 条,用 limit 最多 100 条,按从新到旧排列。获取下一页时,AI 把 list_metadata.after 作为 after 传入,值为 null 时停止;workos_list_events 的分页方式相同。

限制:每个密钥每分钟 6,000 个请求;AuthKit 每 10 秒 1,000 次读取和 500 次写入;目录用户每个目录每秒 4 个请求;删除组织每分钟 50 次。邀请邮件计入 WorkOS 的邮件发送限额。

常见错误:401 表示密钥错误或已撤销。403 表示密钥无权执行此操作,或该环境未启用此功能。404 表示 id 未知,或是另一个环境的 id。400 或 422 表示字段无效,响应正文会指出是哪个字段。429 表示触发速率限制:等待后重试一次。

连接器不配置 SSO 连接、AuthKit 品牌、重定向 URI、Vault、Pipes 或 API 密钥,不设置密码,也从不替任何人登录。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Muse 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Muse 以自定义连接器的形式添加远程 MCP 服务器,并通过 OAuth 登录。

  1. 在 Muse 中打开 Settings → Connectors,选择 Add custom connector。
  2. 粘贴 MCP 服务器 URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。
  3. Muse 会打开 AnythingMCP 的登录页面:登录并批准访问。
  4. 在聊天中,向 Muse 提出需要用到 WorkOS 的工具的请求。

你也可以在聊天中完成设置,适用于网页版、iOS 和 Android 应用以及 WhatsApp。给 Muse 发送这条消息:

Create a Custom Connector for a new remote MCP server, then connect to it:
Name: AnythingMCP
Transport: remote streamable HTTP
URL: https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID
Auth: OAuth

自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Muse 从 Meta 的云端连接,因此 localhost 无法使用。

可用工具

ToolWhat it does
workos_list_organizationsList organizations (the customer companies of this WorkOS environment), newest first: id, name, external_id, domains with their…
workos_get_organizationOne organization by id: name, domains (each with id, state and verification strategy), external_id, stripe_customer_id, metadata and…
workos_get_organization_by_external_idOne organization by the external_id your own application stored on it
workos_create_organizationCreate an organization
workos_update_organizationUpdate an organization: name, domains (domain_data replaces the whole list), external_id, Stripe customer id, metadata or the…
workos_delete_organizationPermanently delete an organization together with its SSO connections and directories
workos_get_organization_domainOne organization domain: domain name, state (pending, verified, failed, legacy_verified), verification strategy (dns or manual), the DNS…
workos_create_organization_domainAdd a domain to an organization
workos_verify_organization_domainStart DNS verification of a pending organization domain after its TXT record was published
workos_delete_organization_domainRemove a domain from its organization
workos_list_usersList AuthKit users of the environment, newest first: id, email, email_verified, first and last name, profile picture URL, external_id…
workos_get_userOne AuthKit user by id: email, verification state, names, external_id, metadata, locale and last sign-in time
workos_get_user_by_external_idOne AuthKit user by the external_id your own application stored on it
workos_create_userCreate an AuthKit user without a password; the person signs in with a method enabled in the environment (Magic Auth, social or SSO) or…
workos_update_userUpdate an AuthKit user: name, email (resets email_verified to false), email_verified, external_id, metadata or locale
workos_delete_userPermanently delete an AuthKit user with their memberships, identities and sessions
workos_list_user_identitiesThe sign-in identities linked to a user: provider (e.g
workos_list_user_sessionsA user's AuthKit sessions, newest first: id, status, auth_method, organization_id, ip_address, user_agent, impersonator, expires_at and…
workos_revoke_sessionEnd one AuthKit session (sign the user out of that device)
workos_list_organization_membershipsList organization memberships (which user belongs to which organization, with role(s) and status active, inactive or pending)
workos_get_organization_membershipOne organization membership: user, organization, role(s), status, whether a directory manages it, and IdP custom attributes
workos_create_organization_membershipAdd an existing AuthKit user to an organization with one role (role_slug) or several (role_slugs)
workos_update_organization_membershipChange the role(s) of an organization membership; the new role replaces the current one
workos_deactivate_organization_membershipDeactivate a membership: the user keeps the account and the membership record but can no longer sign in to that organization
workos_reactivate_organization_membershipReactivate an inactive membership, with its previous role(s)
workos_delete_organization_membershipPermanently remove a user from an organization
workos_list_invitationsList invitations, newest first: email, state (pending, accepted, expired, revoked), organization, role, inviter, expires_at
workos_get_invitationOne invitation by id with its state and expiry, without the token and accept link
workos_send_invitationInvite someone by email, optionally into an organization with a role
workos_resend_invitationSend the email of a pending invitation again, optionally in another language
workos_revoke_invitationRevoke a pending invitation so its link stops working
workos_list_connectionsList SSO connections, newest first: id, name, organization_id, connection_type (OktaSAML, AzureSAML, GoogleOAuth, GenericOIDC, ...), state…
workos_get_connectionOne SSO connection by id: connection type, state, organization and domains
workos_list_directoriesList Directory Sync directories (SCIM, Entra ID, Google Workspace, Okta, BambooHR, ...), newest first: id, name, type, state (linked…
workos_get_directoryOne directory: type, state, organization, domain and user and group counts
workos_sync_directoryAsk WorkOS to sync a directory from its provider now
workos_list_directory_usersList users synced from a directory or a directory group: name, emails, username, job title, state (active, suspended, inactive), role(s)…
workos_get_directory_userOne directory user with everything the provider sent, including raw_attributes (can hold phone numbers, manager, department, employee ids)
workos_list_directory_groupsList groups synced from a directory, or the groups of one directory user: id, name, idp_id. raw_attributes are left out
workos_get_directory_groupOne directory group by id: name, idp_id, directory, organization and the provider's raw_attributes
workos_list_audit_log_actionsList the Audit Logs actions configured in the environment (e.g. user.signed_in, document.updated) with their latest schema
workos_list_audit_log_schemasList the schema versions of one Audit Logs action: allowed target types and the actor, target and metadata JSON schemas
workos_create_audit_log_eventWrite an event into an organization's audit log
workos_create_audit_log_exportStart a CSV export of an organization's audit log events for a time range, optionally filtered by actions, actors and target types
workos_get_audit_log_exportState of an audit log export (pending, ready, error)
workos_get_audit_log_retentionHow many days an organization's audit log events are kept (retention_period_in_days)
workos_list_eventsRead the environment's event stream (what happened in WorkOS and at the connected identity and directory providers): id, event type…
workos_list_rolesList the environment roles (RBAC) with slug, name, description, permissions and type, the roles every organization starts with
workos_get_roleOne environment role by slug: name, description, type and its permission slugs
workos_list_organization_rolesAll roles available in one organization: the environment roles plus its own custom roles (slugs starting with org-), with permissions
workos_list_permissionsList the RBAC permissions defined in the environment: slug, name, description

示例提示

  • “哪些组织的 SSO 连接还没有激活?”
  • “列出组织 Acme Corp 的成员及其角色和状态。”
  • “以 admin 角色邀请 [email protected] 加入组织 Acme Corp。”
  • “哪些目录处于 invalid_credentials 状态,它们属于哪些组织?”
  • “把 Acme Corp 十月份的审计日志导出为 CSV 文件。”

FAQ

Muse 在哪些地区可用? Meta 目前在美国和加拿大提供 Muse,可在网页版、iOS 和 Android 应用以及 WhatsApp 中使用。

Meta 会审核这个连接器吗? 不会。Meta 不审核自定义连接器。Muse 只能看到你在 AnythingMCP 中为此 MCP 服务器启用的工具,你也可以随时在 Settings → Connectors 中断开它。

下一步

这份指南对你有帮助吗?

你的 WorkOS 智能体只差一次点击。

安装连接器,粘贴密钥,向 Meta Muse 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 WorkOS 连接到 ChatGPT

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

连接器

如何通过 MCP 将 WorkOS 连接到 Claude

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

连接器

如何通过 MCP 将 WorkOS 连接到 Cursor

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

连接器

如何通过 MCP 将 WorkOS 连接到 Gemini

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

连接器

WorkOS 接入 MCP:在任意 AI 智能体中管理组织、AuthKit 用户、SSO、Directory Sync、Audit Logs 和 RBAC

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。

连接器

如何通过 MCP 将 WorkOS 连接到 Microsoft Copilot

面向 B2B 身份的 WorkOS API(单个环境):组织及其域名,AuthKit 用户、成员关系、邀请和会话,SSO 连接,Directory Sync 的目录、用户和群组,Audit Logs 导出,事件流,以及 RBAC 角色和权限。可创建和更新组织、用户、成员关系和邀请;删除和撤销在安装时关闭。