teams-agent-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@teams-agent-mcplist members of the #general channel"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Layer
This repo is one of two, and it does not work alone. The full bridge that lets an agent ask a human in Teams and get the answer back:
┌───────────────────┐ ┌─────────────────┐ ┌───────────────┐ ┌──────────────┐ │ Microsoft 365 │◄─►│ connector │◄─►│ MCP server │◄─►│ your agent │ │ Teams + Azure Bot │ │ teams-connector │ │ ★ THIS REPO │ │ SaaS/in-house│ └───────────────────┘ └─────────────────┘ └───────────────┘ └──────────────┘Prerequisite: a running teams-connector — that companion repo is the only thing that talks to Microsoft; this service is its client. Deploy it first, then this one, then point your agent here. Order and wiring:
GETTING_STARTED.md.
The agent-facing half of the Teams bridge. It holds one fact the connector deliberately does not: which agent session a Teams thread belongs to.
Teams <-> connector <-> [ MCP layer ] <-> your agent
this serviceWhat it does
Exposes tools an agent calls:
list_channels,list_channel_members,ask_human.Stores the
session_id ↔ thread_idmapping — one table,mcp_sessions; the full annotated DDL, column meanings and sizing notes are inDATABASE.md, and the executable copy the service applies at startup ismcp_layer/schema.sql.Receives each human reply from the connector and delivers it to the session that asked.
Documentation map: deploy step-by-step →
GETTING_STARTED.md · the database →
DATABASE.md · architecture & APIs → this file.
Related MCP server: Teams Messenger MCP App
Every API, at a glance
This service EXPOSES 3 surfaces (5 HTTP endpoints total):
# | Endpoint | Who calls it | What it does |
1 |
| your agent (MCP protocol, Streamable HTTP) | connect once, auto-discover and call the 3 tools |
2 |
| your agent (plain REST — same 3 tools, for anything that cannot speak MCP) | list channels · list people · post a question |
3 |
| the connector | every human reply arrives here and is routed to its session |
Surfaces 1–2 require Authorization: Bearer <MCP_TOOLS_TOKEN>;
surface 3 requires the connector's CONNECTOR_INBOUND_TOKEN.
This service CALLS 2 things:
Direction | Where | Which endpoints | When |
→ the teams-connector |
|
| executing the tools |
→ your consumer |
| — | delivering each human answer to the session that asked |
That is the complete surface — nothing else listens, nothing else is called.
Using both repos: how this connects to teams-connector
The entire integration between this service and teams-connector is two HTTP links and two shared tokens — there is no other coupling (no shared database, no shared code):
OUTBOUND (the agent asks)
this service ──────────────────────────────► teams-connector
calls: GET /api/connector/channels · GET /members
POST /threads · POST /say
auth: Authorization: Bearer CONNECTOR_API_TOKEN
INBOUND (a human answers)
teams-connector ───────────────────────────► this service
calls: POST /teams-inbound (its CONNECTOR_INBOUND_URL points here)
body: {conversation_id, text, speaker, speaker_email, source}
auth: Authorization: Bearer MCP_INBOUND_TOKENThe four configuration lines that make it work — two on each side:
Where | Setting | Must be |
this service |
| the connector's base URL |
this service |
| identical to the connector's |
the connector |
|
|
the connector |
| identical to this service's |
Deploy order: connector first, then this service, then go back and set
the connector's CONNECTOR_INBOUND_URL — the loop is closed at that
moment. How the correlation works across the pair: ask_human receives
the new thread's id from POST /threads and stores it against the
calling session; the human's reply arrives at /teams-inbound carrying
that same thread id (Teams stamps it on every in-thread reply), and one
table lookup routes the answer home. If either token pair mismatches,
the symptom is a 401 in the callee's log.
What it deliberately does not do
Talk to Teams. It never imports the Teams SDK. It calls the connector's HTTP API instead — that is why it is a separate service and why swapping one agent platform for another touches only this layer.
See unrelated conversations. The connector forwards every channel message; this layer routes only the ones whose thread matches a known session and drops the rest. An agent never sees channel traffic that was not a reply to its own question.
The tools
Tool | Purpose |
| channels the bot can reach (verify, not route) |
| who is in a channel — resolves names to mentions |
| post a question, bind the thread to the session |
Routing knowledge — which channel is for which program — lives in the
agent's context file, not here. These tools execute and verify; the
agent decides where to ask. If a channel is not installed, ask_human
returns a "please install the bot" message the agent relays to a human.
session_id is passed explicitly, so the layer works whether the
platform injects it or a playbook supplies it.
Reply routing
The connector POSTs every inbound message to /teams-inbound with its
conversation id. This layer looks the thread up: a match is delivered to
the session; anything else returns {"routed": false} and is dropped.
Files in this package
Deployment is configuration only; you do not edit these. A map for readers and reviewers:
File | What it does |
| Entry point. Starts the service, mounts the inbound webhook, opens the store. |
| The webhook the connector calls ( |
| The tool logic: |
| HTTP client for the connector's API — this layer's only way to Teams. |
| Delivers an answer to the attached agent ( |
| The |
| Reads all configuration from the environment. Where config comes in. |
| The config file you copy to |
| Builds the container image. |
Running
Deployment step-by-step (database options, config table, attaching your
agent platform, verification) lives in
GETTING_STARTED.md. The short form:
cp .env.example .env # fill in — see GETTING_STARTED.md
docker compose up --build # service + PostgreSQL, one commandor without Docker (Python 3.11+):
pip install -r requirements.txt
uvicorn mcp_layer.app:app --host 0.0.0.0 --port 8100Point the connector's CONNECTOR_INBOUND_URL at
https://<this-host>/teams-inbound. See .env.example for all settings.
Status
Complete and tested in the source monorepo's smoke suite (a mock
consumer and a faked connector prove the full ask → reply → session
loop; no Teams/LLM/network needed): the tool logic, the reply
round-trip, the REST tool port, and the MCP-protocol surface
(Streamable HTTP at /mcp-server/mcp, bearer-gated, tools
auto-discovered via tools/list). The bidirectional flow has also been
verified live against a real tenant. Per-repo CI is on the roadmap.
One piece is deliberately an example rather than a certainty: the SaaS
sessions-API adapter in consumer.py implements one vendor's endpoint
shape. Verify it against your platform's actual API (or add your own
adapter — one method) before relying on it in production.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that integrates Microsoft Teams messaging (read, post, mention, list members and threads)6390Apache 2.0
- Flicense-qualityDmaintenanceA Model Context Protocol server that bridges Microsoft Teams and MCP-compatible clients, enabling chat integration, message handling, and advanced search capabilities without REST API endpoints.1
- Flicense-qualityBmaintenanceMCP server providing access to Microsoft Teams chats/channels, Outlook emails, calendar events, and SharePoint files via Microsoft Graph API.
- AlicenseBqualityCmaintenanceMCP server for Microsoft Teams that exposes 73 tools to manage teams, channels, chats, messages, meetings, planner, calendar, apps, tabs, scheduling, search, and authentication via the Graph API.7327MIT
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Official MCP server for OmniDimension. Drive voice agents, dispatch calls, and run bulk campaigns.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/techtdev-labs/teams-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server