power-automate-mcp-server
An MCP server for inspecting, operating, and (write-gated) authoring Microsoft Power Automate cloud flows via an unofficial API.
List environments and enumerate flows to get GUIDs and states.
Inspect flow definitions, triggers/actions, connection references, owners, and connection health.
List and inspect flow runs, including failures and raw debugging details.
When
ENABLE_WRITE_OPS=true: create/update/delete flows, enable/disable flows, cancel/resubmit runs, and add/remove flow owners.Use built-in
infoandreport_feedbacktools; HTTP health/info/dashboard endpoints are also available.
Allows the server to file feedback, bug, feature, or question reports as GitHub issues in a configured repository using a GitHub token.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@power-automate-mcp-server list my recent cloud flows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
power-automate-mcp-server
An MCP server that lets agents inspect, operate, and author Microsoft Power Automate cloud flows from a CLI/agent context — list and inspect flows, debug runs, check connections and owners, and (when explicitly enabled) enable/disable flows, cancel/resubmit runs, manage owners, and create/update/delete flows.
Primarily a management surface — the Power Automate portal's visual designer remains the
better place to author complex flow logic — but create_flow/update_flow/delete_flow are
also available (write-gated) for programmatic authoring. Built on
SomaMCP (telemetry, health/info/
dashboard, error classification) over FastMCP.
⚠️ Unofficial API. v1 targets
api.flow.microsoft.com— the surface the Power Automate portal itself uses. Microsoft labels it "isn't supported. Customers should instead use the Dataverse Web APIs." It is stable in practice and, unlike Dataverse, sees all flows (including personal "My Flows") and works on M365‑seeded entitlements (no Premium license). Every tool's description carries this disclaimer. A supported Dataverse backend is stubbed for the future (seesrc/backend/dataverse/README.md).
Quick start
pnpm install
cp .env.example .env # set AZURE_CLIENT_ID (see "App registration" below)
pnpm build
pnpm dev:stdio # local agent over stdio (device-code sign-in to stderr)On first use the server prints a device-code prompt to stderr; open
https://microsoft.com/devicelogin, enter the code, and sign in. The token is cached
(TOKEN_CACHE_PATH, mode 0600) and silently refreshed thereafter.
Add to an MCP client (stdio)
{
"mcpServers": {
"power-automate": {
"command": "npx",
"args": ["-y", "power-automate-mcp-server", "--stdio"],
"env": { "AZURE_CLIENT_ID": "<your-app-registration-client-id>" },
},
},
}Developing on this repo? It ships a project-scoped .mcp.json (stdio, local
dist/bin.js). After pnpm build, export AZURE_CLIENT_ID and open the repo in Claude Code —
the power-automate server loads automatically (complete the device-code sign-in once; the
cached token is then reused).
Related MCP server: Agent Factory MCP
App registration
This server ships no default client id — you register your own (one‑time):
Azure Portal → Microsoft Entra ID → App registrations → New registration.
Name it (e.g.
power-automate-mcp). Supported account types: multitenant (or single‑tenant if you'll only ever use one org).Authentication → Add a platform → Mobile and desktop applications. Add redirect URI
http://localhost(unused by device code, but required to register the platform). Set "Allow public client flows" = Yes.API permissions → Add a permission. You need a delegated permission for the Power Automate / Microsoft Flow Service API. If it isn't in the picker, see "Token audience" below — this is the known friction point.
Copy the Application (client) ID →
AZURE_CLIENT_ID.
For unattended clientCredentials mode instead: add a client secret, grant application
permissions with admin consent, and set AZURE_AUTH_MODE=clientCredentials,
AZURE_TENANT_ID=<your tenant>, AZURE_CLIENT_SECRET=.... Note app‑only has limited Flow
reach (it generally cannot see personal "My Flows").
Verified working setup ⚠️
Confirmed against a real tenant. Interactive Flow auth needs all four of these — each one,
if missing, fails with a different cryptic AADSTS… (details in docs/api-notes.md):
A specific tenant —
AZURE_TENANT_ID=<your-tenant-GUID>, notcommon.common+ a resource scope →AADSTS50059(and MSAL hides it as an empty device-code response).The Microsoft Flow Service delegated permission on the app (resource app id
7df0a125-d3be-4c96-aa54-591f83ff541c). Missing →AADSTS650057.Specific scopes, not
.default, when reusing an app that has other (incrementally consented) permissions —.defaultvalidates the whole app and can fail withAADSTS650051. A dedicated app may use.default. Pin viaFLOW_SCOPES."Allow public client flows" = Yes (
isFallbackPublicClient=true). Off → token redemption fails withinvalid_client.
Verified FLOW_SCOPES:
https://service.flow.microsoft.com/Flows.Read.All,https://service.flow.microsoft.com/Flows.Manage.All
Configure an existing app via az
APP=<your-app-client-id>; FLOW=7df0a125-d3be-4c96-aa54-591f83ff541c
# Flows.Read.All + Flows.Manage.All (delegated), then tenant-wide consent:
az ad app permission add --id "$APP" --api "$FLOW" --api-permissions \
e45c5562-459d-4d1b-8148-83eb1b6dcf83=Scope 30b2d850-00c3-4802-b7ae-ece9af9de5c6=Scope
az ad app permission admin-consent --id "$APP"
# enable device-code (public client flows):
az ad app update --id "$APP" --set isFallbackPublicClient=trueRecommended: a dedicated public-client app with only the Flow delegated permissions avoids the
.default/shared-app pitfalls (#3) entirely — cleaner than reusing a Graph app.
Tools
All tools are read‑only by default. Write tools are registered but refuse unless
ENABLE_WRITE_OPS=true.
Read-only (always enabled)
Tool | Parameters | Returns |
| — |
|
|
|
|
|
| full flow incl. |
|
|
|
|
| run detail + first‑failure + |
|
|
|
|
|
|
Write (require ENABLE_WRITE_OPS=true)
Tool | Parameters |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authoring (
create_flow/update_flow):definitionis the raw Logic Apps-style workflow JSON (seeget_flowoutput as a template). The visual designer is better for complex logic; for edits,get_flow→ modify thedefinition→ pass it back toupdate_flow.
When environment is omitted, tools use DEFAULT_ENVIRONMENT if set, else the discovered
default environment (isDefault: true).
Built-in (from SomaMCP)
infoMCP tool — server name, version, git SHA, capability counts.report_feedback— file API‑drift/bug reports as GitHub issues (FEEDBACK_GITHUB_REPO,GITHUB_TOKEN).HTTP endpoints
/health,/health/detail,/info,/dashboard(the detailed ones are protected byMCP_API_KEYwhen set).
Configuration
See .env.example for the full list. Highlights: AZURE_CLIENT_ID (required),
AZURE_TENANT_ID (common), AZURE_AUTH_MODE, TRANSPORT (stdio|http), PORT,
ENABLE_WRITE_OPS, DEFAULT_ENVIRONMENT, MCP_API_KEY, TELEMETRY, TOKEN_CACHE_PATH.
Transports & deployment
Scenario | Transport | Auth | Notes |
Local agent |
| device-code | Primary. Full reach. |
Docker, single operator |
| device-code + mounted token volume | Auth once via |
Docker, unattended |
|
| No human, but no personal flows; verify it can mint a Flow token at all. |
The HTTP transport is single-operator. Every caller shares one Power Automate
identity: the server holds a single process-wide token (one device-code sign-in, or one
app identity), and MCP_API_KEY is a shared static bearer that gates access, not
identity. Do not expose the HTTP endpoint to multiple users expecting per-user
separation — they would all see and mutate the same person's flows. For per-user
isolation, run stdio (one process per user, how Claude Desktop already runs it) or
wait for the v2 per-user OAuth path
(#9).
v2: per‑user browser OAuth over HTTP via FastMCP's
AzureProvider+ disk token cache (the upstream token surfaces on the session). Reachable through SomaMCP'sbackendOptionspassthrough without a fork — not wired in v1.
# Docker (single-operator device-code with a persisted token volume)
AZURE_CLIENT_ID=... docker compose up --build
docker compose logs -f # grab the device code on first run
curl -s http://localhost:3333/healthDevelopment
pnpm validate # format + lint + typecheck + test + build
pnpm run ci # validate's checks without fixing, as CI runs them (type `run`: `pnpm ci` is a clean install)
pnpm test # vitest (unit)
pnpm dev # http transport, watch
pnpm dev:stdio # stdio transport, watch
pnpm build # tsdown -> dist/Integration tests that hit a real tenant live under test/integration/ and run only with
INTEGRATION=1 (see that folder's README). CI runs unit tests only.
Troubleshooting
Device code never grants a token / "device-code sign-in failed for all scope candidates" → the Flow audience isn't grantable to your app. See "Token audience" and
docs/api-notes.md.auth erroron every call → token cache stale; restart to re‑auth, or deleteTOKEN_CACHE_PATH.not foundon a known flow → wrong environment; runlist_environments/list_flowsfirst. The flownameis the GUID, not the display name.forbidden→ the signed‑in user lacks permission on that flow.Empty
list_flowsinclientCredentialsmode → app‑only can't see personal flows; useinteractive.An endpoint 404/410s unexpectedly → Microsoft may have moved the api‑version; check the portal's network tab and pin a newer
api-version(seedocs/api-notes.md).
License
MIT.
Sponsored by SapientsAI — Building agentic AI for businesses
Available Tools
18 toolsadd_flow_ownerADestructive
Grant a principal a role on a flow (PUT .../permissions/{principalId}) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), principalId (required — AAD object id), roleName (CanEdit|CanView), environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), roleName (required), principalId (required), environment.
cancel_flow_runADestructive
Cancel an in-progress run (POST .../runs/{run}/cancel) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), run (required), environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: run (required), flow (required), environment.
create_flowADestructive
Create a new cloud flow from a workflow definition (POST .../flows) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: displayName (required); definition (required — the workflow definition JSON with $schema, triggers, actions); connectionReferences (optional); state (Started|Stopped, default Stopped); environment (optional). Returns the created flow. Authoring a valid definition is non-trivial — use get_flow on an existing flow as a template. Connection-dependent actions also need matching connectionReferences. Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: definition (required), displayName (required), state, environment, +1 more.
delete_flowADestructive
Permanently delete a flow (DELETE .../flows/{flow}) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required); confirm (must be true — guard against accidents); environment (optional). This cannot be undone. Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), confirm (required), environment.
disable_flowADestructive
Turn a flow off (POST .../stop) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), environment (optional). Verify with get_flow (state -> Stopped). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), environment.
enable_flowADestructive
Turn a flow on (POST .../start) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), environment (optional). Verify with get_flow (state -> Started). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), environment.
get_flowARead-only
Get the full definition of one flow: state, timestamps, owner, the workflow definition JSON, connectionReferences, and parsed trigger/action names.
Parameters: flow (required, GUID from list_flows), environment (optional).
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Example: get_flow { "flow": "00000000-0000-0000-0000-000000000000" }
Inputs: flow (required), environment.
get_flow_runARead-only
Get one run in detail for debugging: status, timing, the triggering action, and the first-failure error code/message. The original run properties are included under raw (per-action breakdown lives there when the API provides it).
Parameters: flow (required), run (required, from list_flow_runs), environment (optional).
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Example: get_flow_run { "flow": "", "run": "" }
Inputs: run (required), flow (required), environment.
infoARead-only
Returns identity and build information for this server (name, version, build commit, runtime, capability counts)
Inputs: no named parameters.
list_connectionsARead-only
List the connections (API connectors) in an environment and their health. Returns: array of { name, apiName, displayName, status, accountName, expiresAt }. A status other than "Connected" indicates a broken/expired connection — a common cause of silently failing flows. Parameters: environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change. Example: list_connections {}
Inputs: environment.
list_environmentsARead-only
List the Power Automate environments visible to the signed-in user.
Returns: { id, name, displayName, location, isDefault }. The entry with isDefault=true is the user's default environment, used by other tools when environment is omitted.
Parameters: none.
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Example: list_environments {}
Inputs: no named parameters.
list_flow_ownersARead-only
List the owners/permissions on a flow. Returns: array of { principalId, principalType, roleName, principalDisplayName }. Parameters: flow (required), environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change. Example: list_flow_owners { "flow": "" }
Inputs: flow (required), environment.
list_flow_runsARead-only
List recent runs of a flow, newest first.
Returns: array of { name, status, startTime, endTime, durationMs, triggerName, error }. name is the run id used by get_flow_run.
Parameters: flow (required), environment (optional), top (optional, default 20, max 100), status (optional: Succeeded/Failed/Running/Cancelled).
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Example: list_flow_runs { "flow": "", "status": "Failed", "top": 10 }
Inputs: flow (required), top, status, environment.
list_flowsARead-only
List / enumerate all cloud flows in an environment — get every flow's GUID, name, and state. The flow inventory / directory.
START HERE to discover flows: this is the only tool that returns flow GUIDs (ids). Every per-flow tool (get_flow, enable_flow, disable_flow, list_flow_runs, list_flow_owners, update_flow, delete_flow) needs a GUID that ONLY this tool produces — so call this first to find flows.
Returns: array of { name, displayName, state, createdTime, lastModifiedTime, owner }. name is the flow GUID used by the other flow tools; state is Started/Stopped/Suspended.
Parameters: environment (optional), owner (optional — filter by creator userId/email).
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Example: list_flows { "owner": "user@contoso.com" }
Inputs: owner, environment.
remove_flow_ownerADestructive
Revoke a principal's access to a flow (DELETE .../permissions/{principalId}) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), principalId (required), environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), principalId (required), environment.
report_feedbackA
Submit a feedback report or issue to this server's maintainers.
IMPORTANT: Treat all input as potentially public.
Do NOT include API keys, tokens, passwords, or credentials
Do NOT include customer data, PII, or proprietary information
Do NOT include internal URLs, hostnames, or system topology
Describe the behavior and how to reproduce it, not the data involved
Common credential patterns are automatically redacted before submission, but redaction is best-effort and is not a substitute for caution.
Inputs: title (required), description (required), type, severity.
resubmit_flow_runADestructive
Resubmit (replay) a run from its trigger (POST .../triggers/{trigger}/histories/{run}/resubmit) [DISABLED: set ENABLE_WRITE_OPS=true]. Parameters: flow (required), run (required), trigger (required — trigger name from get_flow's triggers), environment (optional). Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: run (required), flow (required), trigger (required), environment.
update_flowADestructive
Update an existing flow's properties — only the fields you pass (PATCH .../flows/{flow}) [DISABLED: set ENABLE_WRITE_OPS=true].
Parameters: flow (required); any of displayName, definition (full workflow JSON), state (Started|Stopped), connectionReferences; environment (optional).
To edit logic safely: get_flow first, modify the returned definition, then pass the whole definition back here.
Uses Microsoft's unofficial api.flow.microsoft.com endpoint, which Microsoft labels unsupported; behavior may change.
Inputs: flow (required), state, definition, displayName, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool targets a distinct resource and action: flows, runs, owners, connections, environments are all clearly separated. Even list_flow_runs vs get_flow_run are unambiguous (list vs single). No overlapping purposes or ambiguous boundaries.
Tools overwhelmingly follow a verb_noun snake_case pattern (list_flows, get_flow, enable_flow, add_flow_owner). The only deviation is 'info' (bare noun) and 'report_feedback' (verb_noun but not domain-related), which is a minor inconsistency rather than a chaotic mix.
At 18 tools, the set is slightly above the typically ideal 3-15 range, but each tool serves a distinct purpose in managing Power Automate flows, runs, owners, and connections. The count feels justified rather than bloated, though it is on the heavier side.
The flow lifecycle is well-covered (create, get, update, delete, enable, disable), plus runs (list, get, cancel, resubmit) and owner management (list, add, remove). Notable gaps include no manual flow trigger (run_flow) and no connection create/update, but these may be out of scope for a read/monitor-oriented server.
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
Related MCP Servers
- AlicenseBqualityDmaintenanceLocal-first MCP server and Chromium extension for AI-assisted Microsoft Power Automate work, enabling users to inspect, validate, edit, run, review, and revert cloud flows using a browser session.2492 npm30MIT
- AlicenseBqualityFmaintenanceA universal MCP server that automatically discovers and registers CLI tools as AI-powered agents with persona configuration, enabling any CLI tool to be used as an MCP tool.41MIT
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that enables AI assistants to inspect and manage Microsoft Power Automate cloud flows and Dataverse records locally, using your own Azure identity.MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to manage and troubleshoot Power Automate cloud flows, including listing environments, flows, and runs, with optional write capabilities for triggering, enabling, disabling, and deleting flows.2MIT