msteams-mcp: Instructions file for Codex

AGENTS.md

msteams-mcp AGENTS.md is an instructions file for Codex, OpenCode from m0nkmaster/msteams-mcp. It costs 5,877 tokens per session, scanned A, original, MIT.

A project guidance file for msteams-mcp, an MCP server that lets AI assistants work with Microsoft Teams. It documents repository structure, implementation conventions, and project-specific knowledge for agents.

In plain words
What is it for?
Use it as reference when developing or reviewing msteams-mcp, including its TypeScript source, MCP server, command-line interface, tools, and Teams API integrations.
Why use it?
Agents working in the repository need its local rules and architecture to avoid making incompatible changes. The file provides context that general coding instructions do not include.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is m0nkmaster/msteams-mcp's own configuration. It tells Codex and OpenCode how to work on msteams-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything msteams-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to m0nkmaster/msteams-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/m0nkmaster/msteams-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/m0nkmaster/msteams-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for msteams-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/m0nkmaster/msteams-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/m0nkmaster/msteams-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/m0nkmaster/msteams-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/m0nkmaster/msteams-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for msteams-mcp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/m0nkmaster/msteams-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/m0nkmaster/msteams-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,877 This file is loaded in full into every session.
When invoked 5,877 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.05877 $0.05877
Opus 5.5 $0.02351 $0.02351
Sonnet 5.5 $0.01175 $0.01175
Haiku 4.5 $0.00588 $0.00588

Measured yesterday against content hash 65925dbefad7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

msteams-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 296 lines

How it starts

The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Guidelines for Teams MCP

Non-obvious project knowledge for AI agents. This is not a tool reference: tool parameters and usage live in the tool definitions (src/tools/*.ts), which are the source of truth and are sent to AI assistants via MCP.

Repository

Project Overview

An MCP (Model Context Protocol) server that lets AI assistants interact with Microsoft Teams. Instead of the Microsoft Graph API, it calls Teams' own APIs (Substrate, chatsvc, CSA) using tokens extracted from a browser session. The browser is only used for initial login; all operations are direct API calls.

Directory Structure

src/
├── index.ts              # Entry point, runs the MCP server
├── cli.ts                # Standalone CLI (msteams bin) - full tool parity via in-memory MCP transport
├── cli/                  # CLI plumbing, all driven by the tool definitions
│   ├── resolve.ts        # Command resolution and schema-driven flag parsing
│   ├── render.ts         # Generic response rendering, colour/TTY handling
│   └── help.ts           # Generated command index and per-command help
├── server.ts             # MCP server (TeamsServer class) - delegates to tool registry
├── constants.ts          # Shared constants (page sizes, timeouts, thresholds)
├── tools/                # Tool handlers (modular design)
│   ├── index.ts          # Tool context and type definitions
│   ├── registry.ts       # Tool registry - maps names to handlers
│   ├── search-tools.ts   # Search and channel tools
│   ├── message-tools.ts  # Messaging, favourites, save/unsave tools
│   ├── people-tools.ts   # People search and profile tools
│   ├── meeting-tools.ts  # Calendar and meeting tools
│   ├── file-tools.ts     # Shared files and file download tools
│   ├── tag-tools.ts      # Channel tag tools
│   ├── assignment-tools.ts # EDU Assignments tools (list, get with attachments, submission actions)
│   └── auth-tools.ts     # Login and status tools
├── auth/                 # Authentication and credential management
│   ├── crypto.ts         # AES-256-GCM encryption for credentials at rest
│   ├── session-store.ts  # Secure session state storage with encryption
│   ├── token-extractor.ts # Extract tokens from Playwright session state
│   ├── token-refresh.ts  # Token refresh orchestrator (HTTP-first, browser fallback)
│   └── token-refresh-http.ts # Browserless token refresh via direct OAuth2 calls
├── api/                  # API client modules (one per API surface)
│   ├── substrate-api.ts  # Search and people APIs (Substrate v2)
│   ├── chatsvc-api.ts    # Barrel file re-exporting all chatsvc sub-modules
│   ├── chatsvc-common.ts # Shared utilities (date formatting)
│   ├── chatsvc-messaging.ts # Send, edit, delete, threads, 1:1/group chat
│   ├── chatsvc-conversations.ts # Recent conversation list with last-message preview
│   ├── chatsvc-activity.ts  # Activity feed (mentions, reactions, replies)
│   ├── chatsvc-reactions.ts # Add/remove emoji reactions
│   ├── chatsvc-virtual.ts   # Saved messages, followed threads, save/unsave
│   ├── chatsvc-readstatus.ts # Consumption horizons, mark as read, unread
│   ├── csa-api.ts        # Favorites API (CSA)
│   ├── calendar-api.ts   # Calendar/meetings API
│   ├── transcript-api.ts # Meeting transcripts (Substrate WorkingSetFiles)
│   ├── files-api.ts      # Shared files (Substrate AllFiles)
│   ├── tags-api.ts       # Channel tags (mt/part teams/{groupId}/tags)
│   ├── assignments-api.ts # EDU Assignments (assignments.edu.cloud.microsoft, OneNote EDU)
│   ├── graph-files-api.ts # File downloads via Microsoft Graph (shared files and assignment attachments)
│   └── profile-api.ts    # Resolve MRIs to profiles (middleTier fetchShortProfile)
├── browser/              # Playwright browser automation (login only)
│   ├── context.ts        # Persistent browser profile management
│   └── auth.ts           # Authentication detection and manual login handling
├── utils/
│   ├── parsers.ts        # Pure parsing functions (barrel; testable submodules)
│   ├── parsers-*.ts      # Parser submodules (html, markdown, search, people, channels, identifiers, reactions, virtual)
│   ├── http.ts           # HTTP client with retry, timeout, error handling
│   ├── api-config.ts     # API endpoints and header configuration
│   ├── logger.ts         # Prefixed logger used for all production logging
│   └── auth-guards.ts    # Reusable auth check utilities (Result types)
├── types/
│   ├── teams.ts          # Teams data interfaces
│   ├── errors.ts         # Error taxonomy with machine-readable codes
│   ├── result.ts         # Result<T, E> type for explicit error handling
│   └── api-responses.ts  # Typed interfaces for raw API response shapes
├── __fixtures__/
│   └── api-responses.ts  # Mock API responses for testing

Read the full file on GitHub · 296 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +37 tokens per session 65925dbefad7
  2. 25d ago Changed · +34 lines · +802 tokens per session 9d17cd1234f1
  3. 1mo ago Changed · +9 lines · +622 tokens per session ec737966db04
  4. 2mo ago First seen · 253 lines · 4,416 tokens per session scan A 6f7f1da8f929

Subscribe to this mod's changes

msteams-mcp AGENTS.md is an instructions file published in the GitHub repository m0nkmaster/msteams-mcp (28 stars, last pushed 2d ago), licensed MIT. It adds 5,877 tokens to every session, about $0.0235 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

msteams-mcp AGENTS.md compared with instructions from other repositories

msteams-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
msteams-mcp AGENTS.mdm0nkmaster/msteams-mcpInstructions file282d agoMITA5,877Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot