SecchiAle/ms365-selective-mcp-server
If you are the rightful owner of ms365-selective-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A specialized MCP server for Microsoft 365 services integration with Microsoft Copilot Studio and Azure App Service.
Selective Microsoft 365 MCP Server
A streamable HTTPS Model Context Protocol (MCP) server designed specifically for Microsoft Planner, Teams, SharePoint, Outlook, and OneNote integration with Microsoft Copilot Studio and Azure App Service deployment.
๐ Features
- Selective Service Focus: Only includes tools for the 5 core Microsoft 365 services
- Streamable HTTPS Transport: Compatible with Microsoft Copilot Studio and modern MCP clients
- Azure App Service Ready: Optimized for cloud deployment with proper configuration
- OAuth Integration: Full OAuth flow support for Copilot Studio connector integration
- 52 Focused Tools: Carefully curated from the original 99 tools for targeted functionality
๐ฆ Supported Services & Tools
๐๏ธ Microsoft Planner (7 tools)
list-planner-tasks
- List user's planner tasksget-planner-plan
- Get details of a specific planlist-plan-tasks
- List tasks in a specific planget-planner-task
- Get details of a specific taskcreate-planner-task
- Create a new planner taskupdate-planner-task
- Update an existing taskupdate-planner-task-details
- Update task details
๐ฅ Microsoft Teams (8 tools)
list-joined-teams
- List teams the user has joinedget-team
- Get details of a specific teamlist-team-channels
- List channels in a teamget-team-channel
- Get details of a specific channellist-channel-messages
- List messages in a channelget-channel-message
- Get a specific channel messagesend-channel-message
- Send a message to a channellist-team-members
- List members of a team
๐ SharePoint Online (12 tools)
search-sharepoint-sites
- Search for SharePoint sitesget-sharepoint-site
- Get details of a specific sitelist-sharepoint-site-drives
- List drives in a siteget-sharepoint-site-drive-by-id
- Get a specific drivelist-sharepoint-site-items
- List items in a siteget-sharepoint-site-item
- Get a specific itemlist-sharepoint-site-lists
- List SharePoint listsget-sharepoint-site-list
- Get details of a specific listlist-sharepoint-site-list-items
- List items in a SharePoint listget-sharepoint-site-list-item
- Get a specific list itemget-sharepoint-site-by-path
- Get site by pathget-sharepoint-sites-delta
- Get site changes
๐ง Outlook/Mail (16 tools)
list-mail-messages
- List mail messageslist-mail-folders
- List mail folderslist-mail-folder-messages
- List messages in a folderget-mail-message
- Get a specific messagesend-mail
- Send an emailcreate-draft-email
- Create a draft emaildelete-mail-message
- Delete a messagemove-mail-message
- Move a messageadd-mail-attachment
- Add attachment to messagelist-mail-attachments
- List message attachmentsget-mail-attachment
- Get a specific attachmentdelete-mail-attachment
- Delete an attachmentlist-outlook-contacts
- List contactsget-outlook-contact
- Get a specific contactcreate-outlook-contact
- Create a new contactupdate-outlook-contact
- Update a contactdelete-outlook-contact
- Delete a contact- Plus shared mailbox tools for organization accounts
๐ OneNote (5 tools)
list-onenote-notebooks
- List OneNote notebookslist-onenote-notebook-sections
- List sections in a notebooklist-onenote-section-pages
- List pages in a sectionget-onenote-page-content
- Get page contentcreate-onenote-page
- Create a new page
๐ ๏ธ Prerequisites
- Node.js 18+ (recommended 20+)
- Azure AD App Registration for authentication
- Azure Subscription (for deployment)
โก Quick Start
1. Clone and Install
cd C:\AI_Projects\ms365-selective-mcp-server
npm install
2. Configure Environment
# Copy the example environment file
copy .env.example .env
# Edit .env and add your Azure AD app details:
# MS365_MCP_CLIENT_ID=your-app-id
# MS365_MCP_CLIENT_SECRET=your-app-secret
3. Build and Run Locally
# Build the project
npm run build
# Run with HTTP transport (for testing)
npm run start:http
# Or run with Azure configuration
npm run start:azure
4. Test the Server
# Check health endpoint
curl http://localhost:3000/health
# View service info
curl http://localhost:3000/
๐ Deployment Options
Option 1: Azure App Service (Recommended)
-
Create Azure App Service:
az webapp create --resource-group myRG --plan myPlan --name ms365-mcp --runtime "NODE|20-lts"
-
Configure Environment Variables in Azure Portal:
MS365_MCP_CLIENT_ID
MS365_MCP_CLIENT_SECRET
MS365_MCP_TENANT_ID
NODE_ENV=production
-
Deploy:
- Via GitHub Actions (recommended)
- Via Azure CLI:
az webapp deployment source config-zip
- Via VS Code Azure extension
Option 2: Docker Container
-
Build Image:
docker build -t ms365-selective-mcp .
-
Run Container:
docker run -p 3000:3000 \ -e MS365_MCP_CLIENT_ID=your-id \ -e MS365_MCP_CLIENT_SECRET=your-secret \ ms365-selective-mcp
๐ Microsoft Copilot Studio Integration
1. Set Up Azure AD App Registration
- Go to Azure Portal โ Azure Active Directory โ App registrations
- Create new registration: "MS365 Selective MCP Server"
- Add redirect URIs:
https://your-app-service.azurewebsites.net/auth/callback
- For local testing:
http://localhost:3000/auth/callback
- Generate client secret
- Configure API permissions for Microsoft Graph
2. Create Custom Connector in Power Platform
- Go to make.powerapps.com โ Custom connectors
- Create from blank
- Set Host to your Azure App Service URL
- Configure OAuth 2.0 authentication:
- Authorization URL:
https://your-app.azurewebsites.net/auth/authorize
- Token URL:
https://your-app.azurewebsites.net/auth/token
- Client ID: Your Azure AD app client ID
- Authorization URL:
3. Add to Copilot Studio Agent
- Go to Copilot Studio
- Create/edit your agent
- Go to Tools โ Add tool
- Select "Model Context Protocol" tab
- Choose your custom connector
- Create connection and add to agent
๐ง Configuration Options
Environment Variables
Variable | Description | Default |
---|---|---|
MS365_MCP_CLIENT_ID | Azure AD app client ID | Built-in demo app |
MS365_MCP_CLIENT_SECRET | Azure AD app secret | - |
MS365_MCP_TENANT_ID | Azure AD tenant ID | common |
PORT | Server port | 3000 |
HOST | Server host | localhost |
NODE_ENV | Environment | development |
READ_ONLY | Enable read-only mode | false |
ENABLED_TOOLS | Filter tools by regex | All enabled |
MS365_MCP_ORG_MODE | Enable organization features | true |
Command Line Options
# HTTP mode with specific port
npm run start:http
# Azure mode (binds to 0.0.0.0:$PORT)
npm run start:azure
# Development mode with auto-reload
npm run dev:http
# Enable verbose logging
node dist/index.js --http 3000 -v
# Filter specific tools only
node dist/index.js --http 3000 --enabled-tools "planner|teams"
# Read-only mode
node dist/index.js --http 3000 --read-only
๐งช Testing
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Lint code
npm run lint
# Format code
npm run format
# Verify everything
npm run verify
๐ API Endpoints
Core Endpoints
POST /mcp
- Main MCP protocol endpointGET /health
- Health checkGET /
- Service information
OAuth Endpoints (Copilot Studio Integration)
GET /.well-known/oauth_server
- OAuth discoveryGET /auth/authorize
- OAuth authorizationPOST /auth/token
- OAuth token exchangeGET /auth/callback
- OAuth callback
๐ Security Features
- JWT Token Validation for OAuth requests
- CORS Configuration for cross-origin requests
- Rate Limiting on authentication endpoints
- Secure Token Storage with keychain fallback
- Environment Variable Security for secrets
- Request Logging for audit trails
๐ Monitoring
Health Check Response
{
"status": "healthy",
"service": "Selective Microsoft 365 MCP Server",
"version": "1.0.0",
"timestamp": "2025-01-XX:XX:XX.XXXZ"
}
Logs
- Console Logs: Development environment
- File Logs:
error.log
,combined.log
- Structured JSON: Production environment
- Azure App Service: Integrated with Azure Monitor
๐ค Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make changes and test:
npm run verify
- Commit changes:
git commit -am 'Add feature'
- Push to branch:
git push origin feature-name
- Create Pull Request
๐ License
MIT License - see LICENSE file for details.
๐ Support
- Issues: Create an issue in the repository
- Documentation: Check this README and code comments
- Azure Support: Use Azure support channels for deployment issues
- Microsoft Graph: Use Microsoft Graph documentation for API questions
Built for Microsoft Copilot Studio integration ๐ค Optimized for Azure deployment โ๏ธ