Microsoft Copilot Studio
Microsoft Copilot Studio is a low-code platform for building AI agents. It has native MCP support (GA since May 2025), making it a great option for giving business users natural-language control over MaestroHub — without writing code.
Agents built in Copilot Studio can be published to Microsoft Teams, SharePoint, custom websites, mobile apps, and more.
Prerequisites
- A Microsoft Copilot Studio license (standalone, included with M365 Copilot, or a 60-day free trial)
- A Personal Access Token from MaestroHub — see Step 1 on the main MCP Integration page
- Your MaestroHub instance must be reachable from the internet — Copilot Studio runs in Microsoft's cloud and cannot connect to
localhost
For local development, use a tunnel service to expose your instance over HTTPS:
- Microsoft Dev Tunnels (
devtunnel) - ngrok
- Cloudflare Tunnel
Step 1: Create an Agent
-
Click Create > New Agent
-
Give it a name (e.g., "MaestroHub Assistant")
-
Add instructions describing the agent's role. For example:
You are a MaestroHub assistant. You help users manage their industrial data infrastructure — UNS topics, data connectors, pipelines, and dashboards. Always confirm before making changes. When listing items, format results as tables.
-
Make sure Generative Orchestration is enabled — go to Settings > Generative AI and confirm it is turned on. MCP tools will not work without it.
Step 2: Add the MCP Server
-
In your agent, go to the Tools page
-
Click Add a tool > New tool > Model Context Protocol
-
Fill in the following:
Field Value Server name MaestroHubServer description Industrial data management — topics, connectors, pipelines, dashboardsServer URL https://<your-instance>/api/v1/mcp -
Select the Authentication type — see Authentication Options below
-
Click Create
Step 3: Create a Connection
After creating the tool, Copilot Studio prompts you to create a connection:
- Click Create a new connection
- Enter the required credentials (API key value or OAuth details, depending on which auth type you chose)
- Click Connect
- Copilot Studio auto-discovers all MCP tools and resources from MaestroHub
Step 4: Select Tools
After connecting, you will see MaestroHub's tools listed. You can enable or disable individual tools. Tools stay dynamically synced — as tools are added or removed on the MaestroHub server, Copilot Studio reflects changes automatically.
Copilot Studio enforces a limit of 70 tools per MCP server. MaestroHub exposes more than 70 tools, so you may see a warning. Disable tools you don't need for your use case.
Step 5: Test
Use the built-in Test Agent panel (bottom-left of the Copilot Studio editor) to send messages:
- "List all UNS topics"
- "What's the MQTT broker status?"
- "Show me all connectors"
- "List recent pipeline executions"
If the agent responds with data from your MaestroHub instance, the integration is working.
Authentication Options
Copilot Studio offers three authentication options when adding an MCP server. MaestroHub supports two of them.
Option A: API Key (Simplest)
Use this option to authenticate with a MaestroHub Personal Access Token (PAT). This is the fastest way to get started.
In the MCP tool wizard:
| Field | Value |
|---|---|
| Authentication | API Key |
| Type | Header |
| Name | Authorization |
When creating the connection, enter the full value including the scheme prefix:
ApiKey <your-token>
For example: ApiKey eyJhbGciOiJSUzI1NiIs...
This causes Copilot Studio to send the following header on each request:
Authorization: ApiKey eyJhbGciOiJSUzI1NiIs...
Limitations:
- The PAT is tied to a single user — all agent actions run as that user
- PATs expire (max 1 year) and must be rotated manually
- No per-user identity — the agent cannot distinguish which end user is making the request
Some users have reported that Copilot Studio sends the API key only on the first HTTP request in a session, not on every request. If you experience 401 errors after the first tool call, switch to OAuth 2.0 instead.
Option B: OAuth 2.0 (Recommended for Production)
OAuth 2.0 authentication with Copilot Studio requires MaestroHub v2.3.0 or later.
OAuth 2.0 is the recommended authentication method for production use. Copilot Studio performs the full Authorization Code flow, and MaestroHub already has all the required OAuth2 endpoints.
B1. Register an OAuth2 Client in MaestroHub
-
In MaestroHub, navigate to System Management → API Clients
-
Click Register Application
-
Fill in the form:
Field Value Application Name Copilot Studio AgentDescription (optional) e.g., "Microsoft Copilot Studio integration" Client Type Confidential Client — Copilot Studio runs server-side and can store a secret securely Grant Types Check Authorization Code and Refresh Token Redirect URIs Enter a placeholder for now (e.g., https://placeholder.example.com) — you will replace this with the actual Copilot Studio callback URL in step B3 -
Under Allowed Scopes, select the permissions your agent needs. For a typical setup, select:
- OIDC:
openid,profile,email - UNS:
uns:read,uns:write - Connectors:
connectors:read - Dashboards:
dashboards:read - Pipelines:
pipelines:read
- OIDC:
-
Click Register Application to create the client
-
The Application Registered dialog appears with your Client ID and Client Secret. Copy both values immediately — the secret is shown only once and cannot be retrieved later.
Choose the minimum scopes your agent needs. For the full list of available scopes, see Available Scopes.
For detailed instructions on client registration including screenshots, see OAuth2 Clients.
B2. Configure OAuth in Copilot Studio
In the MCP tool wizard, select OAuth 2.0 > Manual and fill in:
| Field | Value |
|---|---|
| Client ID | <client_id from step B1> |
| Client Secret | <client_secret from step B1> |
| Authorization URL | https://<your-instance>/api/v1/oauth2/authorize |
| Token URL Template | https://<your-instance>/api/v1/oauth2/token |
| Refresh URL | https://<your-instance>/api/v1/oauth2/token |
| Scopes | uns:read uns:write connectors:read dashboards:read pipelines:read |
Click Create.
B3. Register the Callback URL
After clicking Create, Copilot Studio generates a callback URL (e.g., https://...copilot.studio/...callback). You must add this URL to the OAuth2 client's redirect URIs in MaestroHub:
- In MaestroHub, go to System Management → API Clients
- Click the actions menu (⋯) on your "Copilot Studio Agent" client and select View Details
- Click Edit
- Under Redirect URIs, remove the placeholder and add the callback URL from Copilot Studio
- Click Save Changes
B4. Create a Connection and Test
- In Copilot Studio, click Create a new connection
- A popup redirects you to MaestroHub's authorization page
- Sign in with your MaestroHub credentials
- Grant consent for the requested scopes
- You are redirected back to Copilot Studio with a valid connection
Advantages over API Key:
- Per-user identity — the token's
subclaim identifies which user is acting - Automatic token refresh — Copilot Studio refreshes expired tokens transparently
- Scope-based access control — the token only grants permissions for the requested scopes
- No manual token rotation required
Publishing Your Agent
Once your agent is working, you can publish it to multiple channels:
| Channel | Use Case |
|---|---|
| Microsoft Teams | Operations teams checking MaestroHub status from chat |
| Microsoft 365 Copilot | Enterprise users accessing MaestroHub from Teams, Outlook, or Word |
| SharePoint | Embedded agent on internal portals |
| Custom website | Customer-facing chatbot via JavaScript embed or iframe |
| Demo website | Quick shareable link for testing and demos |
To publish, go to Publish in the left sidebar of Copilot Studio and select your target channel.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Unable to connect to server" | MaestroHub not reachable from Microsoft cloud | Ensure the instance is publicly accessible or use a tunnel |
401 on first request | Invalid or expired PAT / OAuth token | Regenerate the PAT or re-authenticate the OAuth connection |
401 after first tool call | API key not sent on subsequent requests | Switch to OAuth 2.0 authentication |
| Agent ignores MCP tools | Generative Orchestration not enabled | Go to Settings > Generative AI and enable it |
| No data returned | Wrong organization context | Check that the PAT or OAuth user has access to the target organization |