{"_id":"teams-mcp","name":"teams-mcp","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.3":{"name":"teams-mcp","version":"0.3.3","description":"MCP server for Microsoft Graph Teams integration","type":"module","main":"dist/index.js","bin":{"teams-mcp":"dist/index.js"},"publishConfig":{"access":"public"},"scripts":{"build":"npm run clean && npm run compile","clean":"rm -rf dist","compile":"tsc","dev":"node --watch src/index.ts","auth":"node dist/index.js authenticate","auth:check":"node dist/index.js check","auth:logout":"node dist/index.js logout","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:coverage:ci":"vitest run --coverage --reporter=default --reporter=junit --outputFile.junit=test-results.xml","test:ui":"vitest --ui","lint":"biome check .","lint:fix":"biome check --write --unsafe .","format":"biome format --write .","bump":"npx npm-check-updates -i","prepublishOnly":"npm run build"},"keywords":["mcp","microsoft-graph","teams","model-context-protocol"],"author":{"name":"Floris Cornel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/floriscornel/teams-mcp.git"},"homepage":"https://github.com/floriscornel/teams-mcp#readme","bugs":{"url":"https://github.com/floriscornel/teams-mcp/issues"},"dependencies":{"@azure/identity":"^4.10.1","@microsoft/microsoft-graph-client":"^3.0.7","@microsoft/microsoft-graph-types":"^2.40.0","@modelcontextprotocol/sdk":"^1.13.3","@types/dompurify":"^3.2.0","@types/jsdom":"^21.1.7","@types/marked":"^6.0.0","dompurify":"^3.2.6","jsdom":"^26.1.0","marked":"^16.0.0","zod":"^3.25.67"},"devDependencies":{"@biomejs/biome":"2.0.6","@types/node":"^24.1.0","@types/sinon":"^17.0.4","@vitest/coverage-v8":"^3.2.4","msw":"^2.10.2","nock":"^14.0.5","sinon":"^21.0.0","typescript":"^5.8.3","vitest":"^3.2.4"},"engines":{"node":">=18.0.0"},"_id":"teams-mcp@0.3.3","gitHead":"9f6a5a7264f0ba8174f60f677ccc862b14771be6","types":"./dist/index.d.ts","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-hPMl4qmomVMHFD13cr3oRSK/AVuyFWlrtl+OV4o3NJ5K2yt5/G8Fx7j+8z7SYraIiNWwb3xfAscf6B+rSQaIYQ==","shasum":"8c1d8449ba3388ad999b1366ffcedf843296db97","tarball":"https://registry.npmjs.org/teams-mcp/-/teams-mcp-0.3.3.tgz","fileCount":55,"unpackedSize":204249,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDfx5ZHCMVpI57sxb61xuqu7I9rSMpXAu3RWpW+tQJukAiAC1exEPhNbH4nrNWX/0b+vktieHpdPk5UfOW0qtO2JSQ=="}]},"_npmUser":{"name":"abudullah","email":"abdullah.h.elgabry@gmail.com"},"directories":{},"maintainers":[{"name":"abudullah","email":"abdullah.h.elgabry@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/teams-mcp_0.3.3_1753865646694_0.45352840432140473"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-30T08:54:06.577Z","0.3.3":"2025-07-30T08:54:06.860Z","modified":"2025-07-30T08:54:07.177Z"},"maintainers":[{"name":"abudullah","email":"abdullah.h.elgabry@gmail.com"}],"description":"MCP server for Microsoft Graph Teams integration","homepage":"https://github.com/floriscornel/teams-mcp#readme","keywords":["mcp","microsoft-graph","teams","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/floriscornel/teams-mcp.git"},"author":{"name":"Floris Cornel"},"bugs":{"url":"https://github.com/floriscornel/teams-mcp/issues"},"license":"MIT","readme":"# Teams MCP\n\n[![npm version](https://img.shields.io/npm/v/@floriscornel/teams-mcp.svg)](https://www.npmjs.com/package/@floriscornel/teams-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/@floriscornel/teams-mcp.svg)](https://www.npmjs.com/package/@floriscornel/teams-mcp)\n[![codecov](https://codecov.io/gh/floriscornel/teams-mcp/graph/badge.svg)](https://app.codecov.io/gh/floriscornel/teams-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/floriscornel/teams-mcp.svg)](https://github.com/floriscornel/teams-mcp/stargazers)\n\nA Model Context Protocol (MCP) server that provides seamless integration with Microsoft Graph APIs, enabling AI assistants to interact with Microsoft Teams, users, and organizational data.\n\n## 📦 Installation\n\nTo use this MCP server in Cursor/Claude/VS Code, add the following configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"teams-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@floriscornel/teams-mcp@latest\"]\n    }\n  }\n}\n```\n\n## 🚀 Features\n\n### 🔐 Authentication\n- OAuth 2.0 authentication flow with Microsoft Graph\n- Secure token management and refresh\n- Authentication status checking\n\n### 👥 User Management\n- Get current user information\n- Search users by name or email\n- Retrieve detailed user profiles\n- Access organizational directory data\n\n### 🏢 Microsoft Teams Integration\n- **Teams Management**\n  - List user's joined teams\n  - Access team details and metadata\n  \n- **Channel Operations**\n  - List channels within teams\n  - Retrieve channel messages\n  - Send messages to team channels\n  - Support for message importance levels (normal, high, urgent)\n  \n- **Team Members**\n  - List team members and their roles\n  - Access member information\n\n### 💬 Chat & Messaging\n- **1:1 and Group Chats**\n  - List user's chats\n  - Create new 1:1 or group conversations\n  - Retrieve chat message history with filtering and pagination\n  - Send messages to existing chats\n\n### 🔍 Advanced Search & Discovery\n- **Message Search**\n  - Search across all Teams channels and chats using Microsoft Search API\n  - Support for KQL (Keyword Query Language) syntax\n  - Filter by sender, mentions, attachments, importance, and date ranges\n  - Get recent messages with advanced filtering options\n  - Find messages mentioning specific users\n\n## Rich Message Formatting Support\n\nThe following tools now support rich message formatting in Teams channels and chats:\n- `send_channel_message`\n- `send_chat_message`\n- `reply_to_channel_message`\n\n### Format Options\n\nYou can specify the `format` parameter to control the message formatting:\n- `text` (default): Plain text\n- `markdown`: Markdown formatting (bold, italic, lists, links, code, etc.) - converted to sanitized HTML\n\nWhen `format` is set to `markdown`, the message content is converted to HTML using a secure markdown parser and sanitized to remove potentially dangerous content before being sent to Teams.\n\nIf `format` is not specified, the message will be sent as plain text.\n\n### Example Usage\n\n```json\n{\n  \"teamId\": \"...\",\n  \"channelId\": \"...\",\n  \"message\": \"**Bold text** and _italic text_\\n\\n- List item 1\\n- List item 2\\n\\n[Link](https://example.com)\",\n  \"format\": \"markdown\"\n}\n```\n\n```json\n{\n  \"chatId\": \"...\",\n  \"message\": \"Simple plain text message\",\n  \"format\": \"text\"\n}\n```\n\n### Security Features\n\n- **HTML Sanitization**: All markdown content is converted to HTML and sanitized to remove potentially dangerous elements (scripts, event handlers, etc.)\n- **Allowed Tags**: Only safe HTML tags are permitted (p, strong, em, a, ul, ol, li, h1-h6, code, pre, etc.)\n- **Safe Attributes**: Only safe attributes are allowed (href, target, src, alt, title, width, height)\n- **XSS Prevention**: Content is automatically sanitized to prevent cross-site scripting attacks\n\n### Supported Markdown Features\n\n- **Text formatting**: Bold (`**text**`), italic (`_text_`), strikethrough (`~~text~~`)\n- **Links**: `[text](url)` \n- **Lists**: Bulleted (`- item`) and numbered (`1. item`)\n- **Code**: Inline `` `code` `` and blocks ``` ```code``` ```\n- **Headings**: `# H1` through `###### H6`\n- **Line breaks**: Automatic conversion of newlines to `<br>` tags\n- **Blockquotes**: `> quoted text`\n- **Tables**: GitHub-flavored markdown tables\n\n## 📦 Installation\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n\n# Set up authentication\nnpm run auth\n```\n\n## 🔧 Configuration\n\n### Prerequisites\n- Node.js 18+\n- Microsoft 365 account with appropriate permissions\n- Azure App Registration with Microsoft Graph permissions\n\n### Required Microsoft Graph Permissions\n- `User.Read` - Read user profile\n- `User.ReadBasic.All` - Read basic user info\n- `Team.ReadBasic.All` - Read team information\n- `Channel.ReadBasic.All` - Read channel information\n- `ChannelMessage.Read.All` - Read channel messages\n- `ChannelMessage.Send` - Send channel messages\n- `Chat.Read` - Read chat messages\n- `Chat.ReadWrite` - Create and manage chats\n- `Mail.Read` - Required for Microsoft Search API\n- `Calendars.Read` - Required for Microsoft Search API\n- `Files.Read.All` - Required for Microsoft Search API\n- `Sites.Read.All` - Required for Microsoft Search API\n\n## 🛠️ Usage\n\n### Starting the Server\n```bash\n# Development mode with hot reload\nnpm run dev\n\n# Production mode\nnpm run build && node dist/index.js\n```\n\n### Available MCP Tools\n\n#### Authentication\n- `authenticate` - Initiate OAuth authentication flow\n- `logout` - Clear authentication tokens\n- `get_current_user` - Get authenticated user information\n\n#### User Operations\n- `search_users` - Search for users by name or email\n- `get_user` - Get detailed user information by ID or email\n\n#### Teams Operations\n- `list_teams` - List user's joined teams\n- `list_channels` - List channels in a specific team\n- `get_channel_messages` - Retrieve messages from a team channel with pagination and filtering\n- `send_channel_message` - Send a message to a team channel\n- `list_team_members` - List members of a specific team\n\n#### Chat Operations\n- `list_chats` - List user's chats (1:1 and group)\n- `get_chat_messages` - Retrieve messages from a specific chat with pagination and filtering\n- `send_chat_message` - Send a message to a chat\n- `create_chat` - Create a new 1:1 or group chat\n\n#### Search Operations\n- `search_messages` - Search across all Teams messages using KQL syntax\n- `get_recent_messages` - Get recent messages with advanced filtering options\n- `get_my_mentions` - Find messages mentioning the current user\n\n\n## 📋 Examples\n\n### Authentication\n\nFirst, authenticate with Microsoft Graph:\n\n```bash\nnpx @floriscornel/teams-mcp@latest authenticate\n```\n\nCheck your authentication status:\n\n```bash\nnpx @floriscornel/teams-mcp@latest check\n```\n\nLogout if needed:\n\n```bash\nnpx @floriscornel/teams-mcp@latest logout\n```\n\n### Integrating with Cursor/Claude\n\nThis MCP server is designed to work with AI assistants like Claude/Cursor/VS Code through the Model Context Protocol. \n\n```json\n{\n  \"mcpServers\": {\n    \"teams-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@floriscornel/teams-mcp@latest\"]\n    }\n  }\n}\n```\n\n## 🔒 Security\n\n- All authentication is handled through Microsoft's OAuth 2.0 flow\n- Tokens are securely stored and automatically refreshed\n- No sensitive data is logged or exposed\n- Follows Microsoft Graph API security best practices\n\n## 📝 License\n\nMIT License - see LICENSE file for details\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run linting and formatting\n5. Submit a pull request\n\n## 📞 Support\n\nFor issues and questions:\n- Check the existing GitHub issues\n- Review Microsoft Graph API documentation\n- Ensure proper authentication and permissions are configured ","readmeFilename":"README.md","_rev":"1-0039af8abef24a6efb82121fd7076cbe"}