Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Root Signals MCP Server
  • TxtAi Memory Vector Server
  • GraphRAG MCP Server
  • Raccoon AI MCP Server
  • doc-lib-mcp
Back to MCP Servers
Teams Messenger MCP App

Teams Messenger MCP App

Public
aech-ai/mcp-teams

Bridges Microsoft Teams with MCP-compatible clients by enabling chat integration, advanced hybrid semantic and lexical search via PostgreSQL and DuckDB storage, live event streaming, and a rich CLI for seamless Model Context Protocol communication.

python
0 tools
May 29, 2025
Updated Jun 4, 2025

Supercharge Your AI with Teams Messenger MCP App

MCP Server

Unlock the full potential of Teams Messenger MCP App through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

Teams Messenger MCP App

This project implements a pure Model Context Protocol (MCP) server that bridges Microsoft Teams and MCP-compatible clients (LLMs, agentic frameworks, and a rich CLI MCP client). All features are exposed via MCP tools, resources, and events—no REST API endpoints.

Features

  • Microsoft Teams chat/message integration via MCP
  • PostgreSQL-based Information Retrieval (IR) server for advanced search capabilities
  • Persistent storage in DuckDB for chat/message history
  • Hybrid semantic and lexical search (BM25 + vector, FlockMTL-style)
  • CLI for login/token management and a rich MCP client for local testing
  • Polling-based event emission for new messages
  • Live event streaming and search for LLMs and CLI
  • Single-agent (bot) account, not multi-user

Architecture

+-------------------+      +-------------------+      +-------------------+
|   CLI MCP Client  ||    MCP Server     ||  Microsoft Teams  |
| (rich terminal UI)|      | (Python, FastMCP) |      |  (Graph API)      |
+-------------------+      +-------------------+      +-------------------+
         |                        |                          
         |                        v                          
         |                +-------------------+      +-------------------+
         |                |     DuckDB DB     |      |    IR Server      |
         |                +-------------------+      | (PostgreSQL, API) |
                                                     +-------------------+
                                                              |
                                                              v
                                                     +-------------------+
                                                     |  PostgreSQL DB    |
                                                     |  (with pgvector)  |
                                                     +-------------------+
  • All chat/message/search logic is via MCP tools/resources/events
  • Teams MCP server uses DuckDB for message storage
  • IR server provides advanced search capabilities with PostgreSQL and pgvector
  • IR server exposes an HTTP API for MCP server communication

Installation

Requirements

  • Python 3.9+
  • pip
  • Docker and Docker Compose (for containerized deployment)

Option 1: Local Installation

1. Clone the repository

git clone cd mcp-teams

2. Install dependencies

pip install -r requirements.txt

3. Configure environment variables

Copy the template and fill in your Azure AD/Teams credentials:

cp .env.template .env # Edit .env and fill in your Azure AD and other settings

See the table below for variable descriptions.

Option 2: Docker Deployment (Recommended)

1. Clone the repository

git clone cd mcp-teams

2. Configure environment variables

Copy the template and fill in your credentials:

cp .env.template .env # Edit .env and fill in your settings

3. Build and start services

docker-compose up -d

Environment Variables (.env)

VariableDescriptionExample / Default
AZURE_CLIENT_IDAzure AD Application (client) IDxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_SECRETAzure AD Application secretyour-secret
AZURE_TENANT_IDAzure AD Tenant IDxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_APP_OBJECT_IDAzure AD Application object IDxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
DUCKDB_PATHPath to DuckDB database filedb/teams_mcp.duckdb
TOKEN_PATHPath to store persistent token cachedb/token_cache.json
POLL_INTERVALPolling interval (seconds) for new messages10
DEMO_MODESet to true for mock/demo mode (no real Teams API calls)false
OPENAI_API_KEYOpenAI API key for embedding generationsk-...
POSTGRES_USERPostgreSQL usernamepostgres
POSTGRES_PASSWORDPostgreSQL passwordpostgres
POSTGRES_DBPostgreSQL database namemcp_ir
IR_SERVER_HOSTIR server hostnameir_server
IR_SERVER_PORTIR server port8090

