teams-mcp
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.
teams-mcp
English | 中文
An MCP server for Microsoft Teams that works with personal accounts (Teams free, i.e. Outlook / Hotmail / Live) and work or school accounts, with several accounts signed in at once.
No Azure app registration and no browser automation. You sign in with a device code (open a URL, type a short code; works from a phone too), and tokens renew themselves after that.
143 tools: chats, messages, contacts, presence, search, images / files / GIFs, meetings and calendar, call history, Teams free communities, teams and channels, team management, plus raw escape hatches.
68 tools are verified on a real personal account (marked "tested" below). The work-account tools follow the Teams web client's own APIs but have not been tested on a real work tenant yet.
Install
git clone https://github.com/zongwei-tang/teams-mcp.git && cd teams-mcp
npm install && npm run buildRequires Node.js 22+.
Related MCP server: Teams MCP
Connect an MCP client
Claude Code:
claude mcp add teams -- node /absolute/path/to/teams-mcp/dist/index.jsClaude Desktop, Cursor and others (mcpServers config):
{
"mcpServers": {
"teams": { "command": "node", "args": ["/absolute/path/to/teams-mcp/dist/index.js"] }
}
}Remote (HTTP)
teams-mcp serve offers the same tools over Streamable HTTP at /mcp. Every request needs Authorization: Bearer <TEAMS_MCP_TOKEN>:
TEAMS_MCP_TOKEN=$(openssl rand -hex 32) node dist/index.js serve --port 8080 # listens on 127.0.0.1 by defaultExpose it over HTTPS only. Put it behind a reverse proxy such as Caddy or nginx, or deploy to a platform that terminates HTTPS. Do not open port 8080 to the internet: plain HTTP leaks the token and your messages.
The token is your Teams account. Whoever has it can read and send messages as you. Use at least 32 random characters, and keep it out of code and screenshots.
In remote mode, file tools only read and write inside
TEAMS_MCP_FILES_DIR(default<data dir>/files), and system paths such as/procare always refused.For clients that cannot send custom headers, set
TEAMS_MCP_ALLOW_PATH_TOKEN=1and use/mcp/<token>. The token then shows up in access logs, so only turn this on if you must.
The repo ships a Dockerfile for Railway and similar platforms. Set the variable TEAMS_MCP_TOKEN, mount a persistent volume at /data (accounts and tokens live there), and use /healthz as the health check path. After deploying, sign in once on the remote server with teams_login. Optionally, TEAMS_MCP_SEED_ACCOUNTS takes a base64-encoded accounts.json that is imported once when the volume is empty; delete the variable afterwards, because it contains refresh tokens.
Claude Code with a remote server:
claude mcp add --transport http teams https://<your-domain>/mcp --header "Authorization: Bearer <TEAMS_MCP_TOKEN>"Sign in
Ask the assistant to call teams_login (account_type personal or work). It shows a URL and a short code; open the URL on any device, enter the code and sign in to your Microsoft account, then the assistant calls teams_login_status to finish.
You can also sign in from a terminal:
node dist/index.js login personal # personal account
node dist/index.js login work # work/school account (optionally --tenant contoso.onmicrosoft.com)
node dist/index.js login work --graph # optional: add Microsoft Graph (permissions users can grant themselves: calendar, files, team lists)
node dist/index.js login work --graph-admin # optional: also permissions a tenant admin approves once (team/channel members and settings, tabs, tags, apps, channel messages, transcripts)
node dist/index.js accounts # list signed-in accountsWith several accounts, every tool takes an optional account argument, and teams_use_account sets the default. A personal and a work account with the same email are kept apart (the alias gets #work / #personal).
Accounts and tokens are stored in ~/.teams-mcp/accounts.json (mode 600, locked and merged when several processes use it; change the folder with TEAMS_MCP_HOME). teams_logout removes an account.
Personal vs. work accounts
Personal | Work | |
1:1 and group chats: send, edit, delete and restore, reactions, @mentions, forward, pin messages | ✓ | ✓ |
Unread, read receipts, mute, hide, pin chats, rename, add/remove members, invite links | ✓ | ✓ |
People search, contacts, blocking, profiles, presence read/write, status message | ✓ | ✓ (contacts, blocking: unknown) |
Full-text message search, file search by name | ✓ | ✓ (file search: personal only) |
Send images / files / GIFs, downloads, revoke sharing links | ✓ | ✓ |
Meet now, schedule / update / cancel meetings, rename and delete meeting links, recordings and transcripts | ✓ | ✓ |
Call history, activity feed (@mentions etc.) | ✓ | ✓ |
Teams, channels, posts and replies | ✓ Teams free "communities" | ✓ |
Scheduled messages, saved messages, followed threads, work location | — not offered by Teams free | ✓ |
Team / channel / member / tag / tab / app management (Graph) | — | ✓ ( |
Tools
"Personal" column: "✓ tested" = verified on a real personal account. "Work" column: "?" = unknown or not implemented for work accounts.
Accounts
Tool | Description | Personal | Work |
| Sign in to Microsoft Teams with a device code (no browser automation, no app registration), for personal accounts (Teams free: Outlook/Hotmail/Live) and work/school accounts. | ✓ tested | ✓ |
| Check (and optionally wait for) a device-code sign-in started with teams_login. | ✓ tested | ✓ |
| List signed-in Teams accounts (personal and work) and which one is the default. | ✓ tested | ✓ |
| Make an account the default for later calls. | ✓ | ✓ |
| Remove a signed-in account and its stored tokens from this machine. | ✓ | ✓ |
| Your Teams identity for an account: name, email, MRI (Teams user id), tenant, region. | ✓ tested | ✓ |
Chats and messages
Tool | Description | Personal | Work |
| List your conversations (1:1, group, meeting chats; channels for work accounts; Teams free communities and their channels for personal accounts), newest first, with last-message preview and unread flag. | ✓ tested | ✓ |
| Find existing chats by name or by the people in them, e.g. query "Family trip" or "Anna Ben", or people ["anna@contoso.com"]. | ✓ tested | ✓ |
| Details of a chat/channel thread: topic, type, creator, members (with names) and pinned messages. | ✓ tested | ✓ |
| Read messages from a conversation, newest first, optionally only between | ✓ tested | ✓ |
| Get one message (full content, reactions, files). | ✓ tested | ✓ |
| Send a message. | ✓ tested | ✓ |
| Forward a message to another chat, to people ( | ✓ tested | ✓ |
| Save a note in your own Teams self-chat ("Notes"/"Chat with yourself"). | ✓ tested | ✓ |
| Edit one of your messages. | ✓ tested | ✓ |
| Delete one of your messages (soft delete, like the Teams client; teams_undelete_message restores it). | ✓ tested | ✓ |
| Restore a message you deleted (undo teams_delete_message). | ✓ tested | ✓ |
| React to a message. | ✓ tested | ✓ |
| Remove your reaction from a message. | ✓ tested | ✓ |
| Pin or unpin a message at the top of a chat. | ✓ tested | ✓ |
| Mark a conversation read (up to a message, default the latest). | ✓ tested | ✓ |
| Mark many conversations read in one go: the ones given, or every unread conversation when none are given. | ✓ | ✓ |
| Mark a conversation as unread. | ✓ tested | ✓ |
| Unread conversations with their latest messages — a quick "catch me up". | ✓ tested | ✓ |
| Start a chat with people by email/name/MRI; your existing 1:1, or a group chat with exactly these people (and this topic), is reused (existing:true when one was found), else a new chat is created. | ✓ | ✓ |
| Add a person to a group chat. | ✓ | ✓ |
| Remove a person from a group chat. | ✓ | ✓ |
| Leave a group chat. | ✓ | ✓ |
| Set a group chat topic/name. | ✓ | ✓ |
| Mute or unmute notifications for a conversation. | ✓ tested | ✓ |
| Hide or unhide a chat in your chat list; a hidden chat reappears when a new message arrives. | ✓ tested | ✓ |
| Who has read how far in a chat (read receipts / consumption horizons). | ✓ tested | ✓ |
| Show a typing indicator in a chat. | ✓ tested | ✓ |
| Wait (up to ~110s) for a new message in a conversation after a given message id/time. | ✓ tested | ✓ |
| Your activity feed: @mentions, replies, reactions and other notifications, with where they happened. | ✓ tested | ✓ |
| Mark activity-feed items (ids from teams_get_activity) read or unread. | ✓ | ✓ |
| Messages you saved/bookmarked (work accounts). | — | ✓ |
| Save (bookmark) or unsave a message. | ✓ tested | ✓ |
| Channel threads you follow (work accounts). | — | ✓ |
| Your recent calls: direction, 1:1 or group, accepted/missed/declined, times, duration and the people. | ✓ tested | ✓ |
| Export a conversation history to a Markdown file on disk (oldest first). | ✓ tested | ✓ |
| Build a Teams deep link to a chat or message. | ✓ tested | ✓ |
| Get, enable or disable the invite link of a group chat or community, which anyone you share it with can use to join. | ✓ tested | ✓ |
| Join a group chat or community from an invite link someone shared (https://teams.live.com/l/…). | ✓ | ✓ |
| Schedule a message that Teams sends later by itself (no client needs to be running); returns its draftId. | — | ✓ |
| Your scheduled messages that have not been sent yet, with draftId, chat and send time. | — | ✓ |
| Cancel a scheduled message (draftId from teams_list_scheduled_messages). | — | ✓ |
People, contacts, presence, search
Tool | Description | Personal | Work |
| Find people by name, email or phone (+country code); returns MRIs usable in other tools. | ✓ tested | ✓ |
| Profiles (name, email, title, department) for one or more people by MRI, object id, email or name. | ✓ tested | ✓ |
| People you interact with most. | ✓ tested | ✓ |
| Your Teams contacts (buddy list), with addresses from their profiles. | ✓ tested | ? |
| Add a person (MRI, email or name) to your Teams contacts. | ✓ | — |
| Remove a person from your Teams contacts. | ✓ | — |
| People you have blocked. | ✓ tested | ? |
| Block a person so they cannot message or call you, or unblock them with blocked: false. | ✓ | ? |
| Get the 1:1 chat with someone (creates it if needed) — returns a conversation id. | ✓ tested | ✓ |
| Presence (Available/Busy/Away/DoNotDisturb/Offline…), status note, out-of-office and work location for people, or for you when people is omitted. | ✓ tested | ✓ |
| Set your presence, optionally for N minutes; "Reset" returns to automatic (the result says how). | ✓ tested | ✓ |
| Your own presence settings: forced status and when it ends, status message, out-of-office, work location. | ✓ tested | ✓ |
| Set (or clear with empty text) your Teams status message. | ✓ tested | ✓ |
| Set where you work (Office, Remote, TimeOff; Unknown clears it), shown on your presence card until the end of today or | — | ✓ |
| Full-text search of your Teams messages, optionally by sender, chat and date; results carry conversationId, messageId and fromMri. | ✓ tested | ✓ |
| Find files shared in your chats by file name, with the shareUrl or conversation and message ids teams_download_file takes. | ✓ tested | — |
Images, files, GIFs
Tool | Description | Personal | Work |
| Upload a local image (png/jpg/gif/webp/bmp) and post it inline into a chat, with an optional caption; animated GIFs stay animated. | ✓ tested | ✓ |
| Upload a local file (any type, any size) and post it into a chat or channel as a file card. | ✓ tested | ✓ |
| Download a file, image, video clip or voice message shared in Teams (Skype-era media too) to a local path, or a directory ending in /. | ✓ tested | ✓ |
| Files, images, video clips and voice messages shared in a conversation (newest first, Skype-era media too), with the links teams_download_file needs. | ✓ tested | ✓ |
| Files you uploaded to chats (your OneDrive "Microsoft Teams Chat Files" folder), newest first, with their sharing links (who can open them). | ✓ tested | ✓ |
| Stop sharing a file in your OneDrive (e.g. one sent with teams_send_file) by removing all its sharing links and grants, or only permission_id from teams_list_sent_files; people in the chat can no longer open it. | ✓ tested | ✓ |
| Post an existing OneDrive file into a chat as a file card, found by item_id, path (e.g. "Documents/cv.pdf") or a search query. | ✓ | ✓ |
| Search Giphy GIFs the way the Teams GIF picker does; returns urls for teams_send_gif. | ✓ tested | ✓ |
| Post a Giphy GIF into a chat: give url (with title/width/height from teams_search_gifs), or query to send the top result. | ✓ tested | ✓ |
| Forward the images and video clips of a message to another chat; the media service re-shares them so the new chat can see them. | ✓ tested | ✓ |
| Captions (transcript text) of a video message, by conversation_id + message_id or the video url, with its status and language. | ✓ | ✓ |
Teams, channels and Teams free communities
Tool | Description | Personal | Work |
| Teams you belong to, with their channels. | ✓ tested | ✓ |
| Channels of one team (work) or community (Teams free). | ✓ | ✓ |
| Find channels by (part of) the channel or team name, among your teams (work) or communities (Teams free). | ✓ | ✓ |
| Posts in a channel, each with its replies: the newest, older ones (before_post_id) or the ones around a message (around_message_id). | ✓ | ✓ |
| Replies in one channel thread, oldest first: all of them up to | ✓ | ✓ |
| Start a new post (thread) in a channel or community, optionally with a subject. | ✓ | ✓ |
| Reply in a channel or community thread (both account kinds). | ✓ | ✓ |
| Pinned posts of a channel or community: rules, links, announcements (both account kinds). | ✓ | ✓ |
| Pin or unpin a post in a channel or community; needs permission to pin (both account kinds). | ✓ | ✓ |
| Your pinned (favourite) chats and channels: the Favorites folder of your Teams sidebar (both account kinds). | ✓ tested | ✓ |
| Pin (favourite) or unpin a chat or channel in the Favorites of your sidebar (both account kinds). | ✓ tested | ✓ |
| Tags of a team (for @tag mentions); needs the team group id (work/school accounts). | — | ✓ |
| Your organisation's custom emoji (work/school accounts; Teams free has none). | — | ✓ |
| Details of a Teams free community, or of a work team thread: description, join settings, channels and (Teams free) its guidelines. | ✓ | ✓ |
| Members of a community, team or channel with their roles, one page at a time (both account kinds). | ✓ | ✓ |
| Your pending invitations to Teams free communities (personal accounts). | ✓ | — |
| Accept or decline an invitation to a Teams free community (personal accounts). | ✓ | — |
| Ask to join a Teams free community whose admins approve new members (personal accounts). | ✓ | — |
| Pending requests to join a Teams free community you administer (personal accounts). | ✓ | — |
| Leave a Teams free community (personal accounts). | ✓ | — |
| A channel's email address and who may send to it (work/school accounts). | — | ✓ |
| Pending requests to join a team you own (work/school accounts). | — | ✓ |
| Approve or reject requests to join a team you own (work/school accounts). | — | ✓ |
| Find public teams in your organisation that you can join (work/school accounts). | — | ✓ |
| Join a public team or ask to join a private one; cancel: true withdraws your pending request (work/school accounts). | — | ✓ |
| Search channels across your organisation, including teams you are not in (work/school accounts). | — | ✓ |
Meetings and calendar
Tool | Description | Personal | Work |
| Calendar meetings in a time range (default: 7 days from start), with join links, meeting chat ids and whether you organise them; personal and work accounts. | ✓ tested | ✓ |
| One calendar meeting in detail (event_id from teams_list_meetings): attendees with their responses, agenda, join link and chat id, times in UTC. | ✓ tested | ✓ |
| Create an instant Teams meeting and get its join link, short link, meeting code, chat id and update_url (for renaming or deleting the link). | ✓ tested | ✓ |
| Schedule a Teams meeting in your calendar and invite attendees by email (personal: a scheduled Teams free meeting, or as fallback a meeting link in an Outlook.com event, "via" says which; work: an Outlook/Teams meeting). | ✓ tested | ✓ |
| Reschedule or edit a meeting you organise (personal and work accounts): subject, start/end, location, agenda (replaces the description, keeps the join link), add/remove attendees by email; attendees get the update. | ✓ tested | ✓ |
| Accept, tentatively accept or decline a meeting invitation (event_id from teams_list_meetings); the organizer is notified. | ✓ | ✓ |
| Cancel a meeting you organise (attendees are notified), or delete it if nobody else is invited; for invitations use teams_respond_to_meeting decline. | ✓ tested | ✓ |
| Suggest times when you and the attendees are free, with each attendee's availability (work accounts). | — | ✓ |
| Meetings you are in, from their meeting chats (works when the calendar is empty): title, type, join link, meeting code and chat id; give thread_id or a pasted join_url for one meeting. | ✓ tested | ✓ |
| Rename a meeting link (Meet now / Teams free meeting) and its chat, identified by thread_id, meeting_code or update_url from teams_meet_now. | ✓ tested | ? |
| Delete a meeting link you created so nobody can join it any more (the chat stays), identified by thread_id, meeting_code or update_url. | ✓ tested | ? |
| Read a meeting's options (lobby, who can present, …) by meeting_code, join_url or thread_id, and change them with set {"": value} if you organise it. | ✓ | — |
| Recordings and transcripts posted in a meeting chat (or, without conversation_id, your recent meeting chats), newest first, with video and transcript links (download videos with teams_download_file). | ✓ tested | ✓ |
| Transcript (speakers + text) of a recorded meeting by thread_id: work from the recording in OneDrive/SharePoint or the meeting chat, personal (Teams free) from the meeting chat. | ✓ | ✓ |
Team management (Microsoft Graph) and escape hatches
Tool | Description | Personal | Work |
| Team details and settings (work/school, Graph). | — | ✓ |
| Create a new team; you become its owner (work/school, Graph). | — | ✓ |
| Copy a team (channels, tabs, settings, apps and/or members) into a new team (work/school, Graph; asynchronous). | — | ✓ |
| Status of an asynchronous team operation (create, clone, archive); once it succeeded, targetResourceId is the team's group id (work/school, Graph). | — | ✓ |
| Rename a team or change its description or visibility (work/school, Graph). | — | ✓ |
| Archive or unarchive a team (work/school, Graph, owners only). | — | ✓ |
| Members and owners of a team (work/school, Graph). | — | ✓ |
| Add someone to a team (work/school, Graph, owners only). | — | ✓ |
| Remove someone from a team (work/school, Graph, owners only). | — | ✓ |
| Make a team member an owner or a plain member; with channel_id, in a private/shared channel (work/school, Graph, owners only). | — | ✓ |
| Create a channel in a team (work/school, Graph). | — | ✓ |
| Rename a channel or change its description (work/school, Graph). | — | ✓ |
| Delete a channel (work/school, Graph). | — | ✓ |
| Members of a (private/shared) channel (work/school, Graph). | — | ✓ |
| Add a team member to a private/shared channel (work/school, Graph). | — | ✓ |
| Remove someone (or "me") from a private/shared channel (work/school, Graph). | — | ✓ |
| Leave a private or shared channel (work/school); standard channels follow team membership. | — | ✓ |
| Files in a channel's SharePoint folder (work/school, Graph). | — | ✓ |
| Tabs pinned in a channel (work/school, Graph). | — | ✓ |
| Pin a website as a tab in a channel (work/school, Graph). | — | ✓ |
| Apps installed in a team (work/school, Graph). | — | ✓ |
| Apps installed for you personally in Teams (work/school, Graph). | — | ✓ |
| Create a team tag for @-mentioning a group of members (work/school, Graph). | — | ✓ |
| Who is in a team tag (work/school, Graph). | — | ✓ |
| Rename a team tag, change its description, or add and remove its members (work/school, Graph). | — | ✓ |
| Delete a team tag (work/school, Graph). | — | ✓ |
| Channel messages via Microsoft Graph, an alternative to teams_get_channel_posts with reply counts (work/school). | — | ✓ |
| Escape hatch, read only: GET any Teams/Graph endpoint with this account's credentials. | ✓ tested | ✓ |
| Escape hatch: call any Teams/Graph endpoint with any method (it can change or delete data); prefer teams_raw_get for reads. | ✓ tested | ✓ |
How it works
Sign-in: OAuth 2.0 device code with the public client ids of Microsoft's own Teams clients (personal:
8ec6bc83-…, tenantconsumers; work:1fec8e78-…). The optional Graph sign-in uses Microsoft Graph Command Line Tools (14d82eec-…).Tokens: the refresh token is exchanged on demand for access tokens to each service (chat service, middle tier, presence, CSA, Substrate, Graph), and for a Skype token to reach the chat service. Expired tokens and 401s trigger one refresh (concurrent requests share it) and a retry.
APIs: the chat service
…/v1/users/ME/conversations/…(the same for both account types; the host comes fromregionGtms, and cross-region redirects are followed). Personal accounts also useteams.live.com/api/mt(people, contacts, meetings),/ups/global(presence),/api/csa(communities, pins),msgsearch.skype.com(Teams free search) and Microsoft Graph (OneDrive, Outlook calendar).Security: tokens only go to the account's own Microsoft service hosts. The chat service, Graph and media service each have a host allowlist, so links from tool arguments or message content are never fetched with credentials, and credentials are dropped on cross-origin redirects.
Caveats
Unofficial project. Not affiliated with or endorsed by Microsoft. "Microsoft Teams" is a trademark of Microsoft.
It signs in as Microsoft's own Teams client (its public client ids and a browser User-Agent) and calls undocumented internal APIs. This may break the Microsoft Services Agreement or your organisation's policies, and accounts can be restricted. Use it at your own risk.
For a work account, check that your employer / IT allows it first. Device-code sign-ins raise security alerts in some organisations, and some block them with Conditional Access.
Once connected to an AI assistant, your messages are sent to that model provider, and a remote deployment stores your sign-in on the server. Messages others send you can carry instructions aimed at the AI (prompt injection), so watch what the assistant is about to do before it sends or deletes anything.
Do not use it for mass messaging, spam or harassment.
Microsoft can change these internal APIs at any time.
Write actions (sending, deleting, changing members, blocking) take effect for real.
On personal accounts, a forced status such as Busy is only visible to others while one of your Teams clients is online;
teams_set_presencewithResetgoes back to automatic.Files sent from a personal account are OneDrive "anyone with the link can view" shares, as Teams free itself does;
teams_revoke_file_linkstops sharing.
Tests
npm test # the full call chain against a fake Microsoft (about 200 tests)Credits
Protocol details were adapted from these MIT projects: m0nkmaster/msteams-mcp (work-account internal APIs), floriscornel/teams-mcp (Graph tools) and Yannicked/NoSlacking (Teams free protocol verified on real personal accounts). The personal-account sign-in first appeared in EionRobb/purple-teams.
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.
Messaging tools for AI agents: send messages, manage chats, groups and channels.
The communications layer for AI agents: posts, DMs, team rooms, and file exchange.
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 interact with Microsoft Teams and Microsoft Graph APIs, covering channel and chat messaging, message search with KQL, file uploads and hosted content downloads, and user or organizational directory lookups. It also handles OAuth device-code authentication, rich Markdown formatting, and converts Teams HTML into LLM-friendly Markdown.12 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Microsoft Teams and Microsoft Graph APIs for user, team, channel, chat, message search, file, and attachment management. Supports authentication, rich Markdown formatting, and LLM-friendly content conversion.12 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Microsoft Teams and Microsoft Graph, covering chats and channel messaging, message search, user and team member lookups, and file upload or attachment downloads. Supports OAuth device-code authentication, rich Markdown formatting, and LLM-friendly conversion of Teams HTML into Markdown.12 npmMIT