# Microsoft Teams API

> Microsoft Teams API is an MCP server for communication. Read Teams chats, send messages and search colleagues from an AI agent over stdio. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** macOS, Windows, Linux, CLI
- **Repository:** https://github.com/maxim-mazurok/teams-api
- **MCP Registry name:** io.github.Maxim-Mazurok/teams-api
- **Categories:** [communication](https://ai-powered.com/categories/communication), [productivity](https://ai-powered.com/categories/productivity)
- **Listing updated:** 2026-11-15

## About

Authentication is the unusual part. Rather than registering an Azure app, it captures a token bundle from Teams web traffic via interactive browser login, an unattended FIDO2 auto-login on macOS, a Chrome debug session or a pre-existing Skype token. Tokens are cached in the macOS Keychain, Windows Credential Manager or Linux secret-tool. A corporate email is set in the TEAMS_EMAIL variable, and a TEAMS_REGION is needed when passing a token directly.

Beyond the MCP server, the package includes a CLI with commands such as listing conversations, a Node.js library and an optional agent skill. The README notes that the project was generated with Claude Opus 4.6 with human guidance and review, and it addresses an earlier Windows Defender false positive caused by a PowerShell DPAPI approach.

Install one-click in VS Code or Cursor, or add it to Claude Desktop, Claude Code or Windsurf with an npx command. It requires Node.js 18 or later.

## Features

- **Chat reading:** Reads conversations through the Teams Chat Service REST API.
- **Message sending:** Lets an agent reply and take part in team workflows.
- **People search:** Finds colleagues by name.
- **Several login modes:** Interactive, FIDO2 auto-login, debug session or direct token.
- **Secure token cache:** Uses the OS credential store on each platform.
- **CLI and library:** The same code is usable from a terminal or Node.js.

## Good for

- Summarise unread chats before a meeting
- Draft replies to a colleague's message
- Monitor a channel and alert on keywords
- Look up who someone is in the directory

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add teams-api --env TEAMS_TOKEN='<TEAMS_TOKEN>' --env TEAMS_BEARER_TOKEN='<TEAMS_BEARER_TOKEN>' --env TEAMS_SUBSTRATE_TOKEN='<TEAMS_SUBSTRATE_TOKEN>' --env TEAMS_IMAGE_DESCRIPTION_API_KEY='<TEAMS_IMAGE_DESCRIPTION_API_KEY>' -- npx -y teams-api
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add teams-api --env TEAMS_TOKEN='<TEAMS_TOKEN>' --env TEAMS_BEARER_TOKEN='<TEAMS_BEARER_TOKEN>' --env TEAMS_SUBSTRATE_TOKEN='<TEAMS_SUBSTRATE_TOKEN>' --env TEAMS_IMAGE_DESCRIPTION_API_KEY='<TEAMS_IMAGE_DESCRIPTION_API_KEY>' -- npx -y teams-api
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.teams-api]
command = "npx"
args = ["-y", "teams-api"]
env = { TEAMS_TOKEN = "<TEAMS_TOKEN>", TEAMS_BEARER_TOKEN = "<TEAMS_BEARER_TOKEN>", TEAMS_SUBSTRATE_TOKEN = "<TEAMS_SUBSTRATE_TOKEN>", TEAMS_IMAGE_DESCRIPTION_API_KEY = "<TEAMS_IMAGE_DESCRIPTION_API_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e TEAMS_TOKEN='<TEAMS_TOKEN>' -e TEAMS_BEARER_TOKEN='<TEAMS_BEARER_TOKEN>' -e TEAMS_SUBSTRATE_TOKEN='<TEAMS_SUBSTRATE_TOKEN>' -e TEAMS_IMAGE_DESCRIPTION_API_KEY='<TEAMS_IMAGE_DESCRIPTION_API_KEY>' teams-api npx -- -y teams-api

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "teams-api": {
      "command": "npx",
      "args": [
        "-y",
        "teams-api"
      ],
      "env": {
        "TEAMS_TOKEN": "<TEAMS_TOKEN>",
        "TEAMS_BEARER_TOKEN": "<TEAMS_BEARER_TOKEN>",
        "TEAMS_SUBSTRATE_TOKEN": "<TEAMS_SUBSTRATE_TOKEN>",
        "TEAMS_IMAGE_DESCRIPTION_API_KEY": "<TEAMS_IMAGE_DESCRIPTION_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Which platforms work?

macOS, Windows and Linux; FIDO2 auto-login is macOS only.

### What do I need installed?

Node.js 18 or later.

### How do I log in?

Set TEAMS_LOGIN to true for interactive browser login, or use TEAMS_AUTO on macOS with a passkey.

### Is there a CLI?

Yes, run through npx for commands like auth and list-conversations.

### How do I add Microsoft Teams API to Claude Code?

Run this command in your terminal: claude mcp add teams-api --env TEAMS_TOKEN='<TEAMS_TOKEN>' --env TEAMS_BEARER_TOKEN='<TEAMS_BEARER_TOKEN>' --env TEAMS_SUBSTRATE_TOKEN='<TEAMS_SUBSTRATE_TOKEN>' --env TEAMS_IMAGE_DESCRIPTION_API_KEY='<TEAMS_IMAGE_DESCRIPTION_API_KEY>' -- npx -y teams-api

### What are the best alternatives to Microsoft Teams API?

The closest alternatives to Microsoft Teams API are Microsoft Teams MCP, Microsoft Teams, Cedric, message-cp and Awesome AI for Teams.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Microsoft Teams MCP](https://ai-powered.com/mcp/microsoft-teams-mcp): Microsoft Teams MCP is an open-source MCP server for communication.
- [Microsoft Teams](https://ai-powered.com/mcp/microsoft-teams-2): Microsoft Teams is an open-source MCP server for communication.
- [Cedric](https://ai-powered.com/mcp/cedric): Cedric is a freemium MCP server for productivity.
- [message-cp](https://ai-powered.com/mcp/message-cp): message-cp is an open-source MCP server for communication.
- [Awesome AI for Teams](https://ai-powered.com/mcp/awesome-ai-for-teams): Awesome AI for Teams is an open-source MCP server for communication.
- [Microsoft Todo MCP Server](https://ai-powered.com/mcp/microsoft-todo-mcp-server): Microsoft Todo MCP Server is an open-source MCP server for productivity.
- [Tuff](https://ai-powered.com/mcp/tuff): Tuff is a freemium MCP server for productivity.
- [Teamwork.com](https://ai-powered.com/mcp/teamwork-com): Teamwork.com is a freemium MCP server for productivity.

---
Source: https://ai-powered.com/mcp/microsoft-teams-api
