{
  "markdown": "# Teams MCP Server\n\nThe 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.\n\nRead messages, list channels, search across Teams, send messages — all from Claude Code, Claude Desktop, or Claude Cowork.\n\nBuilt by [SurgeEnterpriseAI](https://github.com/SurgeEnterpriseAI).\n\n## How It Works\n\n```\n┌─────────────┐     Click \"Connect\"     ┌──────────────────────┐\n│ Claude User  │ ──────────────────────► │ Teams MCP Server     │\n│ (Cowork/     │                         │ (hosted by Surge)    │\n│  Desktop/    │     SSE/MCP Protocol    │                      │\n│  Code)       │ ◄─────────────────────► │  ┌────────────────┐  │\n└─────────────┘                          │  │ OAuth (common)  │  │\n                                         │  │ Any M365 user   │  │\n       User signs in with their          │  │ can sign in     │  │\n       own Microsoft account             │  └───────┬────────┘  │\n       ─────────────────────►            │          │           │\n                                         │  ┌───────▼────────┐  │\n                                         │  │ Microsoft       │  │\n                                         │  │ Graph API       │  │\n                                         │  └────────────────┘  │\n                                         └──────────────────────┘\n```\n\n**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.\n\n## Features\n\n- **One-click connect** — visit `/connect`, sign in with Microsoft, done\n- **Multi-tenant** — any Microsoft 365 organization, any user\n- **11 tools** — teams, channels, messages, chats, search, profile\n- **Dual transport** — STDIO for Claude Code, HTTP/SSE for Cowork & remote\n- **Multi-user** — each session gets isolated OAuth tokens\n- **Auto-detect** — picks the right transport based on launch method\n- **Token caching** — silent refresh, no re-login every session\n- **Retry logic** — automatic retries on throttled Graph API calls\n- **TypeScript** — fully typed, clean architecture, MIT licensed\n\n## For Users: Connect in 1 Click\n\nIf someone is already hosting this server (e.g., on `https://teams-mcp.surgeai.com`):\n\n1. Claude asks you to connect Microsoft Teams\n2. You click the auth link\n3. Sign in with your Microsoft work account\n4. Done — Claude can now read your Teams\n\nNo API keys, no Azure portal, no setup.\n\n## For Developers: Self-Host\n\n### 1. Clone & Install\n\n```bash\ngit clone https://github.com/SurgeEnterpriseAI/teams-mcp-server.git\ncd teams-mcp-server\nnpm install\nnpm run build\n```\n\n### 2. Azure AD App Registration\n\n1. Go to [Azure Portal](https://portal.azure.com) → **App registrations** → **New registration**\n2. Name: `Teams MCP Server`\n3. **Supported account types: \"Accounts in any organizational directory (Any Azure AD directory - Multitenant)\"**\n4. Redirect URI: **Web** → `https://your-server.com/auth/callback`\n5. Click **Register**\n\nConfigure:\n\n- **Certificates & secrets** → New client secret → copy the Value\n- **API Permissions** → Add Delegated (Microsoft Graph):\n  - `ChannelMessage.Read.All`, `ChannelMessage.Send`\n  - `Chat.Read`, `Chat.ReadWrite`, `ChatMessage.Send`\n  - `Team.ReadBasic.All`, `Channel.ReadBasic.All`\n  - `User.Read`\n- Click **Grant admin consent** (for your own tenant; other tenants consent on first login)\n\n### 3. Configure & Deploy\n\n```bash\ncp .env.example .env\n# Set TEAMS_CLIENT_ID, TEAMS_CLIENT_SECRET\n# Set BASE_URL and REDIRECT_URI to your production URL\n# TEAMS_AUTHORITY=common (multi-tenant, default)\n```\n\nDeploy to Railway, Render, Azure App Service, or any Node.js host:\n\n```bash\n# Railway\nrailway login && railway init && railway up\n\n# Or Azure\naz webapp up --name teams-mcp-server --runtime \"NODE:20-lts\"\n\n# Or just run directly\nTRANSPORT_MODE=http node dist/index.js\n```\n\n### 4. Submit to MCP Registry\n\nOnce 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.\n\n## For Claude Code Users: Local STDIO Mode\n\nAdd to your `.mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"teams\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/teams-mcp-server/dist/index.js\"],\n      \"cwd\": \"/path/to/teams-mcp-server\"\n    }\n  }\n}\n```\n\nFirst run will open your browser for Microsoft login. After that, tokens are cached.\n\n## Available Tools\n\n| Tool | What it does |\n|------|-------------|\n| `teams_list_teams` | List all your Teams |\n| `teams_list_channels` | List channels in a team |\n| `teams_read_channel_messages` | Read recent channel messages |\n| `teams_send_channel_message` | Send a message to a channel |\n| `teams_reply_to_message` | Reply in a channel thread |\n| `teams_read_message_replies` | Read thread replies |\n| `teams_list_chats` | List your DMs and group chats |\n| `teams_read_chat_messages` | Read messages from a chat |\n| `teams_send_chat_message` | Send a direct/group chat message |\n| `teams_search_messages` | Search messages across all Teams |\n| `teams_get_profile` | Get your Microsoft 365 profile |\n\n## Architecture\n\n```\nsrc/\n├── index.ts               Main entry (auto-detects transport)\n├── config.ts              Central configuration\n├── logger.ts              Structured logging\n├── types.ts               TypeScript interfaces\n├── sessions.ts            Multi-user session manager\n├── auth/\n│   ├── oauth.ts           MSAL OAuth (multi-tenant, per-user)\n│   └── token-store.ts     Persistent token cache\n├── graph/\n│   ├── client.ts          Graph HTTP client with retries\n│   ├── teams.ts           Teams & channels API\n│   ├── messages.ts        Channel messages API\n│   ├── chats.ts           DM & group chat API\n│   └── search.ts          Search & profile API\n├── mcp/\n│   ├── server.ts          MCP server factory\n│   └── tools/             11 tool definitions\n├── transport/\n│   ├── stdio.ts           STDIO (Claude Code)\n│   └── http.ts            Express + SSE (Cowork / remote)\n```\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `TEAMS_CLIENT_ID` | Yes | — | Azure AD app client ID |\n| `TEAMS_CLIENT_SECRET` | Yes | — | Azure AD client secret |\n| `TEAMS_AUTHORITY` | No | `common` | `common` for multi-tenant, or a specific tenant ID |\n| `TRANSPORT_MODE` | No | `auto` | `auto`, `stdio`, or `http` |\n| `PORT` | No | `3000` | HTTP server port |\n| `BASE_URL` | No | `http://localhost:3000` | Public URL |\n| `REDIRECT_URI` | No | `{BASE_URL}/auth/callback` | OAuth callback URL |\n| `TOKEN_STORE_PATH` | No | `./.data/tokens` | Token cache directory |\n| `LOG_LEVEL` | No | `info` | Logging level |\n\n## License\n\nMIT — [LICENSE](LICENSE)\n\n## Contributing\n\nIssues and PRs welcome. Built by [SurgeEnterpriseAI](https://github.com/SurgeEnterpriseAI).\n",
  "bytes": 7018,
  "sha": "eb886d4a6a6bb1e9de60f4eead420f0302c648cddcafa06fc1a5f7e062392746",
  "repo_slug": "surgeenterpriseai/teams-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_surgeenterpriseai_teams_mcp_se_87f3b94f/readme"
}