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

# Copilot

> Connect Copilot Studio, Copilot CLI, or Copilot in VS Code to the Affinity MCP Server

## Supported surfaces

| Surface | Auth | Notes |
| - | - | - |
| **Copilot Studio** | OAuth (recommended) or API key | OAuth via certified connector; API key via MCP wizard |
| **Copilot CLI** | API key | Configured per developer |
| **Copilot in VS Code** | API key | Configured per developer or at workspace level |

The following surfaces do **not currently support remote MCP servers**:

* Copilot chat on **github.com** and **copilot.com**
* The GitHub **mobile** apps

> [!NOTE]
>
> **Why are those surfaces unsupported?** Remote MCP currently requires HTTP custom-header support, which Copilot chat on github.com / copilot.com and the GitHub mobile apps don't yet expose. Microsoft / GitHub may add this later; check their changelog.

> [!NOTE]
>
> **An Affinity Agent is coming to the Agent Store soon for a more streamlined setup.**

> [!NOTE]
>
> **UI rendering is not yet supported on Copilot surfaces.** Copilot Studio, Copilot CLI, and Copilot in VS Code do not render UI components returned by MCP tools (such as interactive graphs, market maps, or visual outputs). Tool results that include rendered HTML or UI will be returned as plain text or raw data. Use a surface that supports full MCP rendering if your workflow depends on visual tool outputs.

## Prerequisites

**Affinity**

* **Plan**: Scale, Advanced, or Enterprise (required for API and MCP access).
* **Admin setup**: None required by default. If an Affinity admin has disabled Copilot under
  **Settings → Affinity MCP**, ask them to re-enable it.

**Microsoft Copilot Studio**

