# Connect Microsoft Copilot

> Create a Stensul MCP tool in Copilot Studio, attach it to an agent, publish and share the agent in Microsoft 365, and sign in.

Source: https://stensul.com/developers/quickstart/copilot/ · Last reviewed 2026-10-14

> **Not the Stensul admin?**
>
> Your **instance name** is the first part of your Stensul address (`northwind` in `northwind.stensul.com`). The [config generator](https://stensul.com/developers/config/?host=copilot) writes the exact settings and a message you can send your Stensul admin. Don't know who that is, or whether the MCP is turned on for your company? Ask your Stensul customer success manager, or email [help@stensul.com](mailto:help@stensul.com?subject=Stensul%20MCP%20access) from your work address.

Copilot works differently from other hosts. You don't add a single connector: you create a Stensul **tool** in Copilot Studio, attach it to an **agent**, and publish that agent to Microsoft 365.

## Before you start

| Who | What they need |
| --- | --- |
| Stensul admin | Admin access, the external API enabled, and the `access_admin_api_connections` permission (ask your customer success manager). |
| Copilot admin | Microsoft Copilot Studio access with permission to build and publish agents. Stensul's help-center guide (sign-in required) says publishing to the Microsoft 365 channel needs a Copilot Business 365 + Copilot Viral Trial license. Check the license your tenant has with your Microsoft admin. |

## 1. Create the API connection in Stensul

1. Go to **Admin > Settings > API connections** and click **Add connection**.
2. Set **Authorization Type** to **Authorization Code**. Name it, for example `mcp-copilot`.
3. Add the redirect URI: `https://mcp.stensul.com/<your-instance>/oauth/callback`
4. Leave **PKCE off**. Copilot Studio authenticates with a client secret.
5. Select the scopes your team needs. The first four cover drafting. The last three turn on the image gallery and audience versions; a tool whose scope is missing returns a 403. See [scopes](https://stensul.com/developers/authentication/#scopes).
   - `libraries:read`: read libraries
   - `emails:read`: read emails
   - `emails:write`: write emails
   - `images:write`: upload images (labeled **Write images**)
   - `dam:read`: browse the image gallery (labeled **Read Dam images**)
   - `dynamic-content:read`: read segment sets
   - `dynamic-content:write`: apply segment sets and write segment content

   The list shows other scopes too, such as `capabilities:read`, `modules:write`, `users:read` and `roles:read`. Leave them unchecked: the MCP doesn't use them.
6. Save. Copy the **Client ID** and the **Client Secret** right away. The secret is shown once.

## 2. Add the Stensul tool in Copilot Studio

You create the tool first and attach it to an agent in step 3.

1. Go to **Tools > Add a tool > New tool > MCP**.
2. Set **Authentication** to **OAuth 2.0 – Manual**.
3. Fill in:

| Field | Value |
| --- | --- |
| MCP Server URL | `https://mcp.stensul.com/<your-instance>/mcp` |
| Client ID | From step 1 |
| Client Secret | From step 1 |
| Auth URL | `https://mcp.stensul.com/<your-instance>/oauth/authorize` |
| Token URL | `https://mcp.stensul.com/<your-instance>/oauth/token` |
| Refresh URL | `https://mcp.stensul.com/<your-instance>/oauth/token` |

4. Save the tool and create a new connection when prompted.

## 3. Create the agent

1. Go to **Agent > Create blank agent**.
2. Name it, for example "Stensul Email Assistant". Stensul's guide recommends a Claude model for the agent, for better results.
3. Paste the recommended instructions below into **Instructions**.
4. Under **Tools**, add the Stensul MCP tool from step 2 (filter by "model context protocol").

<details>

<summary>Recommended agent instructions (short version)</summary>

```text
You help people create, copy, browse and edit marketing emails in Stensul
through the Stensul MCP tools.
- Work within the library's templates, guardrails and locked content. Never try
  to override a locked element or a rejected change; report it instead.
- Proceed on your own by default. Ask only when two libraries or templates fit
  equally well, when nothing suitable exists, or when a step fails.
- On a 401 or 403, check sign-in again and give the user a fresh sign-in link.
- Show the edit link at the end, with a short summary of what you changed and
  what you could not change.
- Always read the description and resources to understand how to use the
  tools.
```

This condenses the full instructions in Stensul's help-center Copilot guide, which customers can read after signing in. Adjust tone to your team.

</details>

## 4. Publish and share in Microsoft 365

1. You can test first in Copilot Studio. On the first interaction, reconnect the tool: **Open connection manager > Connect > Submit**, sign in to Stensul, then retry.
2. Publish the agent.
3. Go to **Channels > Microsoft 365**, add the agent, and click **See agent on Microsoft 365**. The option can take a few minutes to appear.
4. **Share the agent with your organization.** Your team can't use the agent until you share it. Share it with the people or groups who will use Stensul from Copilot.

## 5. Sign in and draft an email

Each person opens the published Stensul agent in Copilot. On the first message, choose **Open connection manager**, connect, and approve the Stensul sign-in. Then:

```text
Create a draft newsletter in the <library name> library about our spring webinar.
Three short sections, one registration button linking to https://example.com/webinar.
Give me the edit link when it's done.
```

You're done when the agent returns an edit link that opens the draft in Stensul. In Copilot, the preview opens through that link rather than inside the chat.

## If something goes wrong

| What you see | Fix |
| --- | --- |
| Redirect error at sign-in | Redirect URI must be exactly `https://mcp.stensul.com/<your-instance>/oauth/callback` |
| The client secret isn't shown anymore | It's shown once. Create a new connection for a fresh ID and secret |
| The agent can't reach Stensul | Check the instance name appears in the MCP URL and all three OAuth URLs |
| First interaction fails to connect | **Open connection manager > Connect > Submit**, sign in, retry |
| Teammates can't find the agent | Share the published agent with them (step 4) |
| An unexpected error from Microsoft | Microsoft errors are sometimes intermittent. Wait a few minutes and try again |
