Teams MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "TEAMS_WEBHOOK_URL=${TEAMS_WEBHOOK_URL}" teams-mcp -- node "<FULL_PATH_TO_MCP>/dist/index.js"

Replace <FULL_PATH_TO_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:TEAMS_WEBHOOK_URL+ 2 optional
README.md

Send messages to Microsoft Teams channels via incoming webhooks

[MS Teams Notification MCP (Model Context Protocol) Server](https://github.com/linnienaryshkin/mcp)

Let's experiment with creating our own MCP server to learn how this technology works in depth.

Here is a settled GitHub Copilot Space for this repository: https://github.com/copilot/spaces/linnienaryshkin/1

Goal

I want to build an MCP server that can be connected from MCP clients such as Cursor or VS Code GitHub Copilot, then send a message to my MS Teams chat through Agent mode.

Theory | The basics

MCP is a protocol for communication between AI agents and tools. It defines a standard way for agents to interact with tools, and for tools to provide information back to agents. MCP is designed to be flexible and extensible, allowing for a wide range of use cases.

Key Terminology

  • MCP Client: An application that implements the MCP protocol to communicate with an MCP server. Examples include Cursor, VS Code GitHub Copilot, Cloud Desktop, and more.
    • Contains or orchestrates access to the model
    • Sends prompts to the LLM
    • Sends tool requests to the MCP server
  • LLM (Large Language Model): The model that processes prompts and generates responses.
  • MCP Server: The server that implements the MCP protocol to handle requests from MCP clients and interact with tools.
    • Hosts and executes tools
    • Hosts resources
    • Hosts reusable prompts
    • Validates input

Tools, Resources, Prompts

  • Tools: Functions or APIs that the MCP server can execute on behalf of the MCP client. Tools can perform various tasks, such as fetching data, performing calculations, or interacting with external services.
    • Name
    • Description
    • Input schema
    • Output schema
  • Resources: Data or information that the MCP server can provide to the MCP client.
  • Prompts: Predefined prompts that the MCP server can provide to the MCP client.

Communication | JSON-RPC

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "send_message_to_teams",
    "arguments": {
      "message": "Hello, MS Teams!"
    }
  },
  "id": 1
}

Transport Layer (HTTP, SSE, Streamable HTTP)

Standard HTTP
  • Request-response model
  • Best for quick and simple interactions
  • Limited by latency and connection overhead
Server-Sent Events (SSE)
  • Unidirectional communication from server to client
  • Best for real-time updates and notifications
Streamable HTTP
  • Allows continuous data streaming between client and server
  • Best for long-running tasks and large data transfers
  • Currently considered to be the future of MCP communication

Setup

Installation

Install dependencies from the root of the repository:

npm install

Environment Variables

This project uses environment variables to configure the MCP server. Follow these steps to set up your environment:

Copy the environment template:

cp .env.example .env

Edit .env with your configuration:

# Required
TEAMS_WEBHOOK_URL=https://your-organization.webhook.office.com/webhookb2/...

# Optional (defaults shown)
PORT=8787
HOST=127.0.0.1
  1. Get your Teams Webhook URL:

    • Open Microsoft Teams
    • Go to your target channel → SettingsConnectors
    • Search for "Incoming Webhook" and select it
    • Click Configure and give it a name
    • Copy the webhook URL and paste it in .env as TEAMS_WEBHOOK_URL
  2. Ensure .env is not committed (it's already in .gitignore, but double-check for sensitive data)

Building and Running

# Build TypeScript
npm run build

# Run stdio server
node dist/stdio-server/index.js

# Run streamable HTTP server
node dist/streamable-http-server/index.js

# Test Teams integration directly
npm run test:teams -- --message "Hello from integration test"

Optional test flags:

# Use an explicit webhook URL
npm run test:teams -- --webhookUrl "https://your-organization.webhook.office.com/webhookb2/..."

# Dry run (validates inputs without sending)
npm run test:teams -- --dryRun

Note: The server will fail to start if required environment variables are missi

Tools (1)

send_message_to_teamsSends a message to a configured Microsoft Teams channel via an incoming webhook.

Environment Variables

TEAMS_WEBHOOK_URLrequiredThe Microsoft Teams incoming webhook URL for the target channel.
PORTPort for the server (defaults to 8787).
HOSTHost address for the server (defaults to 127.0.0.1).

Configuration

claude_desktop_config.json
{"mcpServers": {"teams": {"command": "node", "args": ["/path/to/dist/stdio-server/index.js"], "env": {"TEAMS_WEBHOOK_URL": "YOUR_WEBHOOK_URL"}}}}

Try it

Send a message to the Teams channel saying that the deployment process has started.
Notify the team on Teams that the current task is completed.
Post a summary of the recent code changes to the Microsoft Teams channel.

Frequently Asked Questions

What are the key features of Teams MCP Server?

Sends messages to Microsoft Teams channels using incoming webhooks. Supports standard stdio transport for local MCP clients. Supports streamable HTTP transport for remote connectivity. Includes a ping tool for health checks and connection verification.

What can I use Teams MCP Server for?

Automating status updates from AI agents to team communication channels. Sending alerts or notifications from development workflows directly to Teams. Integrating AI-driven reporting into existing Microsoft Teams collaboration spaces.

How do I install Teams MCP Server?

Install Teams MCP Server by running: npm install && npm run build

What MCP clients work with Teams MCP Server?

Teams MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Teams MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare