Teams MCP Server 4186f5a0

MCPAI代理

提供方 EmilyThaHuman

AI代理 未标注 OAuth 授权 社区 / 第三方 Claude

一个用于Microsoft Teams集成的模型上下文协议(MCP)服务器,支持OAuth 2.0认证。

一句话选型结论

按资料字段整理

Teams MCP Server 4186f5a0 属于AI代理类 MCP 服务器,传输方式未标注,OAuth 授权,可直接接入 Claude,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式未标注 鉴权OAuth 授权 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 4 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量4暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

Teams集成本地部署OAuth认证MCP协议会话管理TypeScript开发

安装与配置

未标注 OAuth 授权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 4 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 4 个工具,职责相对集中,接入后不容易误操作。
  • 已适配 Claude,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Teams MCP Server 4186f5a0当前 4 未标注 未标注 无 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方EmilyThaHuman上游标注的维护方 EmilyThaHuman
分类AI代理本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

13.1 KB
来自项目仓库与上游目录的原文,未做删改

Microsoft Teams MCP Server

A Model Context Protocol (MCP) server for Microsoft Teams integration with OAuth 2.0 authentication.

Features

  • OAuth 2.0 Authentication: Secure Microsoft OAuth flow with automatic token refresh
  • MCP Protocol Support: Full implementation of the Model Context Protocol
  • Teams Operations:
  • Search chats and channel messages
  • Fetch specific messages by path
  • Get chat members
  • Get user profile
  • Session Management: Persistent sessions with automatic token refresh
  • TypeScript: Fully typed with TypeScript for better development experience
  • Cloudflare Workers: Deployable to Cloudflare Workers for global edge performance

Prerequisites

  • Node.js 18+
  • Microsoft Azure App Registration
  • OAuth 2.0 credentials (Client ID and Client Secret)

Setup

1. Microsoft Azure Configuration

  1. Go to Azure Portal
  2. Navigate to Azure Active Directory > App registrations
  3. Click New registration
  4. Configure your application:
    - Name: Teams MCP Server
    - Supported account types: Choose based on your needs
    - Redirect URI: Web - http://localhost:3003/oauth/callback
  5. After creation, note the Application (client) ID and Directory (tenant) ID
  6. Go to Certificates & secrets > New client secret
  7. Copy the client secret value
  8. Go to API permissions > Add a permission > Microsoft Graph
  9. Add the following Delegated permissions:
    - Chat.Read
    - ChannelMessage.Read.All
    - User.Read
  10. Click Grant admin consent (if you have admin privileges)

2. Installation```bash

Clone or navigate to the project directory

cd teams-mcp-server

Install dependencies

npm install


### 3. Configuration

Create a `.env` file in the root directory:```bash
cp env.example .env

Edit .env with your configuration:```env

Server Configuration

PORT=3003
NODE_ENV=development

Microsoft OAuth Configuration

MICROSOFT_CLIENT_ID=your_microsoft_client_id_here
MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret_here
MICROSOFT_REDIRECT_URI=http://localhost:3003/oauth/callback
MICROSOFT_TENANT_ID=common

Frontend URL (where to redirect after OAuth)

FRONTEND_URL=http://localhost:5173

MCP Server Configuration

MCP_SERVER_NAME=teams-mcp-server
MCP_SERVER_VERSION=1.0.0


**Tenant ID Options:**
- `common` - Multi-tenant (personal and work/school accounts)
- `organizations` - Work/school accounts only
- `consumers` - Personal Microsoft accounts only
- `{tenant-id}` - Specific tenant/organization

## Usage

### Development Mode```bash
npm run dev

Production Mode```bash

Build

npm run build

Start

npm start


### Cloudflare Workers Deployment```bash
# Create KV namespace for sessions
npm run kv:create

# Update wrangler.toml with your KV namespace ID

# Set secrets
wrangler secret put MICROSOFT_CLIENT_ID
wrangler secret put MICROSOFT_CLIENT_SECRET
wrangler secret put MICROSOFT_REDIRECT_URI
wrangler secret put MICROSOFT_TENANT_ID
wrangler secret put FRONTEND_URL

# Deploy
npm run deploy

API Endpoints

Health Check```

GET /health


### OAuth Flow

#### 1. Initiate Authorization```
GET /oauth/authorize?userId={userId}&state={state}

Response:```json
{
"authorizationUrl": "https://login.microsoftonline.com/...",
"state": "your-state-value"
}


#### 2. OAuth Callback (handled automatically)```
GET /oauth/callback?code={code}&state={state}

3. Refresh Token```

POST /oauth/refresh
Content-Type: application/json

{
"userId": "user123",
"refreshToken": "refresh_token_here"
}


#### 4. Disconnect```
POST /oauth/disconnect
Content-Type: application/json

{
  "userId": "user123"
}

