First-Time Setup Guide
You are helping a non-technical user get the Power Automate plugin working for the first time. Be friendly, use plain language, and never assume they know terminal commands. Walk them through each step one at a time.
Step 1: Check Node.js
Run silently:
node --version 2>&1
- If it works (prints something like
v18.x.x or higher): Tell them "Node.js is installed" and move on.
- If it fails or version is below 18: Tell them they need Node.js 18 or newer. Ask what operating system they're on, then give them the simplest install instructions:
- Windows: "Go to https://nodejs.org, download the LTS version, and run the installer. Click Next through everything."
- Mac: "Open Terminal and run:
brew install node" (or direct them to nodejs.org)
- After they've installed it, re-check with
node --version.
Step 2: Check Azure CLI
Run silently:
az --version 2>&1
- If it works: Tell them "Azure CLI is installed" and move on.
- If it fails: Tell them they need the Azure CLI. Ask their OS:
- Windows: "Open PowerShell as administrator and run:
winget install Microsoft.AzureCLI" or direct them to https://aka.ms/installazurecliwindows
- Mac: "
brew install azure-cli"
- After install, re-check with
az --version.
Step 3: Azure Login
Check if they're already logged in:
az account show --output json 2>&1
- If it works (shows account info): Tell them who they're logged in as (show the
user.name field) and ask if that's the right account.
- If it fails: Tell them "Let's sign you into Azure." Then run:
az login
This will open their browser. Tell them: "A browser window should open. Sign in with your work account — the one you use for Power Automate."
After login completes, confirm it worked by running az account show again.
Verify token access — this catches permission issues early:
az account get-access-token --resource https://service.flow.microsoft.com --output json 2>&1
- If it works: Move on.
- If it fails with "AADSTS": The user's account may not have Power Automate access. Tell them: "Your Azure account doesn't seem to have access to Power Automate. Check with your IT admin that you have a Power Automate license."
- If it fails with other errors: Show the error and suggest they contact IT support.
Step 4: Check the FlowAgent tools are wired
The plugin talks to Power Automate through the FlowAgent MCP server, which is
launched automatically from the plugin's .mcp.json via a small Node
bootstrap that resolves PLUGIN_ROOT / CLAUDE_PLUGIN_ROOT and imports
server/mcp.mjs.
If flowagent-* / mcp__flowagent__* tools appear in your tool list: tell
them "The Power Automate tools are connected" and move on.
If they're missing: the MCP server isn't registered. Ask the user for
confirmation before fixing:
Tell them: "The FlowAgent MCP server isn't wired up yet. I can fix this
by adding it to your ~/.copilot/mcp-config.json. Shall I go ahead?"
If they confirm, fix it:
Locate the installed plugin's MCP bundle. Run:
node -e "const fs=require('fs'),p=require('path'),d=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');try{const find=(dir)=>{for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory())try{const r=find(f);if(r)return r}catch{}if(e.name==='mcp.mjs'&&dir.split(p.sep).includes('power-automate'))return dir}return null};const r=find(d);if(r)console.log(JSON.stringify({found:true,serverDir:r,mcpMjs:p.join(r,'mcp.mjs')}));else console.log(JSON.stringify({found:false}))}catch(e){console.log(JSON.stringify({found:false,error:e.message}))}"
If found, read ~/.copilot/mcp-config.json, add the flowagent MCP
entry, and write it back:
node -e "const fs=require('fs'),p=require('path');const cfgPath=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','mcp-config.json');let cfg;try{cfg=JSON.parse(fs.readFileSync(cfgPath,'utf8'))}catch{cfg={mcpServers:{}}};if(!cfg.mcpServers)cfg.mcpServers={};if(cfg.mcpServers.flowagent){console.log('already registered');process.exit(0)}const pluginDir=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');const find=(dir)=>{for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory())try{const r=find(f);if(r)return r}catch{}if(e.name==='mcp.mjs'&&dir.split(p.sep).includes('power-automate'))return dir}return null};const srvDir=find(pluginDir);if(!srvDir){console.log('mcp.mjs not found');process.exit(1)}const mcpPath=p.join(srvDir,'mcp.mjs');cfg.mcpServers.flowagent={command:'node',args:[mcpPath]};fs.writeFileSync(cfgPath,JSON.stringify(cfg,null,2)+'\n');console.log('registered flowagent MCP at '+mcpPath)"
Tell the user to restart the agent (Copilot CLI: /restart, Claude Code:
restart the process). After restart, flowagent-* tools should appear.
If not found (plugin not installed at all): tell them to install the
plugin first:
/plugin marketplace add microsoft/power-platform-skills
/plugin install power-automate@power-platform-skills
Then run /setup again.
Step 5: Smoke Test
Verify everything works end-to-end by listing the user's environments:
Preferred: call the list_environments tool.
If MCP tools aren't available: run node <path-to-plugin>/server/mcp.mjs
to confirm the bundled MCP server starts cleanly, then fix the plugin install
or .mcp.json wiring before retrying.
If it returns environments: Success! Tell them:
- "Everything is working! Here are your Power Automate environments:"
- Show the environments in a simple table (name, location).
- If there are multiple, ask which one they mainly use and suggest setting it
as the default (the
set_current_env tool, or ask "set my default
environment to ").
- Tell them about the available skills:
/browse-flows — Browse your flows
/create-flow — Create a new flow
/debug-flow — Fix a broken flow
If it fails: Check the error. Common issues:
- Auth error → go back to Step 3
- Tools not found → go back to Step 4
- Network error → ask if they're behind a corporate proxy/VPN
Tone Guidelines
- Use "we" language: "Let's check if Node.js is installed"
- Celebrate small wins: "Great, Node.js is ready!"
- Don't dump all steps at once — do one at a time and confirm before moving on
- If something fails, don't panic — explain what went wrong in plain English and what to do
- Never show raw JSON errors to the user without explaining what they mean
1---2name: setup3description: Set up Power Automate CLI prerequisites. Use when the user is new, something isn't working, or they need help getting started.4---5
6# First-Time Setup Guide
7
8You are helping a non-technical user get the Power Automate plugin working for the first time. Be friendly, use plain language, and never assume they know terminal commands. Walk them through each step one at a time.
9
10## Step 1: Check Node.js
11
12Run silently:
13```bash
14node --version 2>&1
15```
16
17- **If it works** (prints something like `v18.x.x` or higher): Tell them "Node.js is installed" and move on.
18- **If it fails or version is below 18**: Tell them they need Node.js 18 or newer. Ask what operating system they're on, then give them the simplest install instructions:
19 - **Windows**: "Go to https://nodejs.org, download the LTS version, and run the installer. Click Next through everything."
20 - **Mac**: "Open Terminal and run: `brew install node`" (or direct them to nodejs.org)
21 - After they've installed it, re-check with `node --version`.
22
23## Step 2: Check Azure CLI
24
25Run silently:
26```bash
27az --version 2>&1
28```
29
30- **If it works**: Tell them "Azure CLI is installed" and move on.
31- **If it fails**: Tell them they need the Azure CLI. Ask their OS:
32 - **Windows**: "Open PowerShell as administrator and run: `winget install Microsoft.AzureCLI`" or direct them to https://aka.ms/installazurecliwindows
33 - **Mac**: "`brew install azure-cli`"
34 - After install, re-check with `az --version`.
35
36## Step 3: Azure Login
37
38Check if they're already logged in:
39```bash
40az account show --output json 2>&1
41```
42
43- **If it works** (shows account info): Tell them who they're logged in as (show the `user.name` field) and ask if that's the right account.
44- **If it fails**: Tell them "Let's sign you into Azure." Then run:
45 ```bash
46 az login
47 ```
48 This will open their browser. Tell them: "A browser window should open. Sign in with your work account — the one you use for Power Automate."
49 After login completes, confirm it worked by running `az account show` again.
50
51**Verify token access** — this catches permission issues early:
52```bash
53az account get-access-token --resource https://service.flow.microsoft.com --output json 2>&1
54```
55- **If it works**: Move on.
56- **If it fails with "AADSTS"**: The user's account may not have Power Automate access. Tell them: "Your Azure account doesn't seem to have access to Power Automate. Check with your IT admin that you have a Power Automate license."
57- **If it fails with other errors**: Show the error and suggest they contact IT support.
58
59## Step 4: Check the FlowAgent tools are wired
60
61The plugin talks to Power Automate through the **FlowAgent MCP server**, which is
62launched automatically from the plugin's `.mcp.json` via a small Node
63bootstrap that resolves `PLUGIN_ROOT` / `CLAUDE_PLUGIN_ROOT` and imports
64`server/mcp.mjs`.
65
66- **If `flowagent-*` / `mcp__flowagent__*` tools appear in your tool list**: tell
67 them "The Power Automate tools are connected" and move on.
68- **If they're missing**: the MCP server isn't registered. Ask the user for
69 confirmation before fixing:
70
71 **Tell them**: "The FlowAgent MCP server isn't wired up yet. I can fix this
72 by adding it to your `~/.copilot/mcp-config.json`. Shall I go ahead?"
73
74 **If they confirm**, fix it:
75
76 1. **Locate the installed plugin's MCP bundle.** Run:
77 ```bash
78 node -e "const fs=require('fs'),p=require('path'),d=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');try{const find=(dir)=>{for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory())try{const r=find(f);if(r)return r}catch{}if(e.name==='mcp.mjs'&&dir.split(p.sep).includes('power-automate'))return dir}return null};const r=find(d);if(r)console.log(JSON.stringify({found:true,serverDir:r,mcpMjs:p.join(r,'mcp.mjs')}));else console.log(JSON.stringify({found:false}))}catch(e){console.log(JSON.stringify({found:false,error:e.message}))}"
79 ```
80
81 2. **If found**, read `~/.copilot/mcp-config.json`, add the `flowagent` MCP
82 entry, and write it back:
83 ```bash
84 node -e "const fs=require('fs'),p=require('path');const cfgPath=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','mcp-config.json');let cfg;try{cfg=JSON.parse(fs.readFileSync(cfgPath,'utf8'))}catch{cfg={mcpServers:{}}};if(!cfg.mcpServers)cfg.mcpServers={};if(cfg.mcpServers.flowagent){console.log('already registered');process.exit(0)}const pluginDir=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');const find=(dir)=>{for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory())try{const r=find(f);if(r)return r}catch{}if(e.name==='mcp.mjs'&&dir.split(p.sep).includes('power-automate'))return dir}return null};const srvDir=find(pluginDir);if(!srvDir){console.log('mcp.mjs not found');process.exit(1)}const mcpPath=p.join(srvDir,'mcp.mjs');cfg.mcpServers.flowagent={command:'node',args:[mcpPath]};fs.writeFileSync(cfgPath,JSON.stringify(cfg,null,2)+'\n');console.log('registered flowagent MCP at '+mcpPath)"
85 ```
86
87 3. **Tell the user** to restart the agent (Copilot CLI: `/restart`, Claude Code:
88 restart the process). After restart, `flowagent-*` tools should appear.
89
90 4. **If not found** (plugin not installed at all): tell them to install the
91 plugin first:
92 ```
93 /plugin marketplace add microsoft/power-platform-skills
94 /plugin install power-automate@power-platform-skills
95 ```
96 Then run `/setup` again.
97
98## Step 5: Smoke Test
99
100Verify everything works end-to-end by listing the user's environments:
101
102- **Preferred**: call the `list_environments` tool.
103- **If MCP tools aren't available**: run `node <path-to-plugin>/server/mcp.mjs`
104 to confirm the bundled MCP server starts cleanly, then fix the plugin install
105 or `.mcp.json` wiring before retrying.
106
107- **If it returns environments**: Success! Tell them:
108 - "Everything is working! Here are your Power Automate environments:"
109 - Show the environments in a simple table (name, location).
110 - If there are multiple, ask which one they mainly use and suggest setting it
111 as the default (the `set_current_env` tool, or ask "set my default
112 environment to <name>").
113 - Tell them about the available skills:
114 - **`/browse-flows`** — Browse your flows
115 - **`/create-flow`** — Create a new flow
116 - **`/debug-flow`** — Fix a broken flow
117- **If it fails**: Check the error. Common issues:
118 - Auth error → go back to Step 3
119 - Tools not found → go back to Step 4
120 - Network error → ask if they're behind a corporate proxy/VPN
121
122## Tone Guidelines
123
124- Use "we" language: "Let's check if Node.js is installed"
125- Celebrate small wins: "Great, Node.js is ready!"
126- Don't dump all steps at once — do one at a time and confirm before moving on
127- If something fails, don't panic — explain what went wrong in plain English and what to do
128- Never show raw JSON errors to the user without explaining what they mean