Setup in Microsoft Copilot Studio

This guide walks you through adding your Leena AI Colleague to a Microsoft Copilot Studio agent as an MCP tool, one step at a time. By the end, a Copilot Studio agent will be able to talk to your AI Colleague in natural language — asking HR/IT/policy questions, triggering workflows, and returning grounded answers — on behalf of the signed-in user.

This page assumes you've already enabled the Leena MCP server. If you haven't, do that first (see Leena MCP Server → How to Enable It and Generate Credentials), then come back here.


What you'll need before you start

On the Leena side — open your AI Colleague's Settings → Orchestrator Settings → MCP server page and have these values ready. You'll paste each one into Copilot Studio:

From the Leena MCP server settings pageUsed in Copilot Studio as
MCP URL (ends in /mcp/)Server URL
Client IDClient ID
Client secret (generate it, shown once)Client secret
Authorization URLAuthorization URL
Token URLToken URL template
Refresh URLRefresh URL

On the Microsoft side:

  • A Copilot Studio agent you can edit (or create a new one).
  • Permission to create Power Platform connections in your environment. (Behind the scenes, Copilot Studio registers the MCP server as a Power Platform connector, so any data-loss-prevention policy on connectors also applies here.)

One compatibility note: Copilot Studio talks to MCP servers over the Streamable HTTP transport, which is exactly what the Leena MCP server uses — so the two are compatible out of the box. (The older SSE transport is no longer supported by Copilot Studio.)

Tip — do the credential prep first. Generate the Leena client secret right before you start, because Leena shows the full secret only once. If you lose it, generate a new one (which replaces the old).


Step-by-step

Step 1 — Open the MCP onboarding wizard

In Copilot Studio, open your agent and go to the Tools page. Select Add a tool → New tool → Model Context Protocol.

This launches the MCP onboarding wizard — the recommended, no-code way to attach an MCP server. (There's also a Power Apps custom-connector route, covered at the end, but the wizard is simpler and is the right choice for Leena.)

Step 2 — Enter the basic server details

Fill in the three fields the wizard asks for:

  • Server name — a friendly label, e.g. Leena AI Colleague.
  • Server description — a short, clear description of what your AI Colleague does, e.g. "Answers HR, IT, and policy questions and runs approval workflows for employees, grounded in company knowledge."
  • Server URL — paste the MCP URL from the Leena settings page (the one ending in /mcp/).

Why the description matters: Copilot Studio's orchestrator reads this description at runtime to decide when to route a user's message to Leena versus other tools. A vague description ("Leena server") makes routing unreliable; describe the kinds of questions and actions Leena handles.

Step 3 — Choose the authentication type: OAuth 2.0 → Manual

For the authentication type, select OAuth 2.0, then choose the sub-type Manual.

Here's why Manual is the correct choice for Leena: Leena issues you a fixed Client ID and Client secret from its dashboard — your admin pre-registers the application. The other two OAuth options (Dynamic discovery and Dynamic) are for servers that let the client register itself automatically at connection time. Leena doesn't work that way, so you supply the credentials manually.

Step 4 — Fill in the OAuth 2.0 fields

Map each value from the Leena settings page into the matching Copilot Studio field:

  • Client ID → the Leena Client ID. Identifies your registered application to Leena.
  • Client secret → the Leena Client secret you generated. Proves the application is authorized to request tokens.
  • Authorization URL → the Leena Authorization URL. This is where the user is sent to sign in to Leena and grant consent (they'll see a sign-in/consent card inside the agent chat).
  • Token URL template → the Leena Token URL. Where Copilot Studio exchanges the sign-in result for an access token (and a refresh token) so it can call Leena on the user's behalf.
  • Refresh URL → the Leena Refresh URL. Used to silently get a fresh access token when the old one expires, so users don't have to sign in again every time.
  • Scopes (optional) → leave blank unless your Leena deployment specifies one. Leena's MCP server doesn't require a specific scope.

Step 5 — Create the server and copy the callback URL

Select Create. Copilot Studio registers the server and then displays a callback URL (also called a redirect URL).

This callback URL is the address Leena must send the user back to after they sign in. Copy it now — you'll register it with Leena in the next step. Don't continue past this screen until you've copied it.

The callback URL is generated by Microsoft and is an HTTPS address. It varies by cloud/region, so always copy the exact value Copilot Studio shows rather than assuming it.

Step 6 — Register the callback URL back in Leena

Switch back to the Leena MCP server settings page and add the callback URL you just copied to the Redirect URIs field, then save.

This step is the one most people miss, and it causes sign-in to fail if skipped. Leena will only complete the OAuth login if the callback URL is on its allow-list.

A couple of things to know:

  • Redirect URIs in Leena must be HTTPS. The Microsoft callback URL is HTTPS, so it's accepted. (Plain HTTP is only allowed for localhost loopback addresses, which won't apply here.)
  • There's a deliberate ordering to Steps 4–6: Copilot Studio only reveals the callback URL after you enter the credentials and click Create, and Leena needs that URL registered before a user can sign in. So the sequence is: enter credentials → Create → copy callback → paste into Leena → save → then continue.

Step 7 — Create the connection and sign in

Back in Copilot Studio, on the Add tool dialog, select Create a new connection for the Leena server.

Because Leena uses OAuth, this triggers a sign-in: the user authenticates against Leena and grants the agent permission to act on their behalf. This is per-user — the connection is bound to whoever signs in, and the AI Colleague will only ever see and do what that user's Leena permissions and audience rules allow. It is not a shared service account.

If you're testing, you sign in as yourself; when published, each end user signs in once via the consent card the first time the agent calls Leena.

Step 8 — Add the server to your agent

Select Add to agent to finish. Copilot Studio performs the MCP handshake with Leena and pulls in the available tools.

Step 9 — Review the tools that appear

You'll see the Leena MCP server expose its three tools:

  • send_message — the main one; sends a natural-language instruction to the AI Colleague.
  • request_details — checks the status of an in-progress request.
  • cancel — stops a running or paused request.

You can leave all three enabled. You don't see individual Leena skills here — Leena is a single conversational sub-agent, and send_message is how the Copilot agent talks to it.

Step 10 — Test it

Open the Test pane in Copilot Studio and try a prompt your AI Colleague can answer, for example: "What's our work-from-home policy?" or "Raise an IT ticket — my laptop won't connect to VPN."

On first use you'll be asked to complete the connection / sign in (if you haven't already). After that, the agent calls send_message, Leena does the work, and the grounded answer comes back into the chat.


