TeamsBridgeMCP

Let your AI agent read chats, answer in channels, search messages, send files and check meetings in Microsoft Teams. It signs in like you do in the browser, so you need no app registration and no admin consent.

How it works

The Teams web client talks to a handful of HTTPS services with a bearer token it gets when you sign in. TeamsBridgeMCP opens that same sign-in in your own browser, keeps the tokens on your disk and makes the same calls on behalf of your agent.

Architecture: on your computer, the AI agent calls TeamsBridgeMCP over MCP stdio. The server reads the endpoint from endpoints.json and the bearer token from session.json, then calls the Teams web APIs, the search service and OneDrive in your Microsoft 365 tenant over HTTPS. Chrome or Edge signs in at Microsoft with password and MFA and saves the tokens to session.json; on HTTP 401 the server triggers a re-login.
Everything in the left frame runs on your machine. Diagram made with Archify.
  1. Sign in once. npm run login opens Chrome or Edge with a dedicated profile. You sign in as usual, MFA included. If Microsoft asks "Stay signed in?", say yes, otherwise the saved profile cannot renew the login on its own. The server reads the tokens from the app's own requests and writes them to data/session.json.
  2. Agent calls a tool. Your MCP client starts the server over stdio. Each tool looks up its HTTP request in data/endpoints.json, fills in your tenant values and sends it with your token.
  3. Tokens renew themselves. When a token is about to expire or a call returns 401, the server signs in again headless with the saved profile. A window only appears when Microsoft asks for your password or MFA. HTTP 403 is passed through as is: it means no access to that chat or a wrong region, and signing in again would not change it.

What your agent can do

ToolWhat it doesTry asking
list_chatsRecent chats, meeting chats and channels, newest first, with names for 1:1 chats"What happened in my chats this morning?"
list_channelsYour teams and their channels"Which channels does the Platform team have?"
list_messagesMessages of a chat or channel, including attached files, page by page into the past"Summarize the last 50 messages in #release."
send_messagePost to a chat or channel, or reply in a channel thread. Markdown (bold, italic, code, links, lists) is sent as Teams formatting, @name@contoso.com mentions the person"Reply in that thread that the fix is deployed and mention Alex."
edit_messageChange the text of one of your messages, attachments stay"Fix the typo in the message you just sent."
react_messageLike, heart, laugh and the other Teams reactions"Give Sam's announcement a like."
start_chatOpen a 1:1 or group chat by e-mail address"Start a chat with alex@contoso.com."
search_messagesFull-text search across chats and channels"Find where we discussed the budget freeze."
upload_fileUpload a local file to your OneDrive, share it with the chat members and post it"Send report.pdf to the project chat."
download_fileSave a file attached to a message (SharePoint or OneDrive links, up to 250 MB)"Download the slides Sam posted yesterday."
list_meetingsUpcoming meetings with time, organizer and join link"What meetings do I have tomorrow?"
teams_loginOpen the browser to sign in"Log me in to Teams."
teams_statusShow session and endpoint registry state"Is the Teams connection working?"

Why not Microsoft Graph?

Graph is the official route and the right one for products and anything an organization rolls out. It needs an app registration in Entra ID and, for most chat scopes, admin consent. TeamsBridgeMCP targets the single user who wants their own agent on their own account today.

Microsoft GraphTeamsBridgeMCP
App registrationrequirednone
Admin consent for chat accessusually requirednone, uses your sign-in
Documented and supportedyesno, internal endpoints
Stable across Teams updatesversioned APImay break, fix in one JSON file
Suited for multi-user productsyesno, personal use

Setup

You need Node.js 20 or newer and Google Chrome or Microsoft Edge. The server drives your installed browser and downloads none of its own.

git clone https://github.com/GodModeAI2025/TeamsBridgeMCP.git
cd TeamsBridgeMCP
npm install
npm run build
npm test          # optional: checks the build, needs no Teams session
npm run login     # browser opens, sign in, the window closes by itself

Prefer Edge? Run npm run login -- --browser msedge and pass --browser msedge to the server. The commands are the same on macOS and Windows.

What you may need to configure

Usually nothing. Nothing tenant-specific is built in: at sign-in the server reads your chat region, partition and OneDrive host from the Teams client's own requests and stores them with the session. Flags or environment variables override what it found, flags win over the environment. teams_status shows the detected values.

