Microsoft Teams API
Read Teams chats, send messages and search colleagues from an AI agent over stdio
Microsoft Teams API is an MCP server for communication. It runs locally on your machine and is started by your AI client.
- Platforms
- macOS, Windows, Linux
- Runs
- Locally
- Version
- 1.10.1
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a 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-apiAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.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>"
}
}
}
}Add to claude_desktop_config.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.
Add to ~/.cursor/mcp.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.
Add to ~/.copilot/mcp-config.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.
Add with the CLI
Run in a terminal
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-apiOr add to config.toml
Add to ~/.codex/config.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>" }Add to your client's MCP settings (most use this shape)
{
"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>"
}
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.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
Antigravity
Add to ~/.gemini/config/mcp_config.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 (formerly Windsurf)
Add to ~/.config/devin/mcp_config.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
Add to cline_mcp_settings.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
Add to Zed settings.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
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "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.
Junie
Add to ~/.junie/mcp/mcp.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
Add to ~/.kiro/settings/mcp.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.
Using several servers? Build one config file with the MCP config generator.
Configuration
TEAMS_EMAILCorporate email address for Teams authenticationTEAMS_AUTOSet to "true" to use auto-login (macOS + FIDO2)TEAMS_HEADLESSSet to "true" to run FIDO2 auto-login without a visible browserTEAMS_LOGINSet to "true" to use interactive browser login (all platforms)TEAMS_TOKENPre-existing Skype token for direct authenticationTEAMS_REGIONAPI region (required with TEAMS_TOKEN, auto-detected otherwise)TEAMS_BEARER_TOKENMiddle-tier bearer token for profile resolutionTEAMS_SUBSTRATE_TOKENSubstrate bearer token for people/chat searchTEAMS_DEBUGSet to "true" to use Chrome debug session for token captureTEAMS_TELEMETRYSet to "true" to enable full debug telemetry logging (contributor use; logs all inputs and outputs locally)TEAMS_TELEMETRY_PATHOverride the telemetry output file path (default: platform-appropriate ~/Library/... or ~/.local/share/...)TEAMS_IMAGE_DESCRIPTION_API_KEYAPI key for the OpenAI-compatible vision endpoint used by teams_describe_imageTEAMS_IMAGE_DESCRIPTION_MODELModel name for teams_describe_image (defaults to gpt-4o-mini)TEAMS_IMAGE_DESCRIPTION_BASE_URLOpenAI-compatible base URL for teams_describe_image
About Microsoft Teams API
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.
What it does
- 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
Microsoft Teams API 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.
