Microsoft Teams MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Microsoft Teams MCP Server & CLI
Direct AI Assistant Integration, EDU Assignment Automation & Standalone CLI for Microsoft Teams
Table of Contents
Related MCP server: Teams MCP
Overview
mcp-server-msteams connects Large Language Models (Claude, GPT, Gemini, DeepSeek) and command-line users directly to Microsoft Teams.
Why Choose mcp-server-msteams?
No Azure app registration: Use the Teams sign-in you already know. There is no separate Graph permission prompt or Azure application setup.
HTTP-first token refresh: Prefer direct Teams session refresh before launching Playwright when credentials already exist.
EDU Assignments: List coursework, read instructions, attach files, and verify the submitted state; check exact attachments manually for important work.
🐧 Full Linux & Windows Parity: Native cross-platform engine auto-detects Google Chrome, Brave, Microsoft Edge, and Chromium across distributions without hardcoded
.exeor OS paths.Local privacy: Session-state files use AES-256-GCM with a random per-install key. The key and browser cookies remain in your OS account, so protect your local profile.
🛠️ Dual Interface: Includes both an MCP stdio server for AI clients and the standalone
msteamsCLI for bash/zsh/PowerShell scripts.
Quick Start
npm-only installation (no Git clone, Azure CLI, or app registration):
npm install --global mcp-server-msteams
msteams login
msteams statusUninstall:
npm uninstall --global mcp-server-msteamsSource checkouts also provide scripts/install.ps1, scripts/uninstall.ps1, scripts/install.cmd, scripts/uninstall.cmd, scripts/install.sh, and scripts/uninstall.sh. See Uninstall and erase local sessions.
Publishing note: The updated version 1.0.6 must be published to npm separately before npm commands install these new changes.
1. Configure in AI MCP Clients
Add mcp-server-msteams to your AI client's configuration file. The client will launch the server on-demand via npx:
Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/.config/Claude/claude_desktop_config.json (Linux/macOS):
{
"mcpServers": {
"teams": {
"command": "npx",
"args": ["-y", "mcp-server-msteams@latest"]
}
}
}Cursor & Windsurf
Add to your project's .cursor/mcp.json or global MCP settings:
{
"mcpServers": {
"teams": {
"command": "npx",
"args": ["-y", "mcp-server-msteams@latest"]
}
}
}Local Clone Execution (For Local Development)
If you prefer to run from a local repository clone:
{
"mcpServers": {
"teams": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-msteams/dist/index.js"]
}
}
}2. Standalone Terminal CLI Usage
You can use all features directly from your command prompt without an AI client.
Method A: Direct Execution (Fastest — If Installed Globally)
Install once from NPM:
npm install -g mcp-server-msteamsThen run commands anywhere in your terminal:
# Check session status
msteams status
# Sign in to Teams (opens browser once)
msteams login
# List active coursework
msteams assignments --status activeMethod B: Running via NPX (Without Global Installation)
If you do not want to install globally, run using npx:
# Check session status
npx -y -p mcp-server-msteams msteams status
# Sign in to Teams (opens browser once)
npx -y -p mcp-server-msteams msteams login
# List active coursework
npx -y -p mcp-server-msteams msteams assignments --status active(Note for Windows Command Prompt users: In cmd.exe, do not paste bash comment lines starting with #).
Architecture & Data Flow
Protocol Layer: Standard JSON-RPC 2.0 over standard I/O (MCP specification compliant).
Session Engine:
Stores session state in
~/.teams-mcp-server/(Linux/macOS) or%APPDATA%\teams-mcp-server\(Windows).Local token database encrypted with authenticated AES-256-GCM.
Persistent browser profile preserves Microsoft SSO cookies, enabling silent headless re-authentication.
Multi-Service Cloud Gateway:
ChatSvc (
chatsvcagg.teams.microsoft.com): Real-time messaging, channels, direct chats, reactions.Substrate (
substrate.office.com): Microsoft 365 natural language search, Outlook emails, people graph.Assignments (
assignments.edu.cloud.microsoft): Coursework data, submission deadlines, rubrics.SharePoint downloads: Uses the existing local browser session for supported HTTPS SharePoint web links. No Graph token is requested.
CLI Commands vs MCP Tools Reference
The server exposes 30+ tools to AI agents via MCP, each available as a direct command in the msteams CLI:
Authentication & Session
MCP Tool Name | CLI Command | Parameters | Description |
|
| (None) | Check authentication status, tenant info, and token validity across all services. |
|
| (None) | Opens a visible browser window for Microsoft Teams login. Auto-saves session and closes. |
EDU Coursework & Assignments
MCP Tool Name | CLI Command | Parameters | Description |
|
|
| List coursework across classes with due dates, grades, and submission state. |
|
|
| Get detailed assignment instructions, attached files, rubrics, and submission info. |
|
|
| Upload and attach a local file directly to an assignment submission via Playwright automation, with optional instant turn-in. |
|
|
| Remove an uploaded attachment from a working submission. |
|
|
| Turn in an assignment, undo turn-in, or mark as viewed. |
Messaging & Chats
MCP Tool Name | CLI Command | Parameters | Description |
|
|
| Resolve or start a 1:1 direct chat with a person; returns conversation ID. |
|
|
| List recent conversations (1:1 chats, group chats, meetings, channels) newest activity first. |
|
|
| Read message history from a Teams conversation or channel thread. |
|
|
| Send a message to a conversation (defaults to self-notes |
|
|
| Get a single message by ID with full content and metadata. |
|
|
| Create a new group chat with multiple people. |
|
|
| Edit the text content of a message you previously sent. |
|
|
| Delete a message sent by you (soft delete). |
|
|
| Fetch unread conversation status across Teams or for a specific conversation. |
|
|
| Mark a conversation as read up to a specific message. |
|
|
| Block/poll until a new message arrives in a conversation. |
|
|
| Fetch your activity feed (mentions, reactions, replies, and notifications). |
|
|
| Search for emojis by name or keyword. |
|
|
| React to a message ( |
|
|
| Remove an emoji reaction from a message. |
|
|
| List messages bookmarked/saved by the user. |
|
|
| Bookmark/save a message in Teams. |
|
|
| Remove a saved bookmark from a message. |
|
|
| List channel threads you are following in Teams. |
Search & Directory
MCP Tool Name | CLI Command | Parameters | Description |
|
|
| Semantic natural language search across messages, chats, and channels with query operators. |
|
|
| Search your Exchange/Outlook inbox and sent mail from Teams context. |
|
|
| Find Teams channels by name. |
|
|
| Search institutional directory for colleagues, professors, and classmates by name or email. |
Files & Meeting Transcripts
MCP Tool Name | CLI Command | Parameters | Description |
|
|
| List files and links shared within a conversation with download URLs. |
|
|
| Download supported SharePoint web URLs with Playwright; Graph drive-item URLs are unsupported. |
|
|
| Retrieve upcoming and past calendar events and Teams meetings. |
|
|
| Download automated meeting transcripts with speaker timestamps. |
|
|
| Get channel tags for a Teams team (used for |
People & Contacts
MCP Tool Name | CLI Command | Parameters | Description |
|
| (None) | Get profile details, tenant ID, and email of the logged-in user. |
|
|
| Look up detailed job title, department, and contact info for people by MRI. |
|
|
| Get the list of contacts you interact with most frequently. |
|
| (None) | Get your favourite/pinned conversations in Teams. |
|
|
| Pin a conversation to favorites. |
|
|
| Remove a conversation from favorites. |
Step-by-Step Assignment Workflow
Here is how an AI assistant or student automates coursework using msteams:
Step 1: Check Coursework Deadlines
msteams assignments --status activeOutput returns all pending homework, modules, quizzes, and due dates across your enrolled classes.
Step 2: Read Detailed Instructions & Download Resources
msteams assignment --classId "19:abc...tacx" --assignmentId "a8f3b..."Returns assignment details and resource links. For downloads, only HTTPS SharePoint web URLs are supported; Graph drive-item links must be opened in Teams.
Step 3: Attach Local Submission File
# Attach file and optionally turn in immediately:
msteams attach_file \
--classId "19:abc...tacx" \
--assignmentId "a8f3b..." \
--filePath "/path/to/report.pdf" \
--turnInPlaywright waits for the file name to appear, then uses the Assignments API to verify turn-in state. Pass both --classId and --assignmentId with --turnIn. Filename presence alone is not definitive proof of the exact attachment; check Teams before relying on graded work.
Step 4: Undo Turn-In or Remove Attachment (If needed)
# Undo turn-in:
msteams submission_action --action unsubmit --classId "19:abc..." --assignmentId "a8f3b..." --submissionId "sub_01..."
# Remove attachment:
msteams remove_attachment --classId "19:abc..." --assignmentId "a8f3b..." --fileName "report.pdf"Linux Dual-Boot & Native Setup Guide
If you are using Linux (Ubuntu, Debian, Fedora, Arch, Manjaro, Pop!_OS) or testing on a dual-boot setup:
Prerequisites & Browser Installation
Ensure you have Node.js >= 20 and any Chromium-based browser installed:
1. Install Node.js 20+
# Ubuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs git
# Fedora
sudo dnf install -y nodejs git
# Arch Linux
sudo pacman -S nodejs npm git2. Install or Use Your Default Browser
mcp-server-msteams automatically detects your system's default browser directly from your operating system settings (via xdg-settings on Linux, UserChoice registry on Windows, or AppleScript on macOS).
It coordinates with:
Chromium-based: Google Chrome, Microsoft Edge, Brave, Opera, Vivaldi, Chromium
Non-Chromium: Mozilla Firefox (uses dedicated
browser-profile-firefoxsession with automated fallback to Chromium if remote debugging protocol is unavailable)
If you don't already have a browser installed on Linux, install any of the following:
# Option A: Google Chrome (Ubuntu / Debian)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
# Option B: Brave Browser (Ubuntu / Debian)
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update && sudo apt install -y brave-browser
# Option C: Mozilla Firefox (Ubuntu / Debian)
sudo apt install -y firefox
# Option D: Chromium (Ubuntu / Debian)
sudo apt install -y chromium-browser
# Option E: Microsoft Edge (Ubuntu / Debian)
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
sudo apt update && sudo apt install -y microsoft-edge-stableCloning & Local Verification
# 1. Clone repository
git clone https://github.com/kasim672/mcp-server-msteams.git
cd mcp-server-msteams
# 2. Install dependencies & build
npm install
npm run build
# 3. Run unit tests (574 tests)
npm test
# 4. Sign in to Teams (opens browser GUI)
node dist/cli.js login
# 5. Verify authentication status
node dist/cli.js statusEnvironment Variables
Configure optional overrides in your ~/.bashrc or ~/.zshrc:
Variable | Description | Example |
| Explicitly choose browser engine ( |
|
| Absolute path to custom browser executable. |
|
| Logging verbosity ( |
|
Windows Setup Guide
Ensure Node.js >= 20 is installed from nodejs.org.
Microsoft Edge is pre-installed on Windows 10/11 and is automatically detected. Brave and Google Chrome are also supported.
In PowerShell or Command Prompt:
# Clone and build
git clone https://github.com/kasim672/mcp-server-msteams.git
cd mcp-server-msteams
npm install
npm run build
npm test
# Initial login
node dist\cli.js login
# Check status
node dist\cli.js statusSession data on Windows is securely stored in %APPDATA%\teams-mcp-server\.
Development & Testing
# Run all unit tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run code coverage report
npm run test:coverage
# TypeScript type checking
npm run typecheck
# Code linting
npm run lintUninstall and erase local sessions
npm uninstall --global mcp-server-msteams removes the package, but preserves the local Teams session. To remove your cached credentials and persistent browser profile as well, from a source checkout:
# PowerShell: uninstall and erase local credentials
.\\scripts\\uninstall.ps1 -PurgeSessionREM CMD: uninstall only (retains the session)
scripts\\uninstall.cmd# Linux/macOS: uninstall and erase local credentials
sh scripts/uninstall.sh --purge-sessionWindows session directory: %APPDATA%\\teams-mcp-server. Unix: ~/.teams-mcp-server. Remove the MCP entry from your AI assistant's configuration separately; npm cannot edit every client's settings.
Privacy and limitations
No Microsoft Graph API, Graph-token exchange, separate Azure app registration, or Azure CLI is used. Teams still relies on Microsoft's normal sign-in service.
Session-state files and the browser profile are local. Requests still go to Microsoft, and AI assistants may transmit tool outputs to their model provider under the assistant's own privacy policy.
teams_download_filenow uses a signed-in browser to download SharePoint HTTPS links only. Some SharePoint viewers still need a manual download. Graph-style education attachmentfileUrlvalues are not supported.Existing GitHub Actions configuration was not expanded, and no new MCP capabilities were added.
Security & Encryption
No Third-Party Relays: Every API request communicates directly from your machine to Microsoft's official cloud endpoints (
*.microsoft.com,*.office.com).Encrypted Local Storage: Cached session-state files use AES-256-GCM and a random local
session.key, not a hostname-based key. Both the key and browser profile stay in the user directory; this is not hardware-backed protection. Version-1 encrypted files are still readable for migration.Owner-Only File Permissions: On Linux and macOS, the session directory is created with
0o700(rwx------) and files with0o600(rw-------).No Credential Escalation: The server operates strictly within the permissions of your logged-in Microsoft Teams account.
Troubleshooting & FAQ
Q: Browser fails to launch on Linux with "Missing $DISPLAY"?
mcp-server-msteams automatically detects headless Linux terminal environments and switches to headless mode. For the initial login (msteams login), ensure you are running in a desktop GUI environment (GNOME, KDE, XFCE, Sway) or pass an X11 forwarding session (ssh -X).
Q: "SingletonLock" error when starting browser?
If a browser session crashed unexpectedly, Chromium may leave behind a lock file. mcp-server-msteams automatically detects and clears stale SingletonLock files older than your running process. If needed, you can delete it manually:
# Linux / macOS
rm -f ~/.teams-mcp-server/browser-profile/SingletonLock
# Windows (PowerShell)
Remove-Item -Force "$env:APPDATA\teams-mcp-server\browser-profile\SingletonLock"Q: How do I completely reset my login session?
Delete the local configuration folder and run msteams login again:
# Linux / macOS
rm -rf ~/.teams-mcp-server
# Windows (PowerShell)
Remove-Item -Recurse -Force "$env:APPDATA\teams-mcp-server"License
This project is licensed under the MIT License. See the LICENSE file for details.
Developed and maintained by Kasim Ghanchi (@kasim672).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Permissioned access to Outlook, OneDrive and Teams via the user's own Microsoft account
Read email/chat conversations, messages, contacts and teams; draft, send and update threads.
Web search, data extraction and controlled browser automation for AI assistants via OAuth.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read and act on Microsoft Teams data through Microsoft Graph, covering team and channel operations, 1:1 and group chat messaging with rich formatting, message editing, deletion and search, file and image upload or download, and user directory lookups. Supports OAuth device-code authentication with token caching plus a read-only mode for safer, permission-limited access.12 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to access Microsoft Teams, chats, users, files, and organizational data via Microsoft Graph APIs, including messaging, search, attachment handling, and user management.12 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Microsoft Teams and Microsoft Graph for messaging, chat and channel operations, user and team discovery, file uploads/downloads, and advanced message search.12 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Microsoft Teams and Microsoft Graph data, including messaging, chat and channel operations, user search, file uploads, and message discovery via search.12 npmMIT