Outlook
STDIOModular MCP server connecting Claude with Microsoft Outlook through Graph API for email and calendar management
Modular MCP server connecting Claude with Microsoft Outlook through Graph API for email and calendar management
This is a modular implementation of the Outlook MCP (Model Context Protocol) server that connects Claude with Microsoft Outlook through the Microsoft Graph API. Certified by MCPHub https://mcphub.com/mcp-servers/ryaker/outlook-mcp
/modular/
├── index.js                 # Main entry point
├── config.js                # Configuration settings
├── auth/                    # Authentication modules
│   ├── index.js             # Authentication exports
│   ├── token-manager.js     # Token storage and refresh
│   └── tools.js             # Auth-related tools
├── calendar/                # Calendar functionality
│   ├── index.js             # Calendar exports
│   ├── list.js              # List events
│   ├── create.js            # Create event
│   ├── delete.js            # Delete event
│   ├── cancel.js            # Cancel
│   ├── accept.js            # Accept event
│   ├── tentative.js         # Tentatively accept event
│   ├── decline.js           # Decline event
├── email/                   # Email functionality
│   ├── index.js             # Email exports
│   ├── list.js              # List emails
│   ├── search.js            # Search emails
│   ├── read.js              # Read email
│   └── send.js              # Send email
└── utils/                   # Utility functions
    ├── graph-api.js         # Microsoft Graph API helper
    ├── odata-helpers.js     # OData query building
    └── mock-data.js         # Test mode data
npm install.env.example to .env and add your Azure credentialsnpm run auth-servernpm install
This will install the required dependencies including:
@modelcontextprotocol/sdk - MCP protocol implementationdotenv - Environment variable managementTo use this MCP server you need to first register and configure an app in Azure Portal. The following steps will take you through the process of registering a new app, configuring its permissions, and generating a client secret.
Create a .env file in the project root by copying the example:
cp .env.example .env
Edit .env and add your Azure credentials:
# Get these values from Azure Portal > App Registrations > Your App MS_CLIENT_ID=your-application-client-id-here MS_CLIENT_SECRET=your-client-secret-VALUE-here USE_TEST_MODE=false
Important Notes:
MS_CLIENT_ID and MS_CLIENT_SECRET in the .env fileOUTLOOK_CLIENT_ID and OUTLOOK_CLIENT_SECRETCopy the configuration from claude-config-sample.json to your Claude Desktop config file and update the paths and credentials:
{ "mcpServers": { "outlook-assistant": { "command": "node", "args": [ "/absolute/path/to/outlook-mcp/index.js" ], "env": { "USE_TEST_MODE": "false", "OUTLOOK_CLIENT_ID": "your-client-id-here", "OUTLOOK_CLIENT_SECRET": "your-client-secret-here" } } } }
To configure server behavior, you can edit config.js to change:
npm run auth-serverauthenticate tool to get an OAuth URLYou can test the server using:
./test-modular-server.sh
This will use the MCP Inspector to directly connect to the server and let you test the available tools.
The authentication process requires two steps:
npm run auth-server
This starts a local server on port 3333 that handles the OAuth callback from Microsoft.
⚠️ Important: The auth server MUST be running before you try to authenticate. The authentication URL will not work if the server isn't running.
authenticate toolhttp://localhost:3333/auth?client_id=your-client-id~/.outlook-mcp-tokens.jsonThe authentication server can be stopped after successful authentication (tokens are saved). However, you'll need to restart it if you need to re-authenticate.
Solution: Install dependencies first:
npm install
Solution: Port 3333 is already in use. Kill the existing process:
npx kill-port 3333
Then restart the auth server: npm run auth-server
Root Cause: You're using the Secret ID instead of the Secret Value.
Solution:
.env file: MS_CLIENT_SECRET=actual-secret-valueOUTLOOK_CLIENT_SECRET=actual-secret-valuenpm run auth-serverRoot Cause: Authentication server isn't running.
Solution:
npm run auth-serverRoot Cause: Token may have expired or been corrupted.
Solutions:
~/.outlook-mcp-tokens.jsonSolutions:
OUTLOOK_CLIENT_ID and OUTLOOK_CLIENT_SECRET are set in Claude configSolutions:
.env file exists in the project rootMS_CLIENT_ID and MS_CLIENT_SECRET in .env.env file~/.outlook-mcp-tokens.json and re-authenticateIf you're still having issues:
npm run auth-server for detailed error messagesTo add more functionality:
calendar/)TOOLS array in index.js