FlagVariableDefaultPurpose
--onedrive-hostTEAMS_ONEDRIVE_HOSTdetected at sign-inYour OneDrive host, for example contoso-my.sharepoint.com, used by upload_file. Set it only if detection fails: open OneDrive in the browser and copy the host from the address bar.
--regionTEAMS_REGIONdetected, else emeaChat service region, for example emea, amer or apac.
--partitionTEAMS_PARTITIONdetected, else emea-02Partition for profiles and meetings.
--chat-files-folderTEAMS_CHAT_FILES_FOLDERfound in your OneDriveOneDrive folder for chat uploads. The English and German names are found by themselves; set it for other languages.
--browserTEAMS_BROWSERchromeBrowser for sign-in: chrome or msedge.
--session-fileTEAMS_SESSION_FILEdata/session.jsonOptional: store the session elsewhere.
--endpoints-fileTEAMS_ENDPOINTS_FILEdata/endpoints.jsonOptional: use your own endpoint registry.

Finding region and partition by hand

Only needed if you export the session with npm run export-session instead of signing in, or if a tool reports HTTP 403 for every chat (a wrong region shows up as 403, not 404). Open Teams in the browser, open DevTools on the Network tab and click into a chat. A request to …/api/chatsvc/region/v1/… shows the region, a request to …/api/mt/part/partition/… shows the partition.

Connect your MCP client

Run it directly to try your settings:

node dist/index.js

Claude Code:

claude mcp add teams -- node /absolute/path/TeamsBridgeMCP/dist/index.js

Claude Desktop and most other clients, here with a flag that overrides a detected value:

{
  "mcpServers": {
    "teams": {
      "command": "node",
      "args": [
        "/absolute/path/TeamsBridgeMCP/dist/index.js",
        "--region", "emea"
      ]
    }
  }
}

Or with environment variables, if your client prefers env:

{
  "mcpServers": {
    "teams": {
      "command": "node",
      "args": ["/absolute/path/TeamsBridgeMCP/dist/index.js"],
      "env": { "TEAMS_BROWSER": "msedge" }
    }
  }
}

On Windows write the path with forward slashes, e.g. C:/Users/you/TeamsBridgeMCP/dist/index.js. An unknown flag stops the server with an error, so a typo shows up right away. Then ask your agent to call teams_status.

Security model

When Microsoft changes something

Every request the server makes is one entry in data/endpoints.json. If a tool starts failing with HTTP 404 or 410, start Chrome with --remote-debugging-port=9222, run npm run capture, repeat the action in Teams and copy the new request into that entry. Placeholders like ${TEAMS_REGION} keep tenant values out of the file. The README walks through it step by step.

FAQ

Does it have to be Chrome?

No. Any installed Chrome or Edge works (--browser msedge). A real browser is needed because sign-in, MFA and conditional access happen in Microsoft's own pages. The server never sees your password.

Does my data go anywhere else?

No. The server runs locally and talks only to Microsoft 365. What your AI agent does with the results depends on the agent and model you connect.

What happens when Teams updates?

Usually nothing. If Microsoft moves an endpoint, the affected tool reports an HTTP error and you update one JSON entry. The server never guesses endpoints.

Can it join or record meetings?

No. It lists meetings with time, organizer and join link. Joining, audio and recording are out of scope.

Real-time notifications?

Not yet. Reads are pull-based: the agent asks, the server fetches.

Responsible use

Undocumented API. The endpoints are internal to the Teams web client. Microsoft can change them at any time and does not support this use. The software comes as is, without warranty, under the Apache License 2.0.

Your account, your rules. Use it only with an account you are allowed to automate. On a work or school tenant, check your organization's IT and acceptable-use policies first, or ask your administrator.

Respect others. Chats contain other people's messages and personal data. Do not use the tool to collect, export or monitor conversations beyond what you would do by hand.

This section explains why the author considers publishing this project lawful. It is provided for transparency only and is not legal advice.

Private project

TeamsBridgeMCP is a private project. The author created it entirely in their own time, with their own equipment and resources, on their own initiative. It was not created in the course of any employment, as part of any job duties, or on behalf of or commissioned by any employer, client or other organization. It contains no code, data, documents or confidential information belonging to any employer or client. No employer or organization owns, maintains, endorses or is responsible for this project.

Trademarks

Microsoft, Microsoft Teams, Microsoft 365, Microsoft Edge, Entra ID, OneDrive and SharePoint are trademarks of the Microsoft group of companies. Chrome is a trademark of Google LLC. These names appear here only to describe what this software works with. TeamsBridgeMCP is an independent open-source project and is not affiliated with, sponsored or endorsed by Microsoft or Google. It contains no Microsoft logos, icons or code.