Skip to content

A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.

fix(power-automate): resilient MCP bootstrap for Copilot CLI (#246)

Matt Townsend1b0c07d399c4
diff --git a/plugins/power-automate/.mcp.json b/plugins/power-automate/.mcp.json
index 92fe3f12b..d7169782a 100644
--- a/plugins/power-automate/.mcp.json
+++ b/plugins/power-automate/.mcp.json
@@ -4,7 +4,7 @@
"command": "node",
"args": [
"-e",
- "const p=require('node:path');const r=process.env.PLUGIN_ROOT||process.env.CLAUDE_PLUGIN_ROOT;if(!r){console.error('Neither PLUGIN_ROOT nor CLAUDE_PLUGIN_ROOT is set');process.exit(1);}(async()=>{try{await import(require('node:url').pathToFileURL(p.resolve(r,'server','mcp.mjs')).href)}catch(e){console.error(e);process.exit(1)}})();"
+ "const p=require('node:path'),fs=require('node:fs');const r=process.env.PLUGIN_ROOT||process.env.CLAUDE_PLUGIN_ROOT||process.cwd();const src=process.env.PLUGIN_ROOT?'PLUGIN_ROOT':process.env.CLAUDE_PLUGIN_ROOT?'CLAUDE_PLUGIN_ROOT':'cwd';const mjs=p.resolve(r,'server','mcp.mjs');if(!fs.existsSync(mjs)){console.error('FlowAgent MCP not found at '+mjs+' (resolved via '+src+'='+r+'). Run /setup to fix.');process.exit(1);}(async()=>{try{await import(require('node:url').pathToFileURL(mjs).href)}catch(e){console.error(e);process.exit(1)}})();"
]
}
}
diff --git a/plugins/power-automate/server/mcp.mjs b/plugins/power-automate/server/mcp.mjs
index 823de0d76..a370e637c 100644
--- a/plugins/power-automate/server/mcp.mjs
+++ b/plugins/power-automate/server/mcp.mjs
@@ -30660,7 +30660,8 @@ var FlowClient = class _FlowClient {
const headers = {
Authorization: `Bearer ${token}`,
Accept: "application/json",
- ...extraHeaders
+ ...extraHeaders,
+ "User-Agent": "power-automate-plugin/2.0.0"
};
if (body !== void 0) {
headers["Content-Type"] = "application/json";