> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# End User MCP Server

> Let end users interact with Opal using our end user MCP server.

Opal's End User MCP provides a set of tools that enables end users to leverage AI agents to request access to Opal resources, groups, and bundles . Use cases include:

* Browse available resources, groups, and bundles
* Create access requests for yourself or as part of a workflow
* Check request status and view your current access
* Use in combination with other MCP servers (e.g., request access to Retool, then use Retool's MCP server to query data)

## Installation

First, create an API Token in your Opal environment. Then, select a method and follow the instructions below.

<Info>
  If you run self-hosted, remember to replace [https://app.opal.dev](https://app.opal.dev) to your own
  domain.
</Info>

<Tabs>
  <Tab title="Claude Code">
    To install, run the following command in your shell:

    ```
    claude mcp add --transport http opal-end-user https://app.opal.dev/mcp/end-user --header "Authorization: Bearer ${OPAL_API_TOKEN}" 
    ```

    Then authenticate with Opal.

    ```
    claude /mcp
    ```

    To learn more, see Claude Code [documentation](https://code.claude.com/docs/en/mcp).
  </Tab>

  <Tab title="Cursor">
    To install, add the following to your `~/.cursor/mcp.json` file:

    ```
    {
      "mcpServers": {
        "opal-end-user": {
          "transport": "http",
          "url": "https://app.opal.dev/mcp/end-user",
          "headers": {
            "Authorization": "Bearer ${env:OPAL_API_TOKEN}"
          }
        }
      }
    }
    ```

    Define your `OPAL_API_TOKEN`, and make sure you open Cursor from the same shell.

    ```
    export OPAL_API_TOKEN="secret"
    ```

    ```
    open -a Cursor
    ```

    To learn more, see Cursor [documentation](https://cursor.com/docs/mcp).
  </Tab>

  <Tab title="Gemini CLI">
    To install, add the following to your `~/.gemini/settings.json`

    ```
    {
      "mcpServers": {
        "opal-end-user": {
          "httpUrl": "https://app.opal.dev/mcp/end-user",
          "headers": {
            "Authorization": "Bearer ${OPAL_API_TOKEN}"
          }
        }
      }
    }
    ```

    To learn more, see Gemini [documentation](https://geminicli.com/docs/tools/mcp-server/).
  </Tab>

  <Tab title="Other">
    MCP is an open protocol supported by many other clients, and your specific client documentation can advise you how to connect. Key inputs:

    * Transport `http`
    * Endpoint `https://app.opal.dev/mcp/end-user`
    * Add the header `Authorization: Bearer ${OPAL_API_TOKEN}`.
  </Tab>
</Tabs>

## Available Tools

| Tool                               | Description                                                                                                                               |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `opal_get_resources`               | Returns a list of resources for your organization.                                                                                        |
| `opal_user`                        | Retrieves detailed user information from Opal. This endpoint is designed to fetch user details by either user ID (UUID) or email address. |
| `opal_get_users`                   | Returns a list of users for your organization.                                                                                            |
| `opal_get_resource_nhis`           | Gets the list of non-human identities with access to this resource.                                                                       |
| `opal_create_request`              | Create an access request.                                                                                                                 |
| `opal_get_resource_users`          | Gets the list of users for this resource.                                                                                                 |
| `opal_get_requests`                | Returns a list of requests for your organization that is visible by the admin.                                                            |
| `opal_get_request`                 | Returns a request by ID.                                                                                                                  |
| `opal_get_group_users`             | Gets the list of users for this group.                                                                                                    |
| `opal_get_groups`                  | Returns a list of groups for your organization.                                                                                           |
| `opal_get_group_containing_groups` | Gets the list of groups that the group gives access to.                                                                                   |
| `opal_get_group_resources`         | Gets the list of resources that the group gives access to.                                                                                |
| `opal_get_group`                   | Returns a `Group` object.                                                                                                                 |
| `opal_get_bundle_groups`           | Returns a list of `Group` objects in a given bundle.                                                                                      |
| `opal_get_bundle_resources`        | Returns a list of `Resource` objects in a given bundle.                                                                                   |
| `opal_get_apps`                    | Returns a list of `App` objects.                                                                                                          |
| `opal_get_bundles`                 | Returns a list of `Bundle` objects.                                                                                                       |
| `opal_get_bundle`                  | Returns a `Bundle` object.                                                                                                                |
