BiteFoundry Teams MCP Server
teams
Read Microsoft Teams chats and channel threads, send Markdown messages, and search cached conversations from the terminal.
BiteFoundry · Latest release notes

Highlights
Pillar | What You Get |
Minimal-Chrome TUI | 3-tier responsive |
High-Res Terminal Images | Native inline rendering for attachments & pasted |
Local SQLite FTS5 + IPC Daemon | Bundled SQLite WAL + FTS5 cache ( |
4-in-1 Agent Interface | One static binary (Windows, macOS, Linux GLIBC 2.28 / AlmaLinux 8+) delivers TUI, scriptable CLI ( |
Related MCP server: Teams Messenger MCP App
Quick Start
# 1. Install the native CLI via npm
npm i -g @bitefoundry/teams
# 2. Sign in with the desktop application registered by your organization
teams login --client-id YOUR_CLIENT_ID --tenant-id YOUR_TENANT_ID
# 3. Launch the interactive TUI
teamsteams read "Release Room" --jsonRead a conversation in compact JSON. The response identifies omitted fields and distinguishes loaded thread replies from the total. For full detail, add --full in the CLI or pass compact: false to get_messages and get_thread in MCP.
IT administrators can register the app, select delegated permissions and verify a sign-in in Entra. For the public Microsoft Graph Command Line Tools client, run teams login. Company app registration guide
Update a global npm install with npm install -g @bitefoundry/teams@latest. For a standalone binary from GitHub Releases, use teams update. To build from source, run cargo build --release --locked.
External Token Brokers & Custom Entra ID Apps: Supports
TEAMS_ACCESS_TOKEN,TEAMS_TOKEN_FILE,TEAMS_TOKEN_REFRESH_CMD(includingaz account get-access-token), and custom--client-id/--tenant-id. Runteams whoamiorteams doctor --probefor instant JWT scope diagnostics.Corporate TLS-inspecting proxies: Teams trusts the bundled Mozilla roots and the OS certificate store. If requests still fail with
tls_untrusted_certificate, export the corporate root CA as PEM and setTEAMS_EXTRA_CA_PEM=<path>(SSL_CERT_FILEandNODE_EXTRA_CA_CERTSare also read). See docs/ENTERPRISE.md.
Keybindings Cheat Sheet
Key | Context | Action |
| Global | Omni-Switcher / Command Palette ( |
| Global | Switch Chats / Teams / Activity ( |
| Nav / Chat | Navigate conversations, messages, or thread replies |
| Chat / Composer | Focus Composer ( |
| Chat / Thread | Open right-side Thread Drawer / toggle Composer target ( |
| Chat / Thread | Quote-reply / add reaction / copy message / delete own message |
| Chat / Thread | Open Link Extractor overlay ( |
| Chat / Composer | Open high-res Inline Image Preview ( |
| Global | Open built-in File Picker (with |
| Chat | Load older message page ( |
| Global | Search local FTS5 cache / new chat / update Presence status |
| Global | Toggle Cozy / Compact density / toggle left sidebar |
| Global | Settings / full help overlay / safe quit |
CLI, HTTP API & MCP
CLI Examples
# List chats, read history, and send Markdown with @mentions or attachments
teams chats --limit 50 --json
teams read "Acme Engineering/platform-release" --limit 30
teams send "Acme Engineering/platform-release" "**v2.4.0** canary is green!" --subject "Release Update"
teams reply "Acme Engineering/platform-release" 1700000000000 "Confirmed zero 5xx spikes."
teams send-file "Elena Park" ./latency-p99.png --inline --caption "P99 latency benchmark"
# Read a cached thread and edit a post you sent
teams thread "Acme Engineering/platform-release" 1700000000000 --offline --limit 2 --json
teams edit "Acme Engineering/platform-release" 1700000000000 --find "STATE: STAGED" --replace "STATE: READY"
teams edit "Acme Engineering/platform-release" 1700000000000 --subject "Canary rollout"
teams update-chat "Release handoff" --topic "Canary war room"
# Paginate members, channels, and teams (JSON defaults to 50 per page) and search directory users
teams members "Acme Engineering/platform-release" --limit 50 --json
teams users "Alice" --limit 10 --json
teams channels "Acme Engineering" --limit 50 --cursor 50-1795260879123 --json
teams teams --limit 50 --cursor 50-1795260879123 --json
# Offline FTS5 search, deep history sync, presence, and background daemon
teams search "connection pooling" --json
teams sync --chats 100 --depth 100
teams presence --set DoNotDisturb --expiration-mins 60
teams daemon startteams edit TARGET MSG_ID MARKDOWN replaces the entire body. --find and --replace edit one exact occurrence in a single text node of the latest body, preserving links, mentions, images, and attachment references. A missing, repeated, or cross-tag match fails before the write. Channel edits require a signed-in author's delegated token with ChannelMessage.ReadWrite (or legacy Group.ReadWrite.All). Chat edits use Chat.ReadWrite. Graph returns an error when permissions or Teams policy deny the edit. Microsoft Graph message update
teams edit --subject changes the plain-text title of a channel root post you sent. Use the subject option by itself for a PATCH containing only subject. teams update-chat --topic changes an existing group chat's title using delegated Chat.ReadWrite. Topics allow up to 250 characters and exclude colons. Microsoft Graph chat update
read --json, read --thread --json, and thread --json return compact objects by default with top-level omitted (omitted mention/reaction counts and field names) and a hint command; compact messages also include links ([{ "text", "url" }]) when <a href> links in body_html do not appear verbatim in body_plain. Pass --json --full for complete conversation and message objects (--compact remains a compatibility alias). In a thread, --limit caps the replies while including the root separately, and responses report thread.returned, thread.has_more, and thread.root.reply_count (the total reply count when known, or null when truncated). Use --offline after an online thread read that covered the requested replies.
send --json, reply --json, and send-file --json also return compact acknowledgements by default (ok, conversation.{conv_key,title,team_name?}, message.{msg_id,created_at,mentions?,attachments?}, plus reply_to or path/inline); pass --json --full for complete conversation and message objects.
Markdown sent via send / reply converts **bold**, *italic*, `code`, ~~strike~~, [label](url), > quote, fenced code blocks, single-level - bullet lists, and @mentions. Headings (#), tables (|...|), _italic_, nested lists, and numbered lists are sent verbatim.
When any --json command fails at runtime (exit 1), stdout emits a single JSON line {"ok":false,"error":{"code":"...","message":"..."}} alongside the existing stderr Error: ... message (error.code is one of target_ambiguous with candidates, target_not_found, not_signed_in, token_expired with details on whoami, permission_denied with http_status: 403, unauthorized with http_status: 401, not_found with http_status: 404, or error). Usage/flag errors from argument parsing exit with code 2 and print usage text on stderr without stdout JSON.
For members, channels, and teams, passing --cursor reads the next page directly from the local SQLite cache without calling Microsoft Graph. A verified empty member list (0 members from a completed fetch) returns members: [] even with --offline, whereas an unfetched conversation fails with an error until fetched online. teams users <QUERY> searches directory users by display name or email prefix (startswith).
Local HTTP REST API (teams serve)
Start an Axum JSON server on 127.0.0.1:8788. Every route except /health needs a Bearer token: pass --token <secret>, or use the random one teams serve prints to stderr at start-up (--allow-keyless turns authentication off on loopback). Browser origins must be allowed one by one with --cors-origin <ORIGIN>; requests with a foreign Host or Origin get 403.
teams serve --port 8788 --token "$TEAMS_API_TOKEN"
curl http://127.0.0.1:8788/conversations -H "Authorization: Bearer $TEAMS_API_TOKEN"
curl -X POST http://127.0.0.1:8788/conversations/Elena%20Park/messages \
-H "Authorization: Bearer $TEAMS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"markdown":"Build is green — ready to ship!"}'Full endpoint & schema docs: docs/API.md · docs/openapi.yaml
MCP Server (teams mcp)
Exposes 19 Microsoft Teams tools (list_chats, create_chat, update_chat, list_teams_channels, get_messages, get_thread, send_message, reply_message, send_file, download_attachment, react_message, edit_message, delete_message, search_messages, list_members, search_users, mark_read, get_presence, set_presence) over newline-delimited stdio JSON-RPC 2.0:
# Claude Code
claude mcp add teams -- teams mcp// Claude Desktop / Cursor / Windsurf MCP config
{
"mcpServers": {
"teams": {
"command": "teams",
"args": ["mcp"]
}
}
}Full tool schemas & client setups: docs/MCP.md · docs/NPM.md
@bitefoundry Enterprise Terminal Suite
Package | Command | Domain | Interfaces |
|
| Microsoft Teams (Chats, Channels, Threads, Presence) | TUI · CLI · HTTP · MCP |
| Microsoft Outlook (Mail, Calendar, To Do, Contacts) | TUI · CLI · HTTP · MCP | |
| Microsoft OneNote (Notebooks, Sections, Pages) | TUI · CLI · HTTP · MCP | |
| SharePoint & OneDrive (Sites, Drives, Lists, Files) | TUI · CLI · HTTP · MCP | |
| Jira & Confluence (Issues, Boards, Sprints, Wiki) | TUI · CLI · HTTP · MCP | |
| Notion (Pages, Databases, Blocks, Comments) | TUI · CLI · HTTP · MCP |
License & Disclaimer
Licensed under the MIT License.
Unofficial terminal client for Microsoft Teams. Not affiliated with, endorsed by, or sponsored by Microsoft Corporation.
Available Tools
16 toolscreate_chatA
Create a 1:1 chat (1 member; reuses an existing 1:1 chat if one exists) or a new group chat (2+ members). Use search_users first if you need peer Entra user IDs or email addresses. Requires delegated Chat.Create or Chat.ReadWrite. Writes to Microsoft Graph and caches the new conversation; returns { ok, conversation }.
Inputs: members (required), topic.
delete_messageADestructiveIdempotent
Soft-delete a message previously sent by the signed-in user (use edit_message instead to fix a typo). Destructive action requiring literal confirm=true; rejected during validation otherwise. Enforces Graph delegated permissions (Chat.ReadWrite or ChannelMessage.ReadWrite) and Teams delete policy. Updates Graph and local cache; returns { ok, conv_key, msg_id }.
Inputs: msg_id (required), target (required), confirm (required), thread_root_id.
download_attachmentAIdempotent
Download a file attachment or inline Teams screenshot (hostedContents) from a message to local disk so an agent or user can inspect it. Writes a file to out_dir (or configured downloads folder); latency scales with attachment size. Returns { ok, path (absolute), file_name, mime_type, size_bytes, bytes_written, is_image }.
Inputs: msg_id (required), target (required), index, out_dir, +1 more.
edit_messageAIdempotent
Edit a message previously sent by the signed-in user. Choose exactly one mode: markdown (replace full body), find + replace (replace one unique literal phrase while preserving HTML), or subject (rename a channel root post title). Requires Chat.ReadWrite (chats) or ChannelMessage.ReadWrite (channels) and Teams policy allowing edits. Returns { ok, conv_key, msg_id }.
Inputs: msg_id (required), target (required), find, replace, +3 more.
get_messagesARead-onlyIdempotent
Read messages from a chat or team channel, oldest first (use get_thread to read replies under a channel root post, or search_messages for full-text search across cached history). Fetches live from Microsoft Graph by default (about 1 request per 50 messages); set offline=true to read only the local SQLite cache. Returns { conversation, messages, has_more, next_before }.
Inputs: target (required), limit, before, compact, +1 more.
get_presenceARead-onlyIdempotent
Fetch current Microsoft Teams availability and activity status for the signed-in user or a batch of Entra user IDs (use search_users or list_members first to look up user IDs). Costs 1 Graph request per 650 user IDs. Requires delegated Presence.Read (self) or Presence.Read.All (others). Returns { presence } when user_ids is omitted, or { presences } when provided.
Inputs: user_ids.
get_threadARead-onlyIdempotent
Read a team channel root post and up to limit replies, oldest first (use get_messages for top-level channel posts or 1:1/group chats). Online by default (1+ Graph requests, 50 replies each); offline=true reads verified cached replies with no Graph call and errors on cache miss. Returns { conversation, thread: { root, replies, returned, has_more } }.
Inputs: target (required), root_msg_id (required), limit, compact, +1 more.
list_chatsARead-onlyIdempotent
List 1:1, group, and meeting chats (use list_teams_channels for team channels). Reads the local SQLite cache with no Graph request when the cache covers limit; set refresh=true to sync live from Microsoft Graph (about 1 request per 50 chats). Requires delegated Chat.Read. Returns { chats }.
Inputs: limit, refresh.
list_membersARead-onlyIdempotent
List members of a chat or channel with Entra user_id and display_name for @-mentions or get_presence (use search_users for directory lookup). Calls Graph (1+ requests) unless cursor or offline=true reads the local SQLite cache only. Returns paginated { conv_key, title, members, returned, has_more, next_cursor, total }.
Inputs: target (required), limit, cursor, offline.
list_teams_channelsARead-onlyIdempotent
List joined Microsoft Teams and their channels (use list_chats for 1:1/group chats). Cached reads and cursor pages make no Graph request; refresh=true or an empty cache calls Graph for teams (1+ requests) then channels (1 $batch per 20 teams). Requires Team.ReadBasic.All and Channel.ReadBasic.All. Returns paginated { teams, returned, has_more, next_cursor, total }.
Inputs: limit, cursor, refresh.
reply_messageA
Reply to a team channel root post in its thread, or quote-reply a specific message in a 1:1/group chat (use send_message to start a new channel thread or unquoted chat post). Irreversible external side effect notifying participants. Requires ChatMessage.Send or ChannelMessage.Send. Returns { ok, conversation, reply_to, message }.
Inputs: msg_id (required), target (required), markdown (required), compact, +2 more.
search_messagesARead-onlyIdempotent
Full-text search cached messages locally using SQLite FTS5 (no Microsoft Graph request). Only finds messages already fetched into cache.db; call get_messages first if recent history is not cached yet. Returns { query, hits }.
Inputs: query (required), limit, target.
search_usersARead-onlyIdempotent
Search Microsoft Entra directory users by case-insensitive display name, email, or UPN prefix (use list_members to list participants of a specific chat/channel). Costs 1 Graph request (2 if the tenant rejects $filter and falls back to $search). Requires delegated User.ReadBasic.All or User.Read.All. Returns { users: [{ user_id, display_name, email, user_principal_name }], returned }.
Inputs: query (required), limit.
send_fileA
Upload a local file from the host running teams to OneDrive/SharePoint and post it as a Teams message attachment (or inline image when inline=true). Irreversible external side effect. Latency scales with file size (single upload up to 4 MiB, 3.2 MiB chunks above). Requires Files.ReadWrite and message send permissions. Returns { ok, conversation, path, inline, message }.
Inputs: path (required), target (required), inline, caption, +2 more.
send_messageA
Post a new Markdown message to a chat or a new root post to a team channel (use reply_message to reply inside a channel thread or quote-reply an existing chat message). Irreversible external side effect notifying conversation members. Requires ChatMessage.Send or ChannelMessage.Send. Returns compact acknowledgement { ok, conversation, message } by default.
Inputs: target (required), markdown (required), compact, subject, +2 more.
update_chatAIdempotent
Rename an existing group chat's topic (not supported on 1:1 chats or team channels). Requires delegated Chat.ReadWrite and membership in the group chat. Updates Microsoft Graph and the local cache; returns { ok, conversation }.
Inputs: topic (required), target (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource+action pair, and descriptions explicitly point to the sibling tool to use instead (e.g. get_messages vs get_thread vs search_messages, list_chats vs list_teams_channels, send_message vs reply_message vs send_file). The potentially confusing message-posting trio is cleanly separated by 'new post' vs 'thread/quote reply' vs 'file attachment'. No two tools appear interchangeable.
All 16 tools follow a uniform snake_case verb_noun pattern (create_chat, list_chats, update_chat, get_messages, send_message, edit_message, delete_message, search_messages, list_members, search_users, get_presence). Verb choice is meaningful and consistent: list/get for reads, create/update/edit/delete for lifecycle, send/reply for writes.
At 16 tools this sits just above the ideal band, but each entry maps to a genuinely separate capability (chats, channels, messages, threads, files, members, directory users, presence). Nothing looks like a redundant variant or a thin wrapper, though it is on the heavy side for a Teams messaging client.
The surface covers the full message lifecycle (read, thread read, send, reply, edit, delete, search) plus chat creation/rename, attachments up/down, membership, directory lookup, and presence. Gaps are minor: no delete/leave chat, no reactions, and no team/channel creation, but agents can work around these.
Maintenance
Related MCP Connectors
Your own WhatsApp as an MCP server: read, search and send from any MCP client.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Read and write Mission Control state via MCP — projects, tasks, subtasks, templates, status updates.
Use your Pronto feed, Spaces, Posts, Artifacts, and agents from any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that integrates Microsoft Teams messaging (read, post, mention, list members and threads)6469Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that bridges Microsoft Teams and MCP-compatible clients, enabling chat integration, message handling, and advanced search capabilities without REST API endpoints.1-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that bridges Microsoft Teams with MCP-compatible clients (LLMs, agentic frameworks, CLI), enabling chat integration, message search, and event streaming without traditional REST API endpoints.-
- AlicenseAqualityCmaintenanceA read-only, offline MCP server for Microsoft Teams that searches chats, reads conversations, and finds people directly from the local on-disk cache with no cloud API.63Apache 2.0