Microsoft 365 MCP Server
Microsoft 365 MCP Server
A Model Context Protocol (MCP) server for interacting with Microsoft 365 services through the Graph API.
Login and test authentication in Claude Desktop:
npx @softeria/ms-365-mcp-server
To add this MCP server to Claude Desktop:
ms
(or any name you prefer)npx @softeria/ms-365-mcp-server
Alternatively, you can edit Claude Desktop's configuration file directly. The location varies by platform, but you can find it by going to Settings > Developer > Edit Config. Add this to your configuration file:
{
"mcpServers": {
"ms": {
"command": "npx",
"args": [
"-y",
"@softeria/ms-365-mcp-server"
]
}
}
}
Claude Code CLI integration is available but configuration methods may vary based on the current version. Please refer to the official Claude Code documentation for the most up-to-date instructions on adding MCP servers.
For other Claude interfaces that support MCPs, please refer to their respective documentation for the correct integration method.
# Clone the repository
git clone https://github.com/softeria-eu/ms-365-mcp-server.git
cd ms-365-mcp-server
# Install dependencies
npm install
# Run tests
npm test
This repository uses GitHub Actions for continuous integration and deployment:
To create a new release:
# Default (patch version): 0.1.11 -> 0.1.12
npm run release
# Minor version: 0.1.11 -> 0.2.0
npm run release minor
# Major version: 0.1.11 -> 1.0.0
npm run release major
This script will:
npx @softeria/ms-365-mcp-server [options]
Options:
--login
: Force login using device code flow and verify Graph API access--logout
: Log out and clear saved credentials--test-login
: Test current authentication and verify Graph API access without starting the server-v
: Enable verbose loggingImportant: You must authenticate before using the MCP server. There are two ways to authenticate:
Running the server with the --login
flag:
npx @softeria/ms-365-mcp-server --login
This will display the login URL and code in the terminal.
When using Claude Code or other MCP clients, use the login tools:
login
tool, which will return the login URL and codeverify-login
tool to check if the login was successfulBoth methods trigger the device code flow authentication, but they handle the UI interaction differently:
You can verify your authentication status with the --test-login
flag, which will check if your token can successfully
fetch user data from Microsoft Graph API:
npx @softeria/ms-365-mcp-server --test-login
Both --login
and --test-login
will return a JSON response that includes your basic user information from Microsoft
Graph API if authentication is successful:
{
"success": true,
"message": "Login successful",
"userData": {
"displayName": "Your Name",
"userPrincipalName": "[email protected]"
}
}
Authentication tokens are cached securely in your system's credential store with fallback to file storage if needed.
This server provides several MCP tools for interacting with Microsoft 365 services:
login
: Start a new login process with Microsoft (returns login URL and code)verify-login
: Check if login was completed successfully and verify Graph API accesslogout
: Log out of Microsoft and clear credentialstest-login
: Test current authentication status and verify Graph API accesslist-files
: List files and folders in a specified pathget-file
: Get details of a specific filecreate-folder
: Create a new folderdelete-item
: Delete a file or foldercopy-item
: Copy a file or folder to a new locationmove-item
: Move a file or folder to a new locationrename-item
: Rename a file or foldersearch-files
: Search for files matching a queryget-shared-items
: Get a list of items shared with youcreate-sharing-link
: Create a sharing link for a file or folderget-file-content
: Get the content of a fileAll Excel tools require a filePath
parameter to specify which Excel file to operate on. You can use the Files tools to
find and manage your Excel files.
update-excel
: Update cell values in an Excel worksheetcreate-chart
: Create a chart in an Excel worksheetformat-range
: Apply formatting to a range of cellssort-range
: Sort a range of cellscreate-table
: Create a table from a range of cellsget-range
: Get values from a range of cellslist-worksheets
: List all worksheets in the workbookclose-session
: Close the session for a specific Excel fileclose-all-sessions
: Close all active Excel sessionsdelete-chart
: Delete a chart from a worksheetget-charts
: Get all charts in a worksheetExample workflow:
list-files
to find Excel files in your OneDrivelist-worksheets
with the file path to see available worksheetsget-range
to retrieve data from the Excel fileTools for working with Outlook calendars.
list-calendars
: List all calendarsget-default-calendar
: Get information about the default calendarlist-events
: List events from a calendar with optional filtering, sorting, and date rangesget-detailed-events
: Get events with expanded properties and options to include body, attendees, extensions, etc.get-event
: Get detailed information about a specific calendar eventcreate-event
: Create a new calendar event with comprehensive options (sensitivity, importance, free/busy status,
optional attendees, reminders, online meetings, categories)create-recurring-event
: Create recurring events (daily, weekly, monthly, yearly) with the same comprehensive options
and flexible recurrence patternsupdate-event
: Update an existing calendar eventdelete-event
: Delete a calendar eventaccept-event
: Accept a calendar meeting invitationdecline-event
: Decline a calendar meeting invitationtentatively-accept-event
: Tentatively accept a calendar meeting invitationfind-meeting-times
: Find available meeting times for a set of attendeesget-schedules
: Get availability information for multiple users or resource roomsTools for working with Outlook email.
list-messages
: List emails from any mail folder with powerful filtering, searching, and sorting optionsget-message
: Get detailed information about a specific email message with options to include attachments and other
metadata