MCP Endpoint```

POST /mcp
GET /mcp
DELETE /mcp


The MCP endpoint follows the Model Context Protocol specification for tool execution.

## MCP Tools

### 1. teams_search

Search Microsoft Teams chats and channel messages.

**Scopes Required:** `Chat.Read`, `ChannelMessage.Read.All`

**Input:**```json
{
  "userId": "user123",
  "query": "meeting notes",
  "chatId": "optional_chat_id",
  "channelId": "optional_channel_id",
  "teamId": "optional_team_id",
  "maxResults": 20,
  "fromDate": "2024-01-01T00:00:00Z",
  "toDate": "2024-12-31T23:59:59Z"
}

Output:```json
{
"messages": [
{
"id": "msg123",
"chatId": "chat123",
"from": {
"displayName": "John Doe",
"id": "user456"
},
"body": {
"content": "Here are the meeting notes...",
"contentType": "text"
},
"createdDateTime": "2024-01-15T10:30:00Z",
"subject": "Meeting Notes",
"webUrl": "https://teams.microsoft.com/..."
}
],
"count": 1
}


### 2. teams_fetch

Fetch a specific Teams message by path.

**Scopes Required:** `Chat.Read`, `ChannelMessage.Read.All`

**Input:**```json
{
  "userId": "user123",
  "path": "chats/{chatId}/messages/{messageId}"
}

Or for channel messages:```json
{
"userId": "user123",
"path": "teams/{teamId}/channels/{channelId}/messages/{messageId}"
}


**Output:**```json
{
  "id": "msg123",
  "chatId": "chat123",
  "from": {
    "displayName": "John Doe",
    "id": "user456"
  },
  "body": {
    "content": "Message content here",
    "contentType": "text"
  },
  "createdDateTime": "2024-01-15T10:30:00Z",
  "webUrl": "https://teams.microsoft.com/..."
}

3. teams_get_chat_members

List the members of a Microsoft Teams chat.

Scopes Required: Chat.Read

Input:```json
{
"userId": "user123",
"chatId": "chat123"
}


**Output:**```json
{
  "members": [
    {
      "id": "member123",
      "displayName": "John Doe",
      "userId": "user456",
      "email": "john.doe@company.com",
      "roles": ["owner"]
    }
  ],
  "count": 1
}

4. teams_get_profile

Return the authenticated Teams user's profile.

Scopes Required: User.Read

Input:```json
{
"userId": "user123"
}


**Output:**```json
{
  "id": "user123",
  "displayName": "John Doe",
  "givenName": "John",
  "surname": "Doe",
  "userPrincipalName": "john.doe@company.com",
  "mail": "john.doe@company.com",
  "jobTitle": "Software Engineer",
  "officeLocation": "Building 1",
  "mobilePhone": "+1234567890",
  "businessPhones": ["+1234567890"]
}

Architecture```

┌─────────────────┐
│ Frontend │
│ (ZeroTwo) │
└────────┬────────┘
│
│ OAuth Flow
▼
┌─────────────────┐ ┌──────────────────┐
│ Teams MCP │◄────►│ Microsoft OAuth │
│ Server │ │ & Graph API │
└────────┬────────┘ └──────────────────┘
│
│ MCP Protocol
▼
┌─────────────────┐
│ Backend │
│ (ZeroTwoApi) │
└─────────────────┘


## Development

### Project Structure```
teams-mcp-server/
├── src/
│   ├── auth/
│   │   └── oauth-manager.ts    # OAuth token management
│   ├── config/
│   │   └── index.ts            # Configuration management
│   ├── teams/
│   │   └── client.ts           # Teams/Graph API wrapper
│   ├── mcp/
│   │   ├── server.ts           # MCP server implementation
│   │   └── tools.ts            # MCP tool definitions
│   ├── types/
│   │   └── index.ts            # TypeScript type definitions
│   ├── utils/
│   │   └── logger.ts           # Logging utility
│   ├── index.ts                # Entry point
│   └── worker.ts               # Cloudflare Worker entry
├── package.json
├── tsconfig.json
├── wrangler.toml
├── env.example
└── README.md

Scripts

  • npm run dev - Start development server with hot reload
  • npm run dev:worker - Start Cloudflare Workers development server
  • npm run build - Build TypeScript to JavaScript
  • npm run build:worker - Build for Cloudflare Workers (dry run)
  • npm start - Start production server
  • npm run deploy - Deploy to Cloudflare Workers
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Integration with ZeroTwoApi

To integrate this Teams MCP server with your ZeroTwoApi backend:

1. Update Frontend OAuth Configuration

