> ## 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 Copilot surfaces

* **Copilot Studio**: Microsoft's agent-building tool. The Affinity tool is added to an agent
  by its author and is available to every user of the agent.
* **Copilot CLI**: the GitHub Copilot command-line tool, configured per developer.
* **Copilot in VS Code**: configured per developer (or committed at the workspace level).

The following Copilot 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>

If you're using one of those surfaces, MCP isn't available there yet. Use one of the three
supported surfaces above.

<Note>
  **Microsoft 365 Copilot support is coming soon.** Connecting the Affinity MCP server to Microsoft 365 Copilot (the Copilot in Microsoft 365 apps such as Teams, Outlook, and Word) isn't available yet. In the meantime, use one of the supported surfaces above.
</Note>

## Prerequisites

**Affinity**

* **Plan**: Scale, Advanced, or Enterprise (required for API and MCP access).
* **API key**: Generate one before starting. See
  [Authentication](/pages/mcp/authentication#api-key). We do not currently support OAuth with Copilot.
* **Admin setup**: None required by default. If an Affinity admin has disabled Copilot under
  **Settings → Affinity MCP**, ask them to re-enable it.

**Copilot**

* **Plan**:
  * **Copilot Studio**: A Microsoft Copilot Studio license is required. MCP tools authored in
    Studio inherit the publisher's licensing for end users.
  * **Copilot CLI / VS Code**: An active GitHub Copilot subscription (Individual, Business, or
    Enterprise).
* **Admin setup**:
  * **Copilot Studio**: Only the **agent author** configures the tool. Once added, every user of
    the agent uses Affinity through that single tool definition.
  * **Copilot CLI / VS Code**: Each developer configures their own client. No org admin step is
    required, though a Business / Enterprise admin can centrally manage Copilot policies for the
    org.

Copilot connects to the Affinity hosted MCP server (`https://mcp.affinity.co/mcp`) using
**API key** authentication. We do not currently support OAuth across Copilot surfaces.

<Tip>
  **Get an Affinity API key in 3 steps**: In Affinity, go to **Settings → Manage Apps → API Keys → Create new key**. Copy the key immediately — you won't see it again. Name it something memorable (e.g., "Copilot MCP").
</Tip>

## Setup

<Tabs>
  <Tab title="Copilot Studio">
    Set up in Copilot Studio is performed by the agent author. Once added, the tool is available
    to every user of the agent.

    ### Agent author: add the MCP tool

    1. In Copilot Studio, open your agent and go to the **Tools** page.

    2. Select **Add a tool** → **New tool** → **Model Context Protocol**. The MCP onboarding
       wizard appears.

    3. Fill in the server details. Copilot Studio's agent orchestrator uses the description to
       decide when to route requests to Affinity, so be specific about what the server provides:
       * **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`

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

    5. Select **Create**, then on the **Add tool** dialog select **Create a new connection**.

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

       ```
       Bearer your_api_key_here
       ```

    7. Select **Add to agent** to finish.
  </Tab>

  <Tab title="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.
  </Tab>

  <Tab title="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": []
    }
    ```
  </Tab>
</Tabs>

***

## 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](/pages/mcp/troubleshooting).
