MCP server enabling Microsoft Graph-powered access to Teams, users, and messages with rich search and messaging capabilities.
Configuration
View docs{
"mcpServers": {
"floriscornel-teams-mcp": {
"command": "npx",
"args": [
"-y",
"@floriscornel/teams-mcp@latest"
]
}
}
}Teams MCP provides a dedicated MCP server that integrates Microsoft Graph APIs with Microsoft Teams, users, and organizational data. It enables AI assistants to authenticate, query, manage Teams, channels, chats, and messages, and perform advanced searches across conversations.
You connect to this MCP server from your MCP client (such as Cursor, Claude, or VS Code) using the provided configuration. Once connected, you can authenticate with Microsoft Graph, fetch your user information, search users, list and manage Teams and channels, read and send messages in channels or chats, and perform advanced message searches using Microsoft Search.
Key capabilities you can leverage include: authentication flow with token management, retrieving current user and directory data, listing teams you are a member of, listing channels within teams, reading and sending channel messages with optional importance levels, managing team members, listing chats, creating chats, retrieving chat history, and performing KQL-based searches across messages.
Prerequisites: you need Node.js 18+ and a Microsoft 365 account with appropriate permissions. You also require an Azure App Registration configured with Microsoft Graph permissions.
Steps to set up and run the MCP server locally:
# Install dependencies
npm install
# Build the project
npm run build
# Set up authentication
npm run authConfigure the MCP server in your client by using the following MCP server entry. This enables your client to start the server via npx and load the Teams MCP configuration.
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"]
}
}
}To run in development mode, start the server with hot reload. For production, build the project and start the compiled output.
# Development mode with hot reload
npm run dev
# Production mode
npm run build && node dist/index.jsThe MCP server is configured via a JSON snippet that you load into your MCP client configuration. Use the following entry for the Teams MCP server.
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"]
}
}
}All authentication flows use OAuth 2.0 with Microsoft Graph, and tokens are securely stored and refreshed automatically. Sensitive data is not logged or exposed, and the integration follows Microsoft Graph security practices.
Authenticate with Microsoft Graph to start the flow and then verify your status, using the standard MCP client commands.
Example authentication and status check commands you would run in your MCP client environment include initiating the OAuth flow and checking the current authentication state.
This server is designed to work with AI assistants through the Model Context Protocol, enabling practical interactions with Teams, channels, and messages via MCP.
Initiate the OAuth authentication flow with Microsoft Graph to obtain access tokens.
Clear stored authentication tokens and end the session.
Retrieve information about the currently authenticated user.
Search for users by name or email address.
Fetch detailed information about a user by ID or email.
List the teams the authenticated user has joined.
List channels within a specified team.
Retrieve messages from a channel with support for pagination and filtering.
Send a message to a specified team channel.
List members of a specific team and their roles.
List 1:1 and group chats involving the user.
Retrieve messages from a chat with pagination and filtering.
Send a message to a chat.
Create a new 1:1 or group chat.
Search across all Teams messages using KQL syntax.
Get recent messages with advanced filtering options.
Find messages that mention the current user.