This directory contains a minimal Model Context Protocol (MCP) server implemented with the official TypeScript SDK and MCP Apps (@modelcontextprotocol/ext-apps) for a field service dispatch workflow. It exposes UI-bearing tools (list, map, dispatch plan, confirmation) so you can experiment with Copilot tool invocation and widget rendering end-to-end.
The sample includes:
list-new-assignmentsfor intakeshow-assignments-on-mapfor map visualizationget-available-technicians+create-dispatch-planfor planningcommit-assignmentsfor confirmation/commit flow
- Demo video file: demos/demo-video.mp4
- Watch demo on YouTube: https://www.youtube.com/watch?v=rsfPzTxCgjQ
| Prompt | What it does |
|---|---|
| Show me new assignments from the last 24 hours. | Calls list-new-assignments and opens the list widget with filtered intake items. |
| Show these assignments on the map. | Calls show-assignments-on-map and renders the dispatch map widget. |
| List available technicians. | Calls get-available-technicians to retrieve available workforce candidates. |
| Create a dispatch plan for these assignments. | Calls create-dispatch-plan with assignment/technician mappings and shows planning UI. |
- Node.js 20+ (or current LTS)
- npm 10+
- A Mapbox public access token (free tier is sufficient to test) — needed for the map and dispatch-plan widgets
- Go to https://account.mapbox.com/auth/signup/ and create a free Mapbox account (or sign in if you already have one).
- Navigate to Account → Tokens: https://account.mapbox.com/access-tokens/.
- Copy your Default public token (starts with
pk.). - Open the following two widget files and replace
YOUR_MAPBOX_ACCESS_TOKENwith your token:
git clone https://github.com/microsoft/mcp-interactiveUI-samples.git
cd mcp-interactiveUI-samples/mcp-apps/fieldops/node/src/mcpserverCheck if Node.js and npm are already installed:
node -v
npm -vIf both commands return version numbers (Node.js 20+ and npm 10+), skip to Step 3. Otherwise, install them:
winget install OpenJS.NodeJS.LTSbrew install nodenpm run install:all
npm run build:widgets
npm run dev:serverServer endpoint:
http://localhost:8787/mcp
ngrok http 8787Use the public HTTPS URL from ngrok and append /mcp for your MCP spec URL.
-
Replace the spec URL with your local tunnel MCP URL from section 5.
"runtimes": [ { "type": "RemoteMCPServer", "spec": { "url": "<your-mcp-server-url>", "mcp_tool_description": { "...": "..." } } } ]
-
Zip the appPackage folder.
-
Sideload the package into Teams.
If you are customizing tool definitions (adding/updating tools), you can use M365 Agents Toolkit to create a declarative agent from your MCP server URL. See M365 Agents Toolkit Instructions for details.
- Customize data sources for your environment
- Create your own components