Running the MCP Server

Local Mode (without Docker)

python mcp_server/server.py

Docker Mode (All Services)

docker-compose up -d

To check logs:

docker-compose logs -f teams_mcp # Teams MCP server logs docker-compose logs -f ir_server # IR server logs

Demo Mode (no real Teams API calls)

Set DEMO_MODE=true in your .env and run as above.

CLI Usage

1. Login and Token Management

python cli/login.py login python cli/login.py status python cli/login.py logout

2. Rich CLI MCP Client

All commands below use the MCP stdio protocol to talk to the server.

List chats

python cli/mcp_client.py list_chats

Get messages from a chat

python cli/mcp_client.py get_messages

Send a message

python cli/mcp_client.py send_message "Hello from CLI!"

Create a new 1:1 chat

python cli/mcp_client.py create_chat

Search messages (hybrid, BM25, or vector)

python cli/mcp_client.py search_messages "project update" --mode hybrid --top_k 5

Stream new incoming messages (live event subscription)

python cli/mcp_client.py stream

IR Server Usage

The IR server provides advanced search capabilities with PostgreSQL and pgvector. It exposes an HTTP API for MCP server communication.

IR Server API Endpoints

1. Health Check

GET http://localhost:8090/

2. List Available Tools

GET http://localhost:8090/api/tools

3. Search Content

POST http://localhost:8090/api/tools/search

Body:

{ "query": "your search query", "search_type": "hybrid", "limit": 10 }

4. Index Content

POST http://localhost:8090/api/tools/index_content

Body:

{ "content": "Text content to index", "source_type": "teams", "metadata": { "author": "User Name", "created": "2025-04-01T12:00:00Z" } }

For more detailed IR server documentation, see ir/README.md.

Search and Event Streaming

  • Hybrid search: Combines BM25 and vector search with LLM reranking
  • Live streaming: Subscribe to messages/incoming for real-time updates

Development & Extension

  • Add new MCP tools/resources in mcp_server/server.py
  • Extend Teams integration in teams/graph.py
  • Modify IR capabilities in the IR server
  • Add analytics, summarization, or RAG features using DuckDB, PostgreSQL, and LLMs
  • Use the CLI as a test harness for all MCP features

Troubleshooting & FAQ

  • Login fails: Check your Azure AD credentials and .env values
  • No messages appear: Ensure polling is running and your bot account is in the Teams chat
  • DuckDB errors: Check file permissions and paths in .env
  • IR server not responding: Check Docker logs and ensure the container is running
  • Demo mode: Set DEMO_MODE=true for local testing without real Teams

References

  • Beyond Quacking: Deep Integration of Language Models and RAG into DuckDB (FlockMTL)
  • Model Context Protocol documentation
  • Microsoft Graph API docs
  • PostgreSQL with pgvector extension

For full product details, see specs/app-spec.md.

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Root Signals MCP Server
    Root Signals MCP Server

    Bridges Root Signals API with Model Context Protocol clients to enable AI assistants and agents to p...

    Added May 30, 2025
  • TxtAi Memory Vector Server
    TxtAi Memory Vector Server

    Model Context Protocol server offering advanced semantic search, persistent memory management, tag-b...

    Added May 30, 2025
  • GraphRAG MCP Server
    GraphRAG MCP Server

    Model Context Protocol server enabling hybrid semantic and graph-based document retrieval by integra...

    Added May 30, 2025
  • Raccoon AI MCP Server
    Raccoon AI MCP Server

    Enables advanced web browsing, data extraction, form automation, and multistep web task handling via...

    Added May 30, 2025
  • doc-lib-mcp
    doc-lib-mcp

    Model Context Protocol server enabling document ingestion, chunking, semantic search, and advanced n...

    Added May 30, 2025