# Generating a Patchworks MCP key

## Introduction

You will need an *MCP key* to connect any AI assistant to the hosted Patchworks MCP server. This authorises your AI assistant to access and interact with your Patchworks implementation. You can use the same MCP key for multiple AI assistants, or generate one key per assistant - it's entirely up to you.

## The steps

To generate an MCP key, follow the steps below.&#x20;

{% stepper %}
{% step %}
**Access Patchworks API keys**

Select the `settings` option (at the bottom of the navigation menu):

<div align="left"><figure><img src="/files/2CflJsyeX7pwhkBMYz1t" alt=""><figcaption></figcaption></figure></div>

Then select the `API keys` option:

<figure><img src="/files/gqfEbK8rW3q3PMRQsWMk" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Choose which type of key to generate**

Click the `create API key` button:

<figure><img src="/files/8ppYJoYjc3i6UBNc4eHY" alt=""><figcaption></figcaption></figure>

Then click in the `API key type` field and select `MCP key`:

<div align="left"><figure><img src="/files/BspLxaFgOqMAo64VxwrU" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Save the key**

The new key is added to your API keys list, with a `scope` set to `MCP`. For example:

<figure><img src="/files/rfITCla0vTcyNDzly7KB" alt=""><figcaption></figcaption></figure>

Copy/paste this in to your preferred password manager, ready for use later.
{% endstep %}
{% endstepper %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-mcp/patchworks-mcp-hosted/installation-and-setup-patchworks-mcp-hosted/generating-a-patchworks-mcp-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