In your frontend OAuth providers configuration, add Teams:```javascript
teams: {
provider: "teams",
clientId: import.meta.env.VITE_MICROSOFT_CLIENT_ID,
flowType: OAuthFlowType.REDIRECT,
scopes: [
"Chat.Read",
"ChannelMessage.Read.All",
"User.Read",
],
authEndpoint: "http://localhost:3003/oauth/authorize",
backendExchangeEndpoint: "/api/auth/teams/callback",
backendRefreshEndpoint: "/api/auth/teams/refresh",
mcpEnabled: true,
mcpEndpoint: "http://localhost:3003/mcp",
},


### 2. Update MCP Client Configuration

In your MCP client, add Teams MCP support:```javascript
// For Teams MCP
if (integration.provider === "teams") {
  endpointUrl = "http://localhost:3003/mcp";

  // Use OAuth token from profile
  if (integration.oauth_token) {
    transportOptions.headers = {
      Authorization: `Bearer ${integration.oauth_token}`,
      ...integration.headers,
    };
  }
}

3. Create MCP Integration

After OAuth authentication, create an MCP integration in the database:sql INSERT INTO mcp_integrations ( user_id, name, provider, endpoint, mcp_type, connection_status, auth_type, description ) VALUES ( 'user_id_here', 'Microsoft Teams', 'teams', 'http://localhost:3003/mcp', 'remote_mcp', 'connected', 'oauth', 'Microsoft Teams integration via MCP' );

Microsoft Graph API

This server uses Microsoft Graph API to interact with Teams:

  • Base URL: https://graph.microsoft.com/v1.0
  • Documentation: Microsoft Graph API Reference

Common Graph API Endpoints Used

  • GET /me - Get user profile
  • GET /me/chats - List user's chats
  • GET /chats/{chat-id}/messages - Get chat messages
  • GET /chats/{chat-id}/members - Get chat members
  • GET /teams/{team-id}/channels/{channel-id}/messages - Get channel messages

Security Considerations

  1. OAuth Tokens: Tokens are stored in memory (Node.js) or KV (Cloudflare). For production, ensure proper encryption.
  2. CORS: Configure CORS origins appropriately for production.
  3. HTTPS: Use HTTPS in production for secure communication.
  4. Environment Variables: Never commit .env files. Use secure secret management in production.
  5. Rate Limiting: Implement rate limiting for production deployments.
  6. Scope Minimization: Only request the minimum scopes needed for your use case.

Troubleshooting

OAuth Errors

  • "Missing required environment variables": Check your .env file has all required variables
  • "Failed to exchange authorization code": Verify your redirect URI matches exactly in Azure Portal
  • "Token expired": The server automatically refreshes tokens if a refresh token is available
  • "Insufficient privileges": Ensure you've granted admin consent for the required API permissions

MCP Connection Issues

  • "No valid session ID": Ensure the MCP client sends proper session headers
  • "Authentication required": User needs to complete OAuth flow first

Graph API Errors

  • "Access denied": Check that the required permissions are granted and consented
  • "Resource not found": Verify the chat/channel/team IDs are correct
  • "Throttling": Microsoft Graph has rate limits. Implement backoff and retry logic.

Rate Limits

Microsoft Graph API has rate limits:
- Per-app throttling: Varies by endpoint
- Per-user throttling: Varies by endpoint

See Microsoft Graph throttling guidance for details.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Powered by ZeroTwo

This Microsoft Teams MCP connector is part of the ZeroTwo AI platform — the all-in-one AI workspace that lets you send messages, manage channels, and automate your Teams collaboration through GPT-5, Claude, and Gemini.

🌐 ZeroTwo — All AI Models in One App · Collaborate in Microsoft Teams with GPT-5, Claude, and Gemini — all in one workspace.
✨ ZeroTwo Features · AI messaging, document analysis, web search, and MCP-powered Teams collaboration tools.
🤖 AI Models — GPT-5, Claude & Gemini · Use the world's best AI to draft messages, summarize chats, and manage team channels.
🔌 ZeroTwo Connectors & Integrations · Connect Teams, Outlook, SharePoint, Gmail, and more to your AI workflow.
💰 ZeroTwo Pricing · One subscription that replaces ChatGPT Plus, Claude Pro, and Gemini Advanced.
📝 ZeroTwo Blog · AI team collaboration tips, Microsoft 365 guides, and ZeroTwo product updates.
🚀 Try ZeroTwo Free · Let AI supercharge your Teams workflow — get started free today.

> Built for ZeroTwo — Use this Microsoft Teams MCP server with ZeroTwo's AI connector system to send messages, manage channels, and automate your team communication through natural language.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
Teams MCP Server 4186f5a0 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Teams MCP Server 4186f5a0 怎么在 Claude 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Teams MCP Server 4186f5a0 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Teams MCP Server 4186f5a0 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Teams MCP Server 4186f5a0 支持哪些客户端?

资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Teams MCP Server 4186f5a0 能提供哪些能力?

资料显示约 4 个工具;能力标签包括 会话管理、TypeScript开发、Claude、OAuth认证。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。