Microsoft Teams API — Claude Code MCP server setup
Connects Microsoft Teams with AI agents via the chat REST API. It lets your assistant check conversation feeds, post replies, and inspect members.
claude mcp add --env TEAMS_EMAIL=<TEAMS_EMAIL> --env TEAMS_AUTO=<TEAMS_AUTO> --env TEAMS_LOGIN=<TEAMS_LOGIN> --env TEAMS_TOKEN=<TEAMS_TOKEN> --env TEAMS_REGION=<TEAMS_REGION> --transport stdio microsoft-teams-api -- npx -y teams-apiWhat Microsoft Teams API does
This server exposes Teams chat endpoints directly to your coding assistant. The model can inspect channel discussions, send replies into ongoing threads, and monitor active workflows.
Node.js 18 or newer is mandatory to execute the package with npx. Authentication works interactively with TEAMS_LOGIN=true, or by passing tokens directly in the environment. On macOS systems with a FIDO2 passkey, setting TEAMS_AUTO enables non-interactive login.
Without valid credential tokens or login variables in the environment, the server fails during startup network calls.
What it helps with
- Read incoming messages across Teams conversations
- Post responses directly to discussions and threads
- Query team members and participant directories
- Automate chat interactions inside team workspaces
Example prompts for the agent
- Check the latest unread messages in the Teams engineering channel
- Send an update to our project chat with the release notes summary
- List all participants in the active team conversation
How to install Microsoft Teams API
Platform CLI
claude mcp add --env TEAMS_EMAIL=<TEAMS_EMAIL> --env TEAMS_AUTO=<TEAMS_AUTO> --env TEAMS_LOGIN=<TEAMS_LOGIN> --env TEAMS_TOKEN=<TEAMS_TOKEN> --env TEAMS_REGION=<TEAMS_REGION> --transport stdio microsoft-teams-api -- npx -y teams-apiReplace <…> with your own values. 8 more environment variables are in the server README
Platform CLI
codex mcp add microsoft-teams-api --env TEAMS_EMAIL=<TEAMS_EMAIL> --env TEAMS_AUTO=<TEAMS_AUTO> --env TEAMS_LOGIN=<TEAMS_LOGIN> --env TEAMS_TOKEN=<TEAMS_TOKEN> --env TEAMS_REGION=<TEAMS_REGION> -- npx -y teams-apiReplace <…> with your own values. 8 more environment variables are in the server README
Config file
{
"mcpServers": {
"microsoft-teams-api": {
"command": "npx",
"args": [
"-y",
"teams-api"
],
"env": {
"TEAMS_EMAIL": "<TEAMS_EMAIL>",
"TEAMS_AUTO": "<TEAMS_AUTO>",
"TEAMS_LOGIN": "<TEAMS_LOGIN>",
"TEAMS_TOKEN": "<TEAMS_TOKEN>",
"TEAMS_REGION": "<TEAMS_REGION>"
}
}
}
}Replace <…> with your own values. 8 more environment variables are in the server README
Config file
{
"servers": {
"microsoft-teams-api": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"teams-api"
],
"env": {
"TEAMS_EMAIL": "<TEAMS_EMAIL>",
"TEAMS_AUTO": "<TEAMS_AUTO>",
"TEAMS_LOGIN": "<TEAMS_LOGIN>",
"TEAMS_TOKEN": "<TEAMS_TOKEN>",
"TEAMS_REGION": "<TEAMS_REGION>"
}
}
}
}Replace <…> with your own values. 8 more environment variables are in the server README
Platform CLI
gemini mcp add -e TEAMS_EMAIL=<TEAMS_EMAIL> -e TEAMS_AUTO=<TEAMS_AUTO> -e TEAMS_LOGIN=<TEAMS_LOGIN> -e TEAMS_TOKEN=<TEAMS_TOKEN> -e TEAMS_REGION=<TEAMS_REGION> microsoft-teams-api npx -y teams-apiReplace <…> with your own values. 8 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Microsoft Teams API
How to install Microsoft Teams API in Claude Code?
Run `claude mcp add --env TEAMS_EMAIL=<TEAMS_EMAIL> --env TEAMS_AUTO=<TEAMS_AUTO> --env TEAMS_LOGIN=<TEAMS_LOGIN> --env TEAMS_TOKEN=<TEAMS_TOKEN> --env TEAMS_REGION=<TEAMS_REGION> --transport stdio microsoft-teams-api -- npx -y teams-api`. Replace placeholders with your actual settings.
What does the Microsoft Teams API server do?
It allows autonomous agents to interact with Teams via the Chat Service REST API. It handles fetching messages, sending replies, and managing conversation participants.
What are the requirements to run this server?
You need Node.js version 18 or later for npx. You must also supply authentication values such as TEAMS_LOGIN or preconfigured bearer tokens.