How the integration behaves at runtime

A few Leena-specific behaviors are worth understanding so you can set the right expectations and instructions in your agent:

  • Conversations are threaded. Leena returns a thread_id. To keep a multi-turn conversation coherent, the same thread_id should be reused on follow-up calls. Add a line to your agent's instructions reminding it to continue existing Leena conversations rather than starting fresh each turn.
  • Follow-up questions (input_required). Sometimes Leena needs more information and pauses to ask. The Copilot agent should relay that question to the user and send the answer back. This works naturally in conversational use, but it's worth testing flows that ask follow-ups.
  • Long-running work. Quick questions come back in one call. Longer workflows/AOPs may return a running status, after which the agent should call request_details to poll for the result. Very long automations are better suited to asynchronous patterns than a single chat turn.
  • Source links. When Leena returns a Sources section, those are authenticated links the user can click to open the underlying article. Instruct your agent to include them verbatim and not rewrite them.
  • Forms and file uploads. Since Copilot Studio chat has no Leena composer, anything needing a file upload or structured form comes back as a webview link the user opens in a browser to complete.

Troubleshooting

  • Sign-in fails / "redirect URI mismatch": The Microsoft callback URL isn't registered in Leena. Re-copy the exact callback URL from Copilot Studio and add it to Redirect URIs in the Leena MCP settings (Step 6).
  • "MCP not enabled" or connection rejected: Confirm the MCP server toggle is on for that AI Colleague, and that you're using credentials from the same AI Colleague.
  • Token/secret errors after a while: The Leena client secret has an expiry. If it lapsed, generate a new secret in Leena and update the connection's credentials in Copilot Studio.
  • Agent doesn't call Leena when it should: Sharpen the Server description (Step 2) so the orchestrator knows what kinds of requests belong to Leena.
  • Tool errors only on long tasks: That's the polling behavior — long requests return running; make sure request_details is enabled so status can be polled.

Reference

Microsoft's official, current procedure for connecting an existing MCP server to a Copilot Studio agent: https://learn.microsoft.com/en-us/microsoft-copilot-studio/mcp-add-existing-server-to-agent