> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/pentests/configure-a-pentest/setting-up-authenticated-testing/mcp-authentication.md).

# Authenticate with MCP

Authenticate an Aikido Pentest to a remote MCP server with an endpoint URL and a bearer token.

Aikido Pentest signs in to a remote Model Context Protocol (MCP) server with a bearer token. On the **Test Users** step, add an **MCP** test user and provide the endpoint and the token.

## Prerequisites

* The MCP endpoint URL, including the `/mcp` path clients connect to.
* A bearer token that stays valid for the whole assessment.

## Set up MCP authentication

{% stepper %}
{% step %}

### Select Web Application

Go to **Pentests**, open your **Project**, and click **Create Assessment**. On **Select Pentest Target**, select **Web Application**.
{% endstep %}

{% step %}

### Add an MCP test user

In the assessment wizard, on the **Test Users** step, click **Add Test User** → **MCP**.
{% endstep %}

{% step %}

### Enter the endpoint URL

In **URL**, enter the MCP endpoint. Aikido prefills this from the scope URL. End the URL with `/mcp`.

Example: `https://mcp.staging.example.com/mcp`

{% hint style="info" %}
A URL that stops at the host still authenticates. The agent spends extra time discovering the endpoint, so include `/mcp`.
{% endhint %}
{% endstep %}

{% step %}

### Enter the bearer token

In **Bearer Token**, paste the token value. Aikido sends it as `Authorization: Bearer <token>`.

Issue a token that stays valid for the full pentest. 24 hours is a good lifetime, and it is usually the default.

{% hint style="info" %}
This method sends `Authorization: Bearer`. For a different header, use **API Key** on the **Test Users** step.
{% endhint %}
{% endstep %}

{% step %}

### Save and test

Keep the default **Authentication instructions** unless the server needs extra steps. Click **Save & Test**. Aikido initializes the MCP server and checks that the handshake returns a successful result.

<figure><img src="https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-608f1d8d87fce72fc77d02d7efd5f01151db7769%2Fauthenticate-with-mcp.png?alt=media" alt="Authenticate with MCP modal with the endpoint URL filled in and the bearer token field showing its placeholder"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Related

{% content-ref url="/pages/uUQR5iu0AaONPN46BRWs" %}
[Testing MCP Servers](/pentests/configure-a-pentest/testing-mcp-servers.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/pentests/configure-a-pentest/setting-up-authenticated-testing/mcp-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
