Use Teams Developer Portal to create a Teams app with a declarative agent that connects to the Staffbase MCP Server with OAuth. Users can then access Staffbase content and run Staffbase MCP Server tools on their own behalf.
This is one way to connect Microsoft Teams to the Staffbase MCP Server. If you prefer a low-code option, see Connect Microsoft Copilot Studio to the Staffbase MCP Server
This guide describes one possible setup based on Staffbase testing. Steps can vary depending on your Microsoft Teams configuration, environment, licenses, and access permissions. Staffbase maintains the Staffbase platform and MCP Server, while Microsoft maintains Teams and related components. For official Microsoft setup details, refer to Teams Developer Portal overview and MCP/API plugins for declarative agents.
Prerequisites
- You are an administrator in your Staffbase platform.
- You have OAuth clients activated for your platform. Contact Staffbase Support or your Customer Success Manager for more information.
- You have access to Microsoft Teams Developer Portal.
- You can create and upload custom apps in Microsoft Teams, and you have access to Microsoft 365 Copilot. If you are not sure, ask your Microsoft 365 administrator.
- You know your Staffbase platform domain, for example https://mycompany.com.
Step 1: Create the OAuth client in Staffbase
- Create an OAuth Client with the following details:
| Setting | Value |
|---|---|
| OAuth Client Type | WEB |
| Client name | Copilot Teams (or similar) |
| Scopes | Enter a single whitespace character |
| Redirect URI | https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect |
| Allowed CORS origins | https://teams.microsoft.com |
- Copy the following details during the OAuth client creation:
- Client ID
- Client Secret
- Authorization URI
- Token URI
Step 2: Register the app in Teams Developer Portal
- In Teams Developer Portal, create a new app and note the Teams App ID.
- Go to Tools > OAuth client registration.
- Configure registration using the following details:
- Registration name: Enter a name of your choice for the OAuth registration
- Base URL: Enter your Staffbase domain, for example
https://mycompany.com - Restrict usage by organization: My organization only
- Restrict usage by Teams app: Teams App ID from Step 2.1
- Client ID and Client Secret: Enter the values from Step 1
- Authorization endpoint: Enter the Staffbase Authorization URI from Step 1
- Token endpoint: Enter the Staffbase Token URI from Step 1
- Refresh endpoint: Enter the same as Token URI from Step 1
- Scope:
offline_access - PKCE: off
- Client password authentication method:
Request body parameters
- Save and copy the OAuth registration ID.
Step 3: Configure app package files
- Open the app you created in Teams Developer Portal and configure the following details:
- Short description: Enter a brief description of your app. For example, Staffbase Teams App
- Long description: Enter a detailed description of your app. For example, App to connect to Staffbase services such as MCP.
- Developer/company name: Enter your organization name.
- Website: Enter your organization website URL.
- Privacy policy: Enter the URL to your organization’s privacy policy.
- Click Save.
- Go to Configure > App package editor, open manifest.json and add the copilotAgents property to the root object:
{ "copilotAgents": { "declarativeAgents": [ { "file": "staffbase-mcp-agent.json", "id": "staffbase_mcp_agent" } ] }}- Create a file named
staffbase-mcp-agent.jsonand paste:
Declarative agent manifest schema version in these examples can change. Check Microsoft’s documentation for the current versions.
{ "$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.8/schema.json", "version": "v1.8", "name": "Staffbase Assistant", "description": "Helps with Staffbase content and tasks via the MCP server.", "instructions": "Always use connected tools to look up current information.", "actions": [ { "id": "staffbaseMcpPlugin", "file": "ai-plugin.json" } ]}- Create a file named
ai-plugin.jsonand paste the following:
Replace <your-oauth-registration-id> with the OAuth registration ID you copied in Step 2. Replace https://mycompany.com/mcp with your Staffbase MCP endpoint.
{ "schema_version": "v2.4", "name_for_human": "Staffbase MCP", "namespace": "staffbaseMcp", "runtimes": [ { "type": "RemoteMCPServer", "auth": { "type": "OAuthPluginVault", "reference_id": "<your-oauth-registration-id>" }, "spec": { "url": "https://mycompany.com/mcp" } } ]}- Select Update to save the changes to your app package.
Step 4: Add and test in Teams
- In Developer Portal, select Preview in Teams, and then select Add.
- Open the app with Copilot.
- Test with a concrete prompt such as: Search for the latest news in Staffbase.
Step 5: Share the app with users
To let other users use the agent, your Microsoft 365 administrator can make the app available in your organization. See Microsoft’s documentation on submitting and approving custom apps.
Troubleshooting
Invalid client
If you receive invalid_client, verify that the Client ID and Client Secret in Teams OAuth registration exactly match the Staffbase OAuth client.
Invalid redirect URI
If you receive invalid_request with redirect URI mismatch, verify that https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect is registered exactly as a Redirect URI in Staffbase.