Connect Microsoft Teams to the Staffbase MCP Server using Developer Portal

Learn how to create a Teams app with a declarative agent that connects to the Staffbase MCP Server using OAuth.

Employee App
Staffbase Intranet
Staffbase Email

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.

  • 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.
  1. 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
  1. Copy the following details during the OAuth client creation:
    • Client ID
    • Client Secret
    • Authorization URI
    • Token URI
  1. In Teams Developer Portal, create a new app and note the Teams App ID.
  2. Go to Tools > OAuth client registration.
  3. 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
  4. Save and copy the OAuth registration ID.
  1. 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.
  2. Click Save.
  3. 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"
}
]
}
}
  1. Create a file named staffbase-mcp-agent.json and 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"
}
]
}
  1. Create a file named ai-plugin.json and 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"
}
}
]
}
  1. Select Update to save the changes to your app package.
  1. In Developer Portal, select Preview in Teams, and then select Add.
  2. Open the app with Copilot.
  3. Test with a concrete prompt such as: Search for the latest news in Staffbase.

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.

If you receive invalid_client, verify that the Client ID and Client Secret in Teams OAuth registration exactly match the Staffbase OAuth client.

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.