
Power Automate Mcp Server
io.github.sapientsai由 GitHub 账号 sapientsai 发布v0.2.4更新于 Oct 24, 2026
Inspect, operate, and author Microsoft Power Automate cloud flows from an agent context.
概览
一个本地 MCP 服务器,让助手通过非官方 Flow API 查看、操作和编写 Microsoft Power Automate 云流。
- 可以做什么
- 列出环境、流和流所有者,并查看流的定义与连接引用。查看流运行记录和运行详情,包括首次失败信息和原始属性,便于排查问题。检查连接及其状态和到期时间。启用写操作后,可创建、更新、删除、启用或禁用流。还可取消或重新提交运行,以及添加或移除流所有者。报告服务器信息,并将反馈作为 GitHub 问题提交。
- 适用场景
- 适合需要审计或排查 Power Automate 流、检查运行失败和连接,或在命令行或代理环境中以编程方式修改流的场景。README 指出,编写复杂流逻辑仍以门户的可视化设计器为佳。
- 运行要求
- 通过 stdio 在本地运行,通常用 npx 配合 Node.js。需要一个具有 Microsoft Flow Service 委派权限的 Entra 应用注册和 AZURE_CLIENT_ID;Flow 受众需要 AZURE_TENANT_ID。默认使用交互式设备代码登录;clientCredentials 模式需要 AZURE_CLIENT_SECRET 和已获管理员同意的应用程序权限。可选设置包括 DEFAULT_ENVIRONMENT、FLOW_SCOPES 和 ENABLE_WRITE_OPS。
安装
在 SourceWeft 中
- 打开 控制台中的 Power Automate Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
power-automate-mcp-server
[Node.js CI] [npm version] [npm downloads] [License: MIT]
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
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)
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).
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
Recommended: 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)
Write (require ENABLE_WRITE_OPS=true)
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
[!WARNING] 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_KEYis 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.
Development
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] SapientsAI — Building agentic AI for businesses
来源:README.md,提交 461a1a1
工具
0版本历史
1- v0.2.4最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分