Skip to main content
An IT admin adds StackOne to the Microsoft 365 organization, bringing Linked Accounts from many providers. Each user then connects with their own accounts: an HR manager uses Microsoft 365 Copilot with Workday, Greenhouse and BambooHR, and a sales manager uses Microsoft 365 Copilot with Salesforce, HubSpot and Gmail.
Register StackOne once in Microsoft Agent 365, so a Microsoft 365 admin approves it for the whole tenant and every Copilot Studio agent can use it. Each person signs in to StackOne with their own login and reaches only the systems they’ve been given access to in StackOne.
Registering your own MCP server in Agent 365 is a Microsoft preview. The steps were tested with Agent 365 CLI 1.1.226. Two steps work around preview gaps: Find your Agent 365 environment ID and Set the refresh URL.

Before you start

In Microsoft 365, you need:
  • Someone who can create app registrations and grant admin consent in Microsoft Entra ID.
  • An AI Administrator or Global Administrator to approve the server in the Microsoft 365 admin center.
  • A Copilot Studio license or the Copilot Studio authors role, to build the agent.
  • On the machine you register from: .NET 8, the Azure CLI and python3.
In StackOne, you need the Project Admin role to create an MCP OAuth client, plus:
  • A StackOne project you are a member of.
  • A connector profile in the project for each provider the client should reach, with the actions you want exposed enabled.
  • (Optional) A linked account for each provider. Accounts can also be linked during the consent flow.

Register StackOne in Agent 365

1

Install the Agent 365 CLI and sign in

Install the CLI and sign in to your tenant:
The first time anyone registers a server in your tenant, a Global Administrator adds the Agent 365 Tools service principal. Without it, registration fails with a consent error:
2

Create an MCP OAuth client in StackOne

  1. In StackOne, go to Project Settings → MCP OAuth Clients and click Create OAuth Client.
  2. Set the following:
    • Name: for example Microsoft Agent 365.
    • Client type: Confidential.
    • Redirect URIs: pick Microsoft 365 Copilot under Common integrations. The client needs one redirect URI to save, and you replace it after registering.
  3. Click Generate and store the client ID and secret. The secret is shown only once.
3

Describe the server

Save this as stackone-mcp.json, with the client ID and secret from the previous step. The server name must start with ext_ and be at most 20 characters. Agent 365 limits each tool name to 30 characters, and the names must match the ones StackOne serves.
stackone-mcp.json
Keep remoteScopes. Without it, Agent 365 registers the server with no StackOne sign-in, and every call fails.
4

Register the server

Run the command and confirm with y:
The CLI creates the Entra apps, submits the server for approval and prints a Redirect URI for this server, starting https://global.consent.azure-apim.net/redirect/ext-5f.
5

Add the redirect URIs to the StackOne client

  1. In MCP OAuth Clients, click Edit on your client.
  2. Replace the redirect URI with the one the CLI printed.
  3. Add a second line with the same URI and tc- inserted after /redirect/, as in https://global.consent.azure-apim.net/redirect/tc-ext-5f…. Agent 365 uses both.
  4. Click Save.

Find your Agent 365 environment ID

Agent 365 keeps the connectors it creates in a hidden Power Platform environment, and the refresh URL fix in the next section needs its ID. Microsoft shows the ID only once a server is approved, so on a tenant with no approved server, approve a throwaway test server first. You need the ID once per tenant.
1

Register a test server

Save a copy of stackone-mcp.json as stackone-test.json. Change serverName to a new name, such as ext_StackOneTest, set authType to NoAuth, and delete remoteScopes and externalOAuth. Register it:
2

Approve the test server

Review and approve it as in the first two steps of Approve StackOne.
3

Read the ID from the setup link

  1. In Copilot Studio, add the test server to an agent, as in the Use the Agent 365 server tab of Agent Builder Setup, and save the agent. Use only that one server on the agent.
  2. Open Preview, turn on Debug mode and ask the agent anything.
  3. Open the output of the Initialize Server tool. It holds a setup link ending in environmentName=. The value after it is your environment ID.
  4. Remove the test server from the agent. You can then delete it in the admin center under Agents > Tools > Registry.

Set the refresh URL

StackOne access tokens last an hour. The connector Agent 365 creates for StackOne has no refresh URL, so each person’s connection stops working after an hour unless you set one. Do this after registering and before approving, because Agent 365 locks the connector at approval.
1

Fill in the script

Save the script below as set-refresh-url.sh and fill in your environment ID, server name and StackOne client secret.
2

Run it

It prints Refresh URL set. You can now approve the server.
set-refresh-url.sh

Approve StackOne

1

Review the request

  1. In the Microsoft 365 admin center, go to Agents > Tools, then the Requests (preview) tab.
  2. Open the StackOne server and check the tools it declares on the Tools tab.
The Tools page in the Microsoft 365 admin center, opened from Agents then Tools, with the Requests (preview) tab listing tool requests and their type, such as MCP Server
2

Approve it

Select Approve, then consent to the Microsoft Entra permissions the server asks for. The server can’t be used until that consent is given.
3

Connect your own StackOne login

Each person, you included, connects StackOne once through a setup link in Power Apps. Follow Connect StackOne in Organization User Setup:Sign in, pick the project and the linked accounts the connector should reach, then Authorize.
Within about 30 minutes, the server shows in Copilot Studio in every environment in your tenant. To stop every agent from using it, block it under Agents > Tools > Registry in the admin center.

Add StackOne to an agent

Agent makers add the server from the Use the Agent 365 server tab of Agent Builder Setup. To make an agent available in Microsoft 365 Copilot, publish it as Microsoft describes in Connect and configure an agent for Teams and Microsoft Copilot.
Registration fails partway. The CLI doesn’t remove the Entra apps it already created. Delete them in the Azure portal, then register again.

Roll it out

StackOne is now available for your users in Microsoft 365 Copilot. Make sure the following is ready before rolling out:
  • Add users. Invite or provision users via SSO/SCIM. See Manage Team.
  • Create groups. Organize teams into groups to control which systems each team reaches.
  • Set up connectors. Define Connector Profiles to scope provider actions for specific functions.
  • Link accounts. Link shared company accounts, or let users link their own accounts. See Linking Accounts.
Then send users one of the following guides, depending on the product:

Microsoft 365 Copilot

For people in your organization connecting StackOne in Microsoft 365 Copilot.

Copilot Studio

For people building agents in Copilot Studio.