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

# Connecting AI agents (MCP)

> Connect AI applications to the admin interface via the Model Context Protocol (MCP): enter the server URL, log in to the admin interface, and define the agent's permissions.

With the Model Context Protocol (MCP), you can connect an AI application to the admin interface of your shop. The AI agent can then perform functions of the admin interface for you, for example retrieving orders or reading product data. You decide which functions these are yourself when logging in.

Only two steps are required for the connection: First, you enter the address of the shop in your AI application. Then you log in to the admin interface with your user account. Nothing needs to be set up in the shop itself. Your AI application only needs to be able to connect the MCP server via an address (URL) and support login via OAuth. The following sections first describe how the agent's access is controlled and then the connection step by step.

***

## How the agent's access is controlled

An AI agent does not receive its own user account. It always works on behalf of the user account with which you confirm the connection. Two limits apply:

* The agent only receives the permissions that you grant during login. These are the same permissions that also apply to user accounts in the admin interface.
* You can only grant permissions that your own user account has.

The agent only sees the functions for which it has a permission. If, for example, you only grant read permissions for orders, the agent can retrieve orders but cannot change or delete them. Writing functions are then not offered to it at all.

The AI application never gets to see your credentials. The login takes place in the admin interface, and the application then receives an access key with the granted permissions.

> [!WARNING]
>
> Everything the agent changes in the shop happens on behalf of your user account. Therefore, only grant write and delete permissions if the agent actually needs them for its task.

***

## Connecting AI agents

### Step 1: Add the server in the AI application

Add a new MCP server in your AI application. Depending on the application, the corresponding function is called, for example, "Add connector" or "Add MCP server". Enter the following address there:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/mcp
```

Replace `www.<your-shop>.de` with the domain of your shop. You do not need to enter an API key, a client ID, or a password. You can freely choose the name of the server in the application.

### Step 2: Log in to the admin interface

When the connection is established for the first time, the AI application opens a browser window with the admin interface. If you have not yet logged in there, log in with your user account.

The "**Authorize access"** page then appears with the question "Do you want to grant \<application> access to the admin interface?". Under **"Application"** you can see which AI application is requesting access. Check this information before you continue.

### Step 3: Select permissions

Under **Permissions**, the permissions of your user account are listed, grouped by area. Select the permissions that the agent should receive.

* If the AI application has requested specific permissions, these are already preselected. You can change the selection.
* Permissions that your user account does not have are not available for selection.

> [!WARNING]
>
> If your user account is an administrator account, full access is already preselected. This gives the agent all permissions of your account. If the agent should only work with restrictions, deselect full access and select the required permissions individually. Only administrators can grant full access.

### Step 4: Confirm access

Click **"Authorize"** to grant access with the selected permissions. The browser then redirects you back to the AI application. The connection is now established. With **"Deny"** you cancel the process, and the application then does not receive access.

The request on the **"Authorize access"** page is valid for 10 minutes. Confirm it within this time.

***

## If something does not work

| **Problem** | **Cause and solution** |
| - | - |
| The page shows "The authorization request is invalid or has expired." | The request was not confirmed within 10 minutes. Start the login in the AI application again. |
| The agent cannot find a function or reports that it is not available. | The associated permission was not granted. Disconnect in the AI application, reconnect, and select the missing permission. |
| A permission is missing from the selection on the **"Authorize access"** page. | Your user account does not have this permission. Have an administrator assign it to your account, or confirm the connection with an account that has it. |
| The AI application reports an error before the admin interface opens. | Check the entered address. It must end exactly with `/admin/api/v1/mcp` and begin with `https://`. |

***

## Further links

* [API reference OAuth](https://dokumentation.websale.de/en/schnittstellen/admin-interface-api/api-referenz-oauth.md): technical login flow, permissions (scopes), and validity of the access keys.
* [API reference user management](https://dokumentation.websale.de/en/schnittstellen/admin-interface-api/api-referenz-benutzerverwaltung.md): manage user accounts and permissions.
* [Admin Interface API](https://dokumentation.websale.de/en/schnittstellen/admin-interface-api.md): overview of the functions an agent can use depending on its permissions.


## Related topics

- [Changelog](https://dokumentation.websale.de/en/changelog.md)
- [API reference OAuth](https://dokumentation.websale.de/en/schnittstellen/admin-interface-api/api-referenz-oauth.md)
- [Validation and checking services](https://dokumentation.websale.de/en/konfiguration/validierungs-und-prufservices.md)
- [Admin Interface API](https://dokumentation.websale.de/en/schnittstellen/admin-interface-api.md)
- [app - WEBSALE APP](https://dokumentation.websale.de/en/konfiguration/app-websale-app.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.