npm microsoft-teams-mcp-serverstdioMITupdated 4mo ago
The first open-source Microsoft Teams connector for Claude. Any Microsoft 365 user can connect β just sign in with your work account. No setup, no credentials, no self-hosting required.
O que dΓ‘ para fazer com Microsoft Teams?
Teams MCP Server
The first open-source Microsoft Teams connector for Claude. Any Microsoft 365 user can connect β just sign in with your work account. No setup, no credentials, no self-hosting required.
Read messages, list channels, search across Teams, send messages β all from Claude Code, Claude Desktop, or Claude Cowork.
Built by SurgeEnterpriseAI.
How It Works
βββββββββββββββ Click "Connect" ββββββββββββββββββββββββ
β Claude User β βββββββββββββββββββββββΊ β Teams MCP Server β
β (Cowork/ β β (hosted by Surge) β
β Desktop/ β SSE/MCP Protocol β β
β Code) β βββββββββββββββββββββββΊ β ββββββββββββββββββ β
βββββββββββββββ β β OAuth (common) β β
β β Any M365 user β β
User signs in with their β β can sign in β β
own Microsoft account β βββββββββ¬βββββββββ β
ββββββββββββββββββββββΊ β β β
β βββββββββΌβββββββββ β
β β Microsoft β β
β β Graph API β β
β ββββββββββββββββββ β
ββββββββββββββββββββββββ
The user connects their own Microsoft 365 account. They see their own teams, their own channels, their own messages. Each user's tokens are isolated. The server is the bridge β it never stores messages, just passes them through.
Features
- One-click connect β visit
/connect, sign in with Microsoft, done - Multi-tenant β any Microsoft 365 organization, any user
- 11 tools β teams, channels, messages, chats, search, profile
- Dual transport β STDIO for Claude Code, HTTP/SSE for Cowork & remote
- Multi-user β each session gets isolated OAuth tokens
- Auto-detect β picks the right transport based on launch method
- Token caching β silent refresh, no re-login every session
- Retry logic β automatic retries on throttled Graph API calls
- TypeScript β fully typed, clean architecture, MIT licensed
For Users: Connect in 1 Click
If someone is already hosting this server (e.g., on https://teams-mcp.surgeai.com):
- Claude asks you to connect Microsoft Teams
- You click the auth link
- Sign in with your Microsoft work account
- Done β Claude can now read your Teams
No API keys, no Azure portal, no setup.
For Developers: Self-Host
1. Clone & Install
git clone https://github.com/SurgeEnterpriseAI/teams-mcp-server.git
cd teams-mcp-server
npm install
npm run build
2. Azure AD App Registration
- Go to Azure Portal β App registrations β New registration
- Name:
Teams MCP Server - Supported account types: "Accounts in any organizational directory (Any Azure AD directory - Multitenant)"
- Redirect URI: Web β
https://your-server.com/auth/callback - Click Register
Configure:
- Certificates & secrets β New client secret β copy the Value
- API Permissions β Add Delegated (Microsoft Graph):
ChannelMessage.Read.All,ChannelMessage.SendChat.Read,Chat.ReadWrite,ChatMessage.SendTeam.ReadBasic.All,Channel.ReadBasic.AllUser.Read
- Click Grant admin consent (for your own tenant; other tenants consent on first login)
3. Configure & Deploy
cp .env.example .env
# Set TEAMS_CLIENT_ID, TEAMS_CLIENT_SECRET
# Set BASE_URL and REDIRECT_URI to your production URL
# TEAMS_AUTHORITY=common (multi-tenant, default)
Deploy to Railway, Render, Azure App Service, or any Node.js host:
# Railway
railway login && railway init && railway up
# Or Azure
az webapp up --name teams-mcp-server --runtime "NODE:20-lts"
# Or just run directly
TRANSPORT_MODE=http node dist/index.js
4. Submit to MCP Registry
Once deployed and tested, submit your server URL to Anthropic's MCP connector registry. Users will then see "Microsoft Teams" as a connect option in Claude Cowork β just like Slack and Gmail.
For Claude Code Users: Local STDIO Mode
Add to your .mcp.json:
{
"mcpServers": {
"teams": {
"command": "node",
"args": ["/path/to/teams-mcp-server/dist/index.js"],
"cwd": "/path/to/teams-mcp-server"
}
}
}
First run will open your browser for Microsoft login. After that, tokens are cached.
Available Tools
| Tool | What it does |
|---|---|
teams_list_teams |
List all your Teams |
teams_list_channels |
List channels in a team |
teams_read_channel_messages |
Read recent channel messages |
teams_send_channel_message |
Send a message to a channel |
teams_reply_to_message |
Reply in a channel thread |
teams_read_message_replies |
Read thread replies |
teams_list_chats |
List your DMs and group chats |
teams_read_chat_messages |
Read messages from a chat |
teams_send_chat_message |
Send a direct/group chat message |
teams_search_messages |
Search messages across all Teams |
teams_get_profile |
Get your Microsoft 365 profile |
Architecture
src/
βββ index.ts Main entry (auto-detects transport)
βββ config.ts Central configuration
βββ logger.ts Structured logging
βββ types.ts TypeScript interfaces
βββ sessions.ts Multi-user session manager
βββ auth/
β βββ oauth.ts MSAL OAuth (multi-tenant, per-user)
β βββ token-store.ts Persistent token cache
βββ graph/
β βββ client.ts Graph HTTP client with retries
β βββ teams.ts Teams & channels API
β βββ messages.ts Channel messages API
β βββ chats.ts DM & group chat API
β βββ search.ts Search & profile API
βββ mcp/
β βββ server.ts MCP server factory
β βββ tools/ 11 tool definitions
βββ transport/
β βββ stdio.ts STDIO (Claude Code)
β βββ http.ts Express + SSE (Cowork / remote)
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
TEAMS_CLIENT_ID |
Yes | β | Azure AD app client ID |
TEAMS_CLIENT_SECRET |
Yes | β | Azure AD client secret |
TEAMS_AUTHORITY |
No | common |
common for multi-tenant, or a specific tenant ID |
TRANSPORT_MODE |
No | auto |
auto, stdio, or http |
PORT |
No | 3000 |
HTTP server port |
BASE_URL |
No | http://localhost:3000 |
Public URL |
REDIRECT_URI |
No | {BASE_URL}/auth/callback |
OAuth callback URL |
TOKEN_STORE_PATH |
No | ./.data/tokens |
Token cache directory |
LOG_LEVEL |
No | info |
Logging level |
License
MIT β LICENSE
Contributing
Issues and PRs welcome. Built by SurgeEnterpriseAI.
InstalaΓ§Γ£o
Adicione Microsoft Teams ao seu cliente. Escolha o que vocΓͺ usa.
claude mcp add microsoft-teams-mcp-server -- npx -y microsoft-teams-mcp-servercodex mcp add microsoft-teams-mcp-server -- npx -y microsoft-teams-mcp-serveramp mcp add microsoft-teams-mcp-server -- npx -y microsoft-teams-mcp-server{
"mcpServers": {
"microsoft-teams-mcp-server": {
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"microsoft-teams-mcp-server": {
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"microsoft-teams-mcp-server","command":"npx","args":["-y","microsoft-teams-mcp-server"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"microsoft-teams-mcp-server": {
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"microsoft-teams-mcp-server": {
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"microsoft-teams-mcp-server": {
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"microsoft-teams-mcp-server": {
"type": "local",
"command": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"microsoft-teams-mcp-server": {
"command": {
"path": "npx",
"args": [
"-y",
"microsoft-teams-mcp-server"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y microsoft-teams-mcp-serverRun `goose configure`, choose **Add Extension β Command-line Extension**, and paste this command.
11 ferramentas
Microsoft Teams expΓ΅e 11 ferramentas a um agente conectado.
- teams_list_teams
- List all your Teams
- teams_list_channels
- List channels in a team
- teams_read_channel_messages
- Read recent channel messages
- teams_send_channel_message
- Send a message to a channel
- teams_reply_to_message
- Reply in a channel thread
- teams_read_message_replies
- Read thread replies
- teams_list_chats
- List your DMs and group chats
- teams_read_chat_messages
- Read messages from a chat
- teams_send_chat_message
- Send a direct/group chat message
- teams_search_messages
- Search messages across all Teams
- teams_get_profile
- Get your Microsoft 365 profile
PontuaΓ§Γ£o
71 / 100
Boa
- DocumentaΓ§Γ£o25/25
- ManutenΓ§Γ£o13/25
- ConfianΓ§a13/20
- Capacidade8/15
- InstalaΓ§Γ£o12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 142 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 11 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
HistΓ³rico de versΓ΅es
| VersΓ΅es | Publicada |
|---|---|
| 1.0.0Mais recente | 12 de abr. de 2026 |