ms365
# Microsoft 365 Operations (MCP-by-Code)
What this skill does
# Microsoft 365 Operations (MCP-by-Code) Knowledge base for MS365 operations using the @softeria/ms-365-mcp-server. ## Server Information | Property | Value | |----------|-------| | Package | `@softeria/ms-365-mcp-server` | | Version | 0.29.0 | | GitHub | https://github.com/softeria/ms-365-mcp-server | | Transport | stdio (default), HTTP (optional) | ## Authentication Methods ### 1. Device Code Flow (Default) Interactive authentication for personal use: ```bash # Via CLI npx @softeria/ms-365-mcp-server --login # Via MCP tool Use the `login` tool, then `verify-login` ``` ### 2. Azure AD App Registration For production/automated use, create an Azure AD app: 1. Go to Azure Portal > Azure AD > App registrations 2. Create new registration 3. Set redirect URI for your app type 4. Get Client ID and (optionally) Client Secret 5. Set environment variables: ```bash export MS365_CLIENT_ID='your-client-id' export MS365_TENANT_ID='your-tenant-id' export MS365_CLIENT_SECRET='your-secret' # Optional ``` ### 3. Bring Your Own Token (BYOT) For systems with external OAuth management: ```bash MS365_MCP_OAUTH_TOKEN='your-token' npx @softeria/ms-365-mcp-server ``` ## Tool Categories ### Personal Account Tools (Default) | Category | Tools | Description | |----------|-------|-------------| | Email | 8 tools | Send, read, delete, move emails | | Calendar | 7 tools | List, create, update, delete events | | Files | 7 tools | OneDrive operations | | Excel | 5 tools | Spreadsheet operations | | OneNote | 5 tools | Notebook operations | | Tasks | 6 tools | To Do list management | | Planner | 5 tools | Planner task management | | Contacts | 5 tools | Outlook contacts | | Search | 1 tool | Microsoft Search | | User | 1 tool | Get current user | ### Organization Tools (--org-mode) | Category | Tools | Description | |----------|-------|-------------| | Teams | 15+ tools | Chats, channels, messages | | SharePoint | 12+ tools | Sites, lists, documents | | Shared Mailboxes | 4 tools | Shared inbox access | | Users | 1 tool | Organization user directory | ## Common Operations ### Send Email ``` Tool: send-mail Parameters: - to: "[email protected]" (required, comma-separated for multiple) - subject: "Subject line" (required) - body: "Email content" (required) - content-type: "text" or "html" (optional) - cc: "[email protected]" (optional) - bcc: "[email protected]" (optional) ``` ### List Inbox ``` Tool: list-mail-messages Parameters: - top: 10 (optional, number of messages) - filter: "isRead eq false" (optional, OData filter) ``` ### Create Calendar Event ``` Tool: create-calendar-event Parameters: - subject: "Meeting Title" (required) - start: "2026-01-05T14:00:00" (required, ISO 8601) - end: "2026-01-05T15:00:00" (required, ISO 8601) - body: "Description" (optional) - location: "Conference Room A" (optional) - attendees: "[email protected]" (optional, comma-separated) ``` ### Get Calendar View ``` Tool: get-calendar-view Parameters: - start-date-time: "2026-01-04T00:00:00Z" (required) - end-date-time: "2026-01-11T23:59:59Z" (required) ``` ### Upload File to OneDrive ``` Tool: upload-new-file Parameters: - filename: "document.txt" (required) - content: "File content" (required) - folder-id: "folder-id" (optional, defaults to root) ``` ## OData Filters Common filters for list operations: | Filter | Description | |--------|-------------| | `isRead eq false` | Unread emails | | `from/emailAddress/address eq '[email protected]'` | Emails from specific sender | | `receivedDateTime ge 2026-01-01T00:00:00Z` | Emails after date | | `subject eq 'test'` | Exact subject match | | `contains(subject, 'meeting')` | Subject contains | ## Server Options ### Presets (Reduce Token Usage) ```bash npx @softeria/ms-365-mcp-server --preset mail # Only email npx @softeria/ms-365-mcp-server --preset calendar # Only calendar npx @softeria/ms-365-mcp-server --preset files # Only OneDrive npx @softeria/ms-365-mcp-server --preset personal # All personal (no Teams) npx @softeria/ms-365-mcp-server --preset work # Teams, SharePoint only ``` ### Read-Only Mode ```bash npx @softeria/ms-365-mcp-server --read-only # Disables: send-mail, delete-*, create-*, update-* ``` ### TOON Format (Token Reduction) ```bash npx @softeria/ms-365-mcp-server --toon # 30-60% fewer tokens in responses ``` ### Discovery Mode (Minimal) ```bash npx @softeria/ms-365-mcp-server --discovery # Only 2 tools: search-tools, execute-tool ``` ## Error Codes | Error | Cause | Solution | |-------|-------|----------| | `Authorization_RequestDenied` | Missing permissions | Check app permissions in Azure | | `InvalidAuthenticationToken` | Token expired | Re-authenticate with `login` | | `ResourceNotFound` | Item doesn't exist | Verify ID is correct | | `AccessDenied` | No access to resource | Check sharing permissions | ## Graph API Endpoints Reference for understanding tool behavior: | Tool | Graph API | |------|-----------| | send-mail | POST /me/sendMail | | list-mail-messages | GET /me/messages | | list-calendar-events | GET /me/events | | create-calendar-event | POST /me/events | | list-folder-files | GET /me/drive/root/children | | upload-new-file | PUT /me/drive/root:/{filename}:/content | ## Required Permissions ### Personal (Delegated) - Mail.Read, Mail.Send - Calendars.ReadWrite - Files.ReadWrite - Tasks.ReadWrite - Contacts.ReadWrite ### Organization (Delegated) - Team.ReadBasic.All - Chat.ReadWrite - Sites.Read.All - User.Read.All (for list-users) ## References - [MS Graph API Documentation](https://docs.microsoft.com/en-us/graph/) - [MCP Server GitHub](https://github.com/softeria/ms-365-mcp-server) - [Azure AD App Registration](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.