* **Certified connector**: The Affinity MCP connector is available in the
  [Microsoft Learn connector reference](https://learn.microsoft.com/en-us/connectors/affinitymcp/).
  No manual installation is required — search for **Affinity MCP** directly
  in your Power Platform environment.
* **License**: A Microsoft Copilot Studio license is required. MCP tools authored in
  Studio inherit the publisher's licensing for end users.
* **Microsoft 365 admin access**: Publishing the agent to Microsoft 365 surfaces (Copilot, Teams, Outlook)
  requires a Microsoft 365 admin to approve it in the Microsoft 365 admin center (**Agents → All agents**).
  If you aren't an admin, ask one to approve it. See [Approve the agent](#approve-the-agent-microsoft-365-admin).
* **Classic experience required**: Copilot Studio's new authoring experience has a known bug with certified connectors — use the classic experience instead. See Step 1 in the OAuth setup below.

**GitHub Copilot** (CLI and VS Code)

* An active GitHub Copilot subscription (Individual, Business, or Enterprise).
* An Affinity API key. See [Authentication](https://developer.affinity.co/pages/mcp/authentication.md#api-key).

***

## Copilot Studio — OAuth (Recommended)

The Affinity MCP connector is available as a certified connector in the Microsoft Power Platform
catalog. OAuth authentication is handled via your Affinity account — no API key required.

Setup is performed by the **agent author**. Once added, the tool is available to every user of
the agent.

### Step 1: Open Copilot Studio classic experience

> [!WARNING]
>
> **Known limitation — use the classic experience.** Copilot Studio's new authoring experience has a bug with certified (shared) connectors: adding one returns `OperationRequiresUserDefinedApi`. This affects any certified connector, not just Affinity MCP. Until Microsoft fixes this, use the classic experience instead. To report or track the issue, search the [Microsoft Copilot Studio Community](https://community.powerplatform.com/t5/Microsoft-Copilot-Studio/ct-p/PVAForums) or contact Microsoft Support.

1. Go to [Copilot Studio](https://copilotstudio.microsoft.com) and open the **...** menu at the bottom of the left sidebar.

![Copilot Studio sidebar ... menu showing Open classic experience option](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-menu.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=7c718a27f0a4f0bec41795d463d9a959)

The ... menu in Copilot Studio with Open classic experience highlighted.

2. Select **Open classic experience**.

![Copilot Studio classic experience showing What would you like to build?](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-home.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=af7f6a25389142ac6ecd3426ea1db38f)

The Copilot Studio classic experience home page.

### Step 2: Create an agent

1. Click **Agents** in the left sidebar.

![Copilot Studio classic experience with Agents highlighted in the left sidebar](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-agents.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=4f53c257ade701f6cdf7e36b07f61431)

The Agents section in the Copilot Studio classic experience left sidebar.

2. Click **Create blank agent**.

![Agents page in Copilot Studio classic experience showing Create blank agent button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-create-blank.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=9725e51faad8b20131623afac2b12013)

The Agents page with the Create blank agent button.

3. Give the agent a name and description, then click **Create**. Suggested values:
   * **Name**: `Affinity`
   * **Description**: `Custom agent that connects Affinity to Copilot`

![Copilot Studio classic experience agent overview showing Affinity - agent with status Ready](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-agent-created.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=2c4db0a6c42c79457ac2ff74b57026b7)

The agent overview page after creation, showing the agent is ready.

### Step 3: Add the Affinity MCP tool

1. Click the **Tools** tab in the top navigation.

![Agent overview showing the Tools tab in the top navigation bar](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-tools-tab.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=0e7b2cb318a31fe8234723abdf4ca779)

The agent overview page with the Tools tab in the top navigation.

2. Click **+ Add a tool**.

![Tools tab showing Create your first tool empty state with Add a tool button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-add-tool.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=4d87bf1887a228b1bdd1fb329c9f5dba)

The Tools tab empty state with the Add a tool button.

3. In the tool catalog, search for **Affinity MCP** and select **Invoke MCP Server** under **Model Context Protocol**.

![Add tool dialog showing Affinity MCP search results with Invoke MCP Server under Model Context Protocol](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-classic-search-affinity.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=ae3694bb97ca4f8edc3e3819df15ad7d)

Searching for Affinity MCP in the tool catalog showing Invoke MCP Server under Model Context Protocol.

### Step 4: Select your connection

A **Select a connection** dialog appears showing the Affinity MCP connector.

1. If you already have an active Affinity connection, select it from the dropdown and skip to step 3.
2. If not, click **Create new connection**. You will be redirected to Affinity — sign in with your Affinity credentials, review the requested permissions, and click **Allow**. See [Authentication](https://developer.affinity.co/pages/mcp/authentication.md#oauth-recommended) for details on the consent screen.

![Add tool dialog in Copilot Studio showing Not connected state with Create new connection option](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-select-connection.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=c71659cc5fd07d81794c23bd24dceb47)

The Add tool dialog showing no existing connections and the Create new connection option.

3. After authorizing, you are redirected back to Copilot Studio. The connection appears with a green checkmark. Click **Add** to attach the tool to your agent.

![Add tool dialog showing Affinity - demo - connection with green checkmark and Add button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-add-connected.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=35b3bd2bdbfb113d88fa7f9bb8f3252d)

The Add tool dialog after a successful connection, ready to click Add.

> [!NOTE]
>
> **Keep Credentials set to End user.** After adding the tool, open its settings and confirm **Credentials to use** is set to **End user credentials** (not Maker-provided). This ensures each person who uses the agent signs in with their own Affinity account. If you set it to Maker and publish the agent org-wide, all users will read and write Affinity data as you.

![Copilot Studio tool details showing Credentials to use dropdown with End user credentials selected and Maker-provided credentials as the alternative](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-credentials-end-user.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=e9de16422d0bab4d02e66d3877d64298)

The tool's Additional details panel showing Credentials to use set to End user credentials.

### Step 5: Test your connection

In the **Test your agent** panel, type a prompt such as:

* *who am i?*
* *Find 3 companies I emailed in the last 30 days.*
* *Show me my upcoming meetings.*

If Affinity data comes back, your agent is connected and working.

![Copilot Studio Test your agent panel showing who am i query returning Affinity user data](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-test-agent.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=48ee484764002b052aafd3ae5594f9ca)

The Test your agent panel showing a successful Affinity MCP response.

***

## Publish your Copilot Studio agent to Microsoft 365

Once your agent is built and tested, you can publish it so it appears in Microsoft 365 Copilot
(Teams, Outlook, and the Microsoft 365 app) for you and your organization.

### Step 1: Open the Evaluation tab

Click the **Evaluation** tab in the agent top navigation. Running an evaluation before publishing is recommended — it lets you verify your agent's responses at scale before rolling it out.

![Copilot Studio Evaluation tab with Create a test set button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-evaluation-tab.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=7be380cc6a3f2fcc6f107e51fa82039d)

The Evaluation tab in Copilot Studio showing the option to create a test set.

### Step 2: Create a test set

Click **Create a test set**. The new evaluation page opens with options for data type and data source.

![New evaluation page in Copilot Studio showing Single response data type and data source options](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-new-evaluation.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=4716425ef377d2781e7a67b1a575dc68)

The new evaluation page showing data type and data source options.

### Step 3: Select Quick question set

Under **More ways to start**, click **Quick question set**. Copilot Studio automatically generates 10 questions based on your agent's description and capabilities.

![New evaluation page showing Quick question set option under More ways to start](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-quick-question-set.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=66af2d0d30ab3f4f3aca7b318f4865b3)

The new evaluation page with the Quick question set option highlighted.

### Step 4: Run the evaluation

Review the 10 generated test cases. Give the test set a name (e.g. **Evaluate Affinity - agent**) and click **Run**.

![Review your test cases page showing 10 questions about Affinity CRM with Configure test set panel and Run button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-run-evaluation.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=401c8bd89f6e824a952049e56fcd2eed)

The test case review page showing 10 AI-generated questions and the Run button.

### Step 5: Confirm results and publish

Once the run completes, review the results. Then click **Publish** in the top-right corner of the agent.

![Evaluation results page showing Pass 10/10 with 100% answer quality score and Publish button in top navigation](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-evaluation-results.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=6e64f2ce3f7cbc812cd6c3bf8a5a9143)

The test run results showing 10/10 passing with a 100% answer quality score.

### Submit to your org catalog

After publishing, submit the agent for admin approval so it appears org-wide in Microsoft 365.

#### Step 1: Go to Channels

Click the **Channels** tab in the agent top navigation.

![Copilot Studio Channels tab showing published agent status and Microsoft 365 and Microsoft Teams channel option](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-channels-tab.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=5a730d634e62fa8af6089779dded051a)

The Channels tab showing published agent status and available Microsoft channels.

#### Step 2: Select Microsoft 365 and Microsoft Teams

Click **Microsoft 365 and Microsoft Teams**. A panel opens on the right showing the agent preview and availability options.

![Microsoft 365 and Microsoft Teams channel panel showing agent preview with See agent in Microsoft 365 and See agent in Teams buttons](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-m365-teams-channel.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=b2ba1e62666dc619549bd298b8695656)

The Microsoft 365 and Microsoft Teams channel panel showing the Affinity agent preview.

#### Step 3: Add the channel

Click **Add channel** at the bottom of the panel. A **The channel was added** confirmation appears at the top of the screen.

#### Step 4: Open Availability options

Click **Availability options** in the agent preview card.

![Microsoft 365 and Microsoft Teams channel panel showing the channel was added confirmation and Availability options button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-availability-options.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=004518f83bf421bb14e89e2a4cc23946)

The Microsoft 365 and Microsoft Teams panel after the channel is added, with Availability options highlighted.

#### Step 5: Select Show to everyone in my org

Select **Show to everyone in my org**. This submits the agent for admin approval so it appears in the **Built by your org** section of the Microsoft 365 agent store.

![Availability options panel showing Show to my teammates and shared users and Show to everyone in my org options](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-show-to-org.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=dbf45ca3f4250436dee6b333327281a0)

The Availability options panel showing Show to everyone in my org.

#### Step 6: Submit to org catalog

Review the checklist on the **Show in Teams app store for org** screen, then click **Submit to org catalog**. The submission goes to your Microsoft 365 admin for approval before the agent appears org-wide.

![Show in Teams app store for org dialog showing pre-submission checklist and Submit to org catalog button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-publish-submit-org-catalog.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=52c28801b485bab72822a9632f240460)

The Show in Teams app store for org screen with the Submit to org catalog button.

### Approve the agent (Microsoft 365 admin)

A Microsoft 365 admin must approve the submission before the agent appears org-wide. Go to [admin.cloud.microsoft](https://admin.cloud.microsoft/) and navigate to **Agents → All agents**.

![Microsoft 365 admin center All agents page showing Affinity - agent listed as Available](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-all-agents.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=14d4d4f10e8e1f90d1e89b5f9f6d4f8d)

The All agents page in the Microsoft 365 admin center showing the agent registry.

Click the **Requests** tab. The submitted agent appears with state **Pending review**.

![All agents Requests tab showing Affinity - agent with Pending review status and Publish request type](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-requests-tab.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=5176a943a2c0d71bb3ba51660d5407ec)

The Requests tab showing the Affinity agent submission pending review.

Click the agent row to open its detail panel, then click **Publish to store**.

![Agent detail panel showing Publish to store and Reject submission options with the pending request](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-publish-to-store.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=8e61f075e74e72663e787810091e1369)

The agent detail panel showing the Publish to store action.

In the **Publish agent to selected users** wizard, choose who can install the agent and who will have it pre-installed. Setting both to **All users** makes the agent available to everyone in the tenant — you can also target a specific group to roll it out more narrowly. Click **Next**.

![Publish agent wizard Select users step showing All users selected for both install and pre-install options](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-select-users.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=0feafb4e1ec1b7f7e5823a4b8c4ff234)

The Select users step of the publish wizard with All users selected for install and pre-install.

Proceed through **Apply template** and **Accept permissions**, then review the summary on **Review and finish**.

![Review and finish step showing Affinity - agent published to All users with default policy template](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-review-finish.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=8d629bc5ab4e6fe3d665e6cb81e41906)

The Review and finish step showing the publish summary before confirming.

Click **Publish**. The confirmation screen shows **You published Affinity - agent**.

![You published Affinity - agent confirmation screen showing all steps completed and Done button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-admin-published.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=e48aa230ab02f948878c1a0dd156eba2)

The publish confirmation screen showing the agent was successfully published to all users.

### Verify in Microsoft Teams

#### Step 1: Find and open your agent in Microsoft Teams

Go to [teams.microsoft.com](https://teams.microsoft.com), click **Agents** in the left sidebar, then click **More agents**. Search for **Affinity** (or the name you gave your agent). The agent appears in the results.

![Microsoft Teams More agents search showing Affinity - agent result built using Microsoft Copilot Studio](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-teams-search-affinity.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=3fe6ed17dbb4fed3322fb7655fa56424)

Searching for the Affinity agent in the Microsoft Teams More agents catalog.

Click the agent tile and then click **Open** to start a chat with it.

![Affinity - agent tile in Teams showing Open button, works in Teams and Copilot, and permissions overview](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-teams-agent-tile.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=9d4ecb064c71f140cabe3c21586df5ce)

The Affinity agent tile showing the Open button and permissions overview.

#### Step 2: Test the agent

In the chat, try a prompt such as *who am i?* to confirm the agent is connected to Affinity and returning live data.

![Microsoft Teams chat with Affinity - agent showing profile, organization, and access details in response to who am i](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-teams-chat-response.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=1b93a1afe4de4848072c9347f7c1d25b)

The Affinity agent in Microsoft Teams responding to 'who am i' with profile and organization data from Affinity.

### Verify in Microsoft Copilot

#### Step 1: Open the agent in Microsoft Copilot

Go to [copilot.cloud.microsoft](https://copilot.cloud.microsoft). The approved agent appears under **Agents** in the left sidebar. Click it to open the chat.

![Microsoft Copilot sidebar showing Affinity - agent listed under Agents with a message input field](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-m365copilot-agent.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=d7c73ed976d4aa2c97b4f56f9b217f9d)

Microsoft Copilot showing the Affinity agent in the left sidebar under Agents.

#### Step 2: Test the agent

In the chat, try a prompt such as *who am i?* to confirm the agent is connected to Affinity and returning live data.

![Microsoft Copilot chat with Affinity - agent showing profile, organization, and access details in response to who am i](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-m365copilot-chat-response.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=c90a48d70fe9447df1a48a887e27fb56)

Microsoft Copilot responding to 'who am i' with profile, organization, and access details from Affinity.

***

## Copilot Studio — API Key

Use this path if you prefer not to use the certified connector. Generate an Affinity API key
first — see [Authentication](https://developer.affinity.co/pages/mcp/authentication.md#api-key).

Setup is performed by the **agent author** using Copilot Studio's MCP onboarding wizard.

1. In [Copilot Studio](https://copilotstudio.microsoft.com), open your agent and go to the **Tools** tab.

2. Click **+ Add a tool**, then select **Add new MCP**. The MCP wizard appears.

![Add tool dialog in Copilot Studio showing Add new MCP option highlighted](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-apikey-add-mcp.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=d798a02c5eac11b7f76a68ef43a69864)

The Add tool dialog with the Add new MCP option.

3. Fill in the server details:
   * **Server name**: `Affinity`
   * **Server description**: `Use this server to search, read, create, and update records in the user's Affinity CRM, including companies, people, opportunities, lists, fields, notes, meetings, meeting transcripts, and reminders.`
   * **Server URL**: `https://mcp.affinity.co/mcp`

![MCP server configuration form showing Affinity server name, description, URL, and API key authentication settings](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-apikey-server-form.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=94fd313f96111d85d82b339b6e539d25)

The Add a Model Context Protocol server form filled in with Affinity server details.

4. For **Authentication**, select **API key** and set:
   * **Type**: Header
   * **Header name**: `Authorization`

5. Click **Create**. On the **Add tool** dialog that appears, click **Create new connection**.

![Add tool dialog for Affinity showing Not connected state with Create new connection option](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-apikey-create-connection.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=567ffef9ec9ba3f878ce24e67a1ea936)

The Add tool dialog prompting to create a new connection.

6. When prompted, enter the full bearer token including the `Bearer ` prefix as the API key value:

   ```
   Bearer your_api_key_here
   ```

![Connect to Affinity dialog with display name and API key credential fields](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-apikey-connect-form.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=ef0ba4efaf9d4e4e8fb25acab5f330f8)

The Connect to Affinity dialog prompting for the API key credential.

7. Click **Create**, then click **Add** to finish.

![Add tool dialog showing Affinity custom connection with green checkmark and Add button](https://mintcdn.com/affinityco/PsztO_1y8sPkPH-U/images/copilot-apikey-add-connected.png?fit=max\&auto=format\&n=PsztO_1y8sPkPH-U\&q=85\&s=5efbe1f5dbe9d05c2b429f08d5ab930b)

The Add tool dialog with the connection established and ready to add to the agent.

***

## Copilot CLI

Configure per developer.

1. Once Copilot is started, run **/mcp add** and enter the configuration below:
   * **Server Name**: `affinity-mcp`
   * **Server Type**: HTTP (option 3)
   * **Remote server URL**: `https://mcp.affinity.co/mcp`
   * **HTTP Headers**: `{"Authorization": "Bearer your_api_key_here"}`
   * **Tools**: `*`
2. Press CTRL + S to save. Running **/mcp show** should show the newly added MCP server.

***

## Copilot in VS Code

Configure per developer (or commit to the workspace).

1. Open the Command Palette (CMD/CTRL + Shift + P) and select **MCP: Add Server**.
2. When prompted for type, select **HTTP (HTTP or Server-Sent Events)**.
3. When prompted for a URL, enter `https://mcp.affinity.co/mcp`.
4. When prompted for the name of the server, enter `affinity-mcp`.
5. Open `mcp.json` and add a `headers` section with your API key:

```json theme={null}
{
  "servers": {
    "affinity-mcp": {
      "url": "https://mcp.affinity.co/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer your_api_key_here"
      }
    }
  },
  "inputs": []
}
```

***

## Test your connection

Once configured, try one of these in your Copilot chat:

* *Find 3 companies I emailed in the last 30 days.*
* *Show me my upcoming meetings.*
* *Summarize recent activity on Acme Corp.*

If you get Affinity data, you're set. If not, see [Troubleshooting](https://developer.affinity.co/pages/mcp/troubleshooting.md).


## Related topics

- [Local MCP](https://developer.affinity.co/pages/mcp/local-setup.md)
- [Other Clients](https://developer.affinity.co/pages/mcp/other-clients.md)
- [Troubleshooting](https://developer.affinity.co/pages/mcp/troubleshooting.md)
- [Authentication](https://developer.affinity.co/pages/mcp/authentication.md)
- [Supported Clients](https://developer.affinity.co/pages/mcp/supported-clients.md)


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