Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

21.7 KB
Raw Blame
# MCP tool definitions. Tools are opt-in: an operation is exposed only when it has an entry here.
# List operations without an entry: pnpm --filter=@posthog/mcp run scaffold-yaml -- --candidates --product access_control
# Add one: pnpm --filter=@posthog/mcp run scaffold-yaml -- --add <operationId> --product access_control
# To keep an operation off on purpose, set enabled: false and give a disabled_reason.
category: Access control
feature: access_control
url_prefix: /settings/environment-access-control
ui_apps: {}
tools:
    access-control-default-objects-list:
        operation: organizations_projects_access_control_default_objects_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List the project's object-level default rules
        description: >
            Rules on single objects (for example a dashboard, a notebook or a warehouse table) that apply to everyone in
            the project without a rule of their own on that object. Each rule names the object and the level it sets.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
        feature_entitlement: access_control
    access-control-default-properties-list:
        operation: organizations_projects_access_control_default_properties_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List the project's property default rules
        description: >
            Property rules that apply to everyone in the project without a rule of their own on that property: which
            person and event properties are hidden (`none`), read-only (`read`), or open (`read_write`). Every property
            is `read_write` unless a rule says otherwise.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
        feature_entitlement: access_control
    access-control-default-rule-set:
        operation: organizations_projects_access_control_default_rules_update
        enabled: true
        scopes:
            - access_control:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Set or clear the default access rule for a scope
        description: >
            Sets the level everyone in the project gets for one scope when they have no member rule or role rule of
            their own there. Use it to change the project baseline (`resource: project` with the project id as
            `resource_id`, level `none`, `member` or `admin`), the default for a whole tool (`resource: dashboard`,
            level `none`, `viewer`, `editor` or `manager`), one object (add `resource_id`), or one person or event
            property (`resource: property_definition` with the property definition id as `resource_id`, level `none`,
            `read` or `read_write`). A project level of `none` blocks access to the project and its resources. A null
            `access_level` removes the rule, so the scope falls back to its inherited level. An empty result means the
            rule is cleared. Read access-control-defaults-get first and tell the user the current and new level before
            asking for confirmation. Requires human typed confirmation.
        agent_note: >
            A member rule or a role rule on the same scope still wins over this default. Verify the result with
            access-control-defaults-get or access-control-members-list.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            resource:
                description: >
                    The scope: `project`, a tool name such as `dashboard` or `feature_flag`, or `property_definition`.
                    The tool names are the keys of `resource_access_levels` on access-control-defaults-get.
            resource_id:
                description: >
                    The project id for a project rule, the object's id for a rule on one object (a pk, as returned by
                    the object's own get tool), or the property definition id for a property rule. Null only for a rule
                    on a whole tool.
                default: null
            access_level:
                description: >
                    The level to set, within the scope's `minimum` and `maximum` on access-control-defaults-get, or null
                    to remove the rule.
        feature_entitlement: access_control
        confirmed_action:
            message: >
                About to set the default {resource} access rule in project {id} to {access_level}, for object
                {resource_id} (null means the whole tool; a null level clears the rule). A project level of `none`
                blocks access to the project and its resources. Reply 'confirm' to proceed.
            action_label: change the default access rule
    access-control-defaults-get:
        operation: organizations_projects_access_control_defaults_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Get the project's default access
        description: >
            The access everyone in the project gets unless a member or role rule says otherwise: the default project
            level (none, member or admin) and the default level per tool (none, viewer, editor or manager), with the
            lowest and highest level each tool allows. A project level of `none` blocks access to the project and its
            resources. Also lists which tools accept rules on single objects, such as one dashboard or one notebook.
            Start here to understand a project's baseline before checking a member or role.
        agent_note: >
            access-control-members-list or access-control-roles-list show who deviates from this baseline.
            access-control-default-objects-list and access-control-default-properties-list show defaults set on single
            objects or properties.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
        feature_entitlement: access_control
        response:
            exclude:
                - can_edit
    access-control-member-objects-list:
        operation: organizations_projects_access_control_member_objects_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List a member's object-level rules
        description: >
            The rules configured for a member on single objects, for example a dashboard, a notebook or a warehouse
            table they are given access to, or blocked from, regardless of their tool-level access. Only the member's
            own rules are returned. An empty list means the member has no object rules of their own. Their tool-level
            access still applies.
        agent_note: >
            The member's tool-level access and their `role_ids` are on access-control-members-list. Object rules from
            the member's roles are on access-control-role-objects-list, one call per role id.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            member_id:
                description: |
                    The organization membership id, as `organization_membership_id` in access-control-members-list.
        feature_entitlement: access_control
    access-control-member-properties-list:
        operation: organizations_projects_access_control_member_properties_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List a member's property rules
        description: >
            The property rules configured for a member: which person and event properties they cannot see (`none`), can
            only read (`read`), or can read and write (`read_write`). Every property is `read_write` unless a rule says
            otherwise. Only the member's own rules are returned.
        agent_note: >
            Property rules from the member's roles are on access-control-role-properties-list, one call per id in the
            member's `role_ids` from access-control-members-list. Rules for everyone in the project are on
            access-control-default-properties-list.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            member_id:
                description: |
                    The organization membership id, as `organization_membership_id` in access-control-members-list.
        feature_entitlement: access_control
    access-control-member-rule-set:
        operation: organizations_projects_access_control_member_rules_update
        enabled: true
        scopes:
            - access_control:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Set or clear one member's access rule for a scope
        description: >
            Sets the level one organization member gets for one scope. A member rule applies to that person only and
            wins over their role rules and the default. The scope is the project (`resource: project` with the project
            id as `resource_id`, level `none`, `member` or `admin`), a whole tool (`resource: dashboard`, level `none`,
            `viewer`, `editor` or `manager`), one object (add `resource_id`), or one property (`resource:
            property_definition`, level `none`, `read` or `read_write`). A project level of `none` blocks access to the
            project and its resources. A null `access_level` removes the member's rule, so they fall back to their role
            rules or the default. An empty result means the rule is cleared. When several people need the same change,
            prefer a role rule. Read access-control-members-list with `member_id` first and tell the user the current
            and new level before asking for confirmation. Requires human typed confirmation.
        agent_note: >
            Organization admins and owners have full access regardless of rules. Verify the result with
            access-control-members-list and `member_id`.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            member_id:
                description: |
                    The organization membership id, as `organization_membership_id` in access-control-members-list.
            resource:
                description: >
                    The scope: `project`, a tool name such as `dashboard` or `feature_flag`, or `property_definition`.
                    The tool names are the keys of `resources` in access-control-members-list.
            resource_id:
                description: >
                    The project id for a project rule, the object's id for a rule on one object (a pk, as returned by
                    the object's own get tool), or the property definition id for a property rule. Null only for a rule
                    on a whole tool.
                default: null
            access_level:
                description: >
                    The level to set, within the scope's `minimum` and `maximum` on access-control-defaults-get, or null
                    to remove the rule.
        feature_entitlement: access_control
        confirmed_action:
            message: >
                About to set the {resource} access rule for member {member_id} in project {id} to {access_level}, for
                object {resource_id} (null means the whole tool; a null level clears the rule). Reply 'confirm' to
                proceed.
            action_label: change a member's access rule
    access-control-members-list:
        operation: organizations_projects_access_control_members_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: Resolve every member's access in the project
        description: >
            For every organization member, the access enforced in the project: to the project itself and to each tool
            (dashboards, insights, feature flags, and so on). Per entry, `access_level` is the member's own stored rule
            (null when none), `effective_access_level` is what is enforced, and `inherited_access` says where that level
            comes from when it is not the member's own rule: `source_subject` is `role` or `default`, and `source` is
            `org_admin` when the member is an organization admin with full access to everything. Pass `member_id` (an
            `organization_membership_id`, from this tool or org-members-list) for one member. The checking-member-access
            skill explains how the levels combine.
        agent_note: >
            For a question about one object, for example a dashboard or a table, call
            access-control-member-objects-list; for a person or event property, access-control-member-properties-list.
            Rules a role sets on objects or properties are only on the role-objects and role-properties tools. Level
            bounds per tool are on access-control-defaults-get.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            member_id:
                description: |
                    Optional. Narrow the result to one member, by organization membership id.
        feature_entitlement: access_control
        response:
            exclude:
                - project.minimum
                - project.maximum
                - resources.*.minimum
                - resources.*.maximum
    access-control-role-objects-list:
        operation: organizations_projects_access_control_role_objects_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List a role's object-level rules
        description: >
            The rules configured for a role on single objects, for example a dashboard, a notebook or a warehouse table
            the role's members are given access to, or blocked from, regardless of their tool-level access.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            role_id:
                description: |
                    The role id, as `role_id` in access-control-roles-list or an entry of `role_ids` in
                    access-control-members-list.
        feature_entitlement: role_based_access
    access-control-role-properties-list:
        operation: organizations_projects_access_control_role_properties_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List a role's property rules
        description: >
            The property rules configured for a role: which person and event properties the role's members cannot see
            (`none`), can only read (`read`), or can read and write (`read_write`).
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            role_id:
                description: |
                    The role id, as `role_id` in access-control-roles-list or an entry of `role_ids` in
                    access-control-members-list.
        feature_entitlement: role_based_access
    access-control-role-rule-set:
        operation: organizations_projects_access_control_role_rules_update
        enabled: true
        scopes:
            - access_control:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Set or clear one role's access rule for a scope
        description: >
            Sets the level every member of one role gets for one scope. A role rule wins over the default, and a
            member's own rule wins over it. The scope is the project (`resource: project` with the project id as
            `resource_id`, level `none`, `member` or `admin`), a whole tool (`resource: dashboard`, level `none`,
            `viewer`, `editor` or `manager`), one object (add `resource_id`), or one property (`resource:
            property_definition`, level `none`, `read` or `read_write`). A project level of `none` blocks access to the
            project and its resources. A null `access_level` removes the role's rule. An empty result means the rule is
            cleared. Role rules are enforced only on plans with role-based access. Read access-control-roles-list with
            `role_id` first and tell the user the current and new level before asking for confirmation. Requires human
            typed confirmation.
        agent_note: |
            Who is in the role is on role-members-list. Verify the result with access-control-roles-list and `role_id`.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            role_id:
                description: |
                    The role id, as `role_id` in access-control-roles-list or `id` in roles-list.
            resource:
                description: >
                    The scope: `project`, a tool name such as `dashboard` or `feature_flag`, or `property_definition`.
                    The tool names are the keys of `resources` in access-control-roles-list.
            resource_id:
                description: >
                    The project id for a project rule, the object's id for a rule on one object (a pk, as returned by
                    the object's own get tool), or the property definition id for a property rule. Null only for a rule
                    on a whole tool.
                default: null
            access_level:
                description: >
                    The level to set, within the scope's `minimum` and `maximum` on access-control-defaults-get, or null
                    to remove the rule.
        feature_entitlement: role_based_access
        confirmed_action:
            message: >
                About to set the {resource} access rule for role {role_id} in project {id} to {access_level}, for object
                {resource_id} (null means the whole tool; a null level clears the rule). This affects every member of
                the role. Reply 'confirm' to proceed.
            action_label: change a role's access rule
    access-control-roles-list:
        operation: organizations_projects_access_control_roles_retrieve
        enabled: true
        scopes:
            - access_control:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: Resolve every role's access in the project
        description: >
            For every role in the organization, the access it grants in the project: to the project itself and to each
            tool. Per entry, `access_level` is the role's own stored rule, `effective_access_level` is what the role's
            members get from it, and `inherited_access` says where that level comes from when the role has no rule of
            its own. Pass `role_id` for one role.
        agent_note: >
            A member's enforced level already includes their roles, so for a person use access-control-members-list. For
            a role's rules on one object or property, call access-control-role-objects-list or
            access-control-role-properties-list. A member's roles are `role_ids` on access-control-members-list, and
            role-members-list gives who is in a role.
        param_overrides:
            id:
                description: |
                    Project id. If omitted, uses the active project.
                optional: true
                fallback: projectId
            role_id:
                description: |
                    Optional. Narrow the result to one role, by role id.
        feature_entitlement: role_based_access
        response:
            exclude:
                - project.minimum
                - project.maximum
                - resources.*.minimum
                - resources.*.maximum