Teams MCP Server
Teams MCP Server
首个面向 Claude 的开源 Microsoft Teams 连接器。任何 Microsoft 365 用户都可以连接——只需使用你的工作账户登录。无需设置、无需凭据、无需自托管。
读取消息、列出频道、跨 Teams 搜索、发送消息——全部可在 Claude Code、Claude Desktop 或 Claude Cowork 中完成。
由 SurgeEnterpriseAI 构建。
工作原理
┌─────────────┐ 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 │ │
│ └────────────────┘ │
└──────────────────────┘用户连接自己的 Microsoft 365 账户。 他们看到自己的团队、自己的频道、自己的消息。每个用户的令牌都是隔离的。服务器是桥梁——它从不存储消息,只是传递它们。
Related MCP server: Microsoft 365 MCP Server
功能特性
一键连接 — 访问
/connect,使用 Microsoft 登录,完成多租户 — 任何 Microsoft 365 组织,任何用户
11 个工具 — 团队、频道、消息、聊天、搜索、个人资料
双传输 — 用于 Claude Code 的 STDIO,用于 Cowork 和远程的 HTTP/SSE
多用户 — 每个会话获得隔离的 OAuth 令牌
自动检测 — 根据启动方式选择正确的传输
令牌缓存 — 静默刷新,无需每次会话重新登录
重试逻辑 — 对受限的 Graph API 调用自动重试
TypeScript — 完全类型化,架构清晰,MIT 许可
对于用户:一键连接
如果已经有人托管此服务器(例如在 https://teams-mcp.surgeai.com 上):
Claude 要求你连接 Microsoft Teams
你点击认证链接
使用你的 Microsoft 工作账户登录
完成 — Claude 现在可以读取你的 Teams
无需 API 密钥,无需 Azure 门户,无需设置。
对于开发者:自托管
1. 克隆并安装
git clone https://github.com/SurgeEnterpriseAI/teams-mcp-server.git
cd teams-mcp-server
npm install
npm run build2. Azure AD 应用注册
转到 Azure 门户 → 应用注册 → 新注册
名称:
Teams MCP Server支持的账户类型:“任何组织目录中的账户(任何 Azure AD 目录 - 多租户)”
重定向 URI:Web →
https://your-server.com/auth/callback点击注册
配置:
证书和机密 → 新建客户端机密 → 复制值
API 权限 → 添加委派(Microsoft Graph):
ChannelMessage.Read.All,ChannelMessage.SendChat.Read,Chat.ReadWrite,ChatMessage.SendTeam.ReadBasic.All,Channel.ReadBasic.AllUser.Read
点击授予管理员同意(对于你自己的租户;其他租户在首次登录时同意)
3. 配置并部署
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)部署到 Railway、Render、Azure App Service 或任何 Node.js 主机:
# 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.js4. 提交到 MCP 注册表
部署并测试后,将你的服务器 URL 提交到 Anthropic 的 MCP 连接器注册表。用户随后会在 Claude Cowork 中看到“Microsoft Teams”作为连接选项——就像 Slack 和 Gmail 一样。
对于 Claude Code 用户:本地 STDIO 模式
添加到你的 .mcp.json:
{
"mcpServers": {
"teams": {
"command": "node",
"args": ["/path/to/teams-mcp-server/dist/index.js"],
"cwd": "/path/to/teams-mcp-server"
}
}
}首次运行将打开你的浏览器进行 Microsoft 登录。之后,令牌会被缓存。
可用工具
Tool | 功能描述 |
| 列出你的所有团队 |
| 列出团队中的频道 |
| 读取最近的频道消息 |
| 向频道发送消息 |
| 在频道线程中回复 |
| 读取线程回复 |
| 列出你的私聊和群聊 |
| 读取聊天中的消息 |
| 发送私聊/群聊消息 |
| 跨所有 Teams 搜索消息 |
| 获取你的 Microsoft 365 个人资料 |
架构
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)环境变量
变量 | 必需 | 默认值 | 描述 |
| 是 | — | Azure AD 应用客户端 ID |
| 是 | — | Azure AD 客户端机密 |
| 否 |
|
|
| 否 |
|
|
| 否 |
| HTTP 服务器端口 |
| 否 |
| 公共 URL |
| 否 |
| OAuth 回调 URL |
| 否 |
| 令牌缓存目录 |
| 否 |
| 日志级别 |
许可证
MIT — LICENSE
贡献
欢迎提交 Issue 和 PR。由 SurgeEnterpriseAI 构建。
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityCmaintenanceConnects Claude to Microsoft Outlook through the Microsoft Graph API, enabling email management (list, search, read, send) and calendar operations (list, create, accept, decline, delete events) via OAuth 2.0 authentication.1MIT
- FlicenseNot gradedqualityCmaintenanceProvides Claude Desktop and Claude Code with access to Microsoft 365 email and calendar services via the Microsoft Graph API. It enables users to manage emails, search folders, schedule calendar events, and check availability through natural language commands.
- AlicenseNot gradedqualityBmaintenanceConnects Claude with Microsoft 365 services such as Email, Calendar, Teams, OneDrive, and more through the Microsoft Graph API.4616MIT
- AlicenseNot gradedqualityCmaintenanceConnects Claude with Microsoft 365 services including Outlook, OneDrive, and Power Automate, enabling email, calendar, files, and flow management through natural language.34423MIT
Related MCP Connectors
Drive your real WhatsApp inbox from Claude — send, reply, label, assign, and triage via TimelinesAI.
Connect Claude to Fathom meeting recordings, transcripts, and summaries
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
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/SurgeEnterpriseAI/teams-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server