Bring your own Agent to MS Teams

Learn how to integrate your existing AI agents from LangChain, Azure AI Foundry, or Slack into Microsoft Teams using the HTTP server adapter pattern.
You've already built the agent. It lives somewhere: a LangChain chain, an Azure Foundry deployment, a Slack bot. Your users live in Teams. Teams is where most enterprise work happens: decisions get made, customers get answered, and projects move forward there. Getting your agent into that context, before you build anything Teams-specific, is already worth doing.
It comes down to one pattern in the Teams TypeScript SDK: the HTTP server adapter. You point it at your HTTP server, it registers a messaging endpoint, and your existing server keeps running as-is. The scenarios below cover three different starting points: a Slack bot, a LangChain chain, and an Azure Foundry agent.
The SDK also handles the parts you don't want to think about: it verifies every incoming request is legitimately from Teams before invoking your handler, and routes messages to the right event handlers automatically.
The Pattern
Every example in this post uses the same three-step shape:
- Wrap your server with ExpressAdapter.
- Create the TeamsApp instance.
- Handle messages using the .on('message') event.
The SDK injects a POST /api/messages route into your existing Express app. /api/messages is the well-known endpoint Teams uses to deliver messages to your bot, the Teams-shaped interface your HTTP server needs to have. Your server stays yours; the Teams SDK just adds that one endpoint.
Scenario 1: Slack Bot
You have a Slack bot built with Bolt. Rather than maintaining two codebases, run both on the same Express server. ExpressReceiver lets Bolt mount onto your Express app. The Teams SDK does the same thing, so both platforms share the same process. Slack hits /slack/events, Teams hits /api/messages, and shared logic lives in plain functions.
Scenario 2: LangChain
You have a LangChain chain. You want Teams users to talk to it. The bridge involves passing the Teams message text to the chain's .invoke() method. You can also trigger a 'typing' indicator so users know the LLM is processing the request.
Scenario 3: Azure AI Foundry
You have an agent deployed in Azure AI Foundry. The Teams SDK gives you the message; you forward it to Foundry using the AIProjectClient and relay the reply back to the Teams user.
Python equivalent
A Python SDK is also available. The same three-step pattern applies with FastAPI and other ASGI frameworks using the FastAPIAdapter.
Registering Your Bot
Step 1: Get a public URL for your local server using Dev tunnels or ngrok. Step 2: Register your bot using the Teams SDK CLI to make it reachable by the Teams service.
Source: Hacker News















