loading…
Search for a command to run...
loading…
A TypeScript-based MCP server that enables AI agents to send messages to Microsoft Teams channels via incoming webhooks. It also includes a ping tool for health
A TypeScript-based MCP server that enables AI agents to send messages to Microsoft Teams channels via incoming webhooks. It also includes a ping tool for health checks and connection verification.
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
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.
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.
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "send_message_to_teams",
"arguments": {
"message": "Hello, MS Teams!"
}
},
"id": 1
}
Install dependencies from the root of the repository:
npm install
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
Get your Teams Webhook URL:
.env as TEAMS_WEBHOOK_URLEnsure .env is not committed (it's already in .gitignore, but double-check for sensitive data)
# 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 missing. Check the error message for which variable needs to be set.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"teams-mcp-server": {
"command": "npx",
"args": []
}
}
}