Skip to main content
Glama
BiteFoundry Teams MCP Server

BiteFoundry Teams MCP Server

teams

Read Microsoft Teams chats and channel threads, send Markdown messages, and search cached conversations from the terminal.

npm version Platforms Built with Rust & Ratatui License: MIT

BiteFoundry · Latest release notes

teams TUI Demo


Highlights

Pillar

What You Get

Minimal-Chrome TUI

3-tier responsive ratatui layout (Wide / Medium / Narrow), Composer-First workflow, side-by-side Thread Drawer, Link Extractor (u), zoxide File Picker (Ctrl+F), Unified Ctrl+K Omni-Switcher, Cozy/Compact density (Ctrl+D), and multi-depth themes (Midnight Dark, Daylight Light, ANSI 256/16, NO_COLOR).

High-Res Terminal Images

Native inline rendering for attachments & pasted hostedContents screenshots across Kitty, iTerm2 (OSC 1337), Sixel (DCS q), and 24-bit Half-Blocks (▀) universal fallback with live zoom (+/-/0) and protocol switching (p).

Local SQLite FTS5 + IPC Daemon

Bundled SQLite WAL + FTS5 cache (cache.db) with @odata.nextLink deep history cursors, offline hybrid search (teams search), and cached CLI reads via teams daemon.

4-in-1 Agent Interface

One static binary (Windows, macOS, Linux GLIBC 2.28 / AlmaLinux 8+) delivers TUI, scriptable CLI (--json), Axum HTTP REST API (teams serve), and stdio MCP server (teams mcp, 19 tools).


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
teams
teams read "Release Room" --json

Read 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 (including az account get-access-token), and custom --client-id / --tenant-id. Run teams whoami or teams doctor --probe for 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 set TEAMS_EXTRA_CA_PEM=<path> (SSL_CERT_FILE and NODE_EXTRA_CA_CERTS are also read). See docs/ENTERPRISE.md.


Keybindings Cheat Sheet

Key

Context

Action

Ctrl+K

Global

Omni-Switcher / Command Palette (> commands, # channels, @ chats, / search)

1 / 2 / 3 (Alt+1..3)

Global

Switch Chats / Teams / Activity (@mentions) tabs

j / k / ↑ / ↓

Nav / Chat

Navigate conversations, messages, or thread replies

i / Enter

Chat / Composer

Focus Composer (Enter sends, Shift+Enter newline, Ctrl+V pastes clipboard image)

t / Alt+T

Chat / Thread

Open right-side Thread Drawer / toggle Composer target (Thread vs Channel)

r / + / y / Del

Chat / Thread

Quote-reply / add reaction / copy message / delete own message

u / h

Chat / Thread

Open Link Extractor overlay (Enter open, y copy) / toggle inline href URLs

v / Alt+v

Chat / Composer

Open high-res Inline Image Preview (+/-/0 zoom, p protocol, d save)

Ctrl+F / Ctrl+O

Global

Open built-in File Picker (with z zoxide quick-jump) / send file by path

o / H

Chat

Load older message page (o) / deep history backfill (H)

/ / Ctrl+N / Ctrl+P

Global

Search local FTS5 cache / new chat / update Presence status

Ctrl+D / Ctrl+B

Global

Toggle Cozy / Compact density / toggle left sidebar

Ctrl+, / ? / Ctrl+Q

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 start

teams 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

@bitefoundry/teams (this repo)

teams

Microsoft Teams (Chats, Channels, Threads, Presence)

TUI · CLI · HTTP · MCP

@bitefoundry/outlook

outlook

Microsoft Outlook (Mail, Calendar, To Do, Contacts)

TUI · CLI · HTTP · MCP

@bitefoundry/onenote

onenote

Microsoft OneNote (Notebooks, Sections, Pages)

TUI · CLI · HTTP · MCP

@bitefoundry/sharepoint

sharepoint, bitefoundry-onedrive

SharePoint & OneDrive (Sites, Drives, Lists, Files)

TUI · CLI · HTTP · MCP

@bitefoundry/atlassian

atlassian, confluence, conf

Jira & Confluence (Issues, Boards, Sprints, Wiki)

TUI · CLI · HTTP · MCP

@bitefoundry/notion

notion

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 tools
create_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_messageA
DestructiveIdempotent

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_attachmentA
Idempotent

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_messageA
Idempotent

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_messagesA
Read-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_presenceA
Read-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_threadA
Read-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_chatsA
Read-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_membersA
Read-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_channelsA
Read-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_messagesA
Read-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_usersA
Read-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_chatA
Idempotent

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

    A4.4/5.0

    Scored across 16 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A 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
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      -
    • A
      license
      A
      quality
      C
      maintenance
      A 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.
      6
      3
      Apache 2.0