PowerPlatform MCP/CLI
模型上下文协议(MCP)服务器 和 用于查询的独立CLI 以及配置 PowerPlatform/WEB环境。支持多种环境、实体元数据、记录、插件、流、解决方案、工作流、业务规则、安全角色、自定义API、web资源等,包括自动化环境设置的写入操作。
为什么选择MCP+CLI?
主控程序 直接与AI客户端(Claude、Cursor、GitHub Copilot)集成,以交互式、对话式的方式探索您的环境。
命令行界面 将结果写入a 文件系统缓存 而不是将它们内联返回。MCP工具响应受AI客户端上下文窗口的约束,当查询具有数百个实体、流或插件步骤的环境时,上下文窗口可能会截断或降级结果。CLI通过将完整结果持久化到磁盘来避免这一限制,使它们可以在没有上下文压力的情况下用于后续分析。这两个接口共享相同的工具和功能。
安装
需要 Node.js 22+ (\` --目标环境(默认为首次配置)。
命令
实体
entity-metadata
entity-attributes
entity-attribute
entity-relationships
entity-keys
create-entity [--primary-name-schema ] [--primary-name-display ] [--description ] [--ownership ] [--has-activities] [--has-notes] [--solution ]
create-entity-string-attribute [--max-length ] [--required-level ] [--description ] [--solution ]
create-entity-memo-attribute [--max-length ] [--required-level ] [--description ] [--solution ]
create-entity-integer-attribute [--min ] [--max ] [--required-level ] [--description ] [--solution ]
create-entity-decimal-attribute [--precision ] [--min ] [--max ] [--required-level ] [--description ] [--solution ]
create-entity-money-attribute [--precision-source ] [--precision ] [--min ] [--max ] [--required-level ] [--description ] [--solution ]
create-entity-boolean-attribute [--true-label ] [--false-label ] [--default-value ] [--required-level ] [--description ] [--solution ]
create-entity-datetime-attribute [--format ] [--behavior ] [--required-level ] [--description ] [--solution ]
create-entity-picklist-attribute [-o ]... [--required-level ] [--description ] [--solution ]
create-entity-lookup [--required-level ] [--description ] [--cascade-delete ] [--solution ]
create-entity-alternate-key [--solution ]
delete-entity-attribute 记录
record
query-records [--max ]
create-record
update-record
delete-record
associate-records
disassociate-records [relatedRecordId]插件
plugin-assemblies [--include-managed] [--max ]
plugin-assembly [--include-disabled]
plugin-packages [--include-managed] [--max ]
plugin-type
entity-pipeline [--message ] [--include-disabled]
plugin-trace-logs [--entity ] [--message ] [--correlation-id ] [--step-id ] [--hours ] [--max ] [--exceptions-only]
all-plugin-steps [--include-disabled] [--max ]
sdk-message
register-plugin-package [--pkg-version ] [--solution ]
update-plugin-package --plugin-package-id [--pkg-version ]
create-plugin-step
[--stage ] [--mode ] [--rank ] [--supported-deployment ] [--description ] [--configuration ] [--message-filter-id ] [--solution ]
create-plugin-step-image [--name ] [--entity-alias ] [--image-type ] [--message-property-name ] [--attributes ]流动
flows [--active] [--name ] [--include-managed] [--max ]
flow-definition [--summary]
flow-inventory [--max ]
flow-runs [--status ] [--after ] [--before ] [--max ]
flow-run-details
flow-health [--days ] [--max-runs ] [--max-flows ] [--active]
search-workflows [--name ] [--entity ] [--category ] [--active] [--max ]
create-cloud-flow [--primary-entity ] [--solution ]
activate-flow
deactivate-flow 解决方案
solutions
solution
solution-components
publishers
add-solution-component [--add-required]
publish-customizations [--entity ]工作流
workflows [--active] [--max ]
workflow-definition [--summary]
ootb-workflows [--categories ]业务规则
business-rules [--active] [--max ]
business-rule 选项集
optionset 依赖项
check-dependencies 配置
connection-references [--managed-only] [--has-connection] [--no-connection] [--inactive] [--max-records ]
create-connection-reference [--description ] [--solution ]
environment-variables [--managed-only] [--max-records ]
create-environment-variable [--type ] [--default-value ] [--description ] [--solution ]
set-environment-variable-value [--existing-value-id ]自定义API
custom-apis [--include-managed] [--max ]
custom-api
create-custom-api [--binding-type ] [--bound-entity ] [--is-function] [--is-private] [--processing-type ] [--plugin-type-id ] [--plugin-type-name ] [--description ] [--solution ]
custom-api-response-properties
create-custom-api-response-property [--type ] [--description ] [--solution ]
custom-api-request-parameters
create-custom-api-request-parameter [--type ] [--description ] [--optional] [--solution ]Web资源
web-resources [--type ] [--name ] [--max ]
web-resource
create-web-resource [--type ] [--description ] [--solution ]
set-entity-icon [--solution ] [--web-resource-name ] [--display-name ] [--no-publish]表单和视图
entity-forms [--type ]
entity-form-fields
add-form-field
remove-form-field
entity-views
add-view-column [--width ]
set-view-columns [--order-by ] [--desc]
remove-view-column PAC集成
pac-auth Authenticate pac CLI using environment credentials
generate-models [--settings
] [--entities ] [--namespace ]
deploy-plugin
--plugin-id [--type ] [--configuration ]安全角色
security-roles [--solution ] [--include-system] [--include-privileges] [--max-records ]
security-role-privileges [--entity ] [--access-right ]服务端点
service-endpoints [--max ]______________________________________________________________________
发展
git clone https://github.com/michsob/powerplatform-mcp.git
cd powerplatform-mcp
npm install
cp .env.example .env # fill in credentials
npm run build
npm run inspector # test with MCP Inspector释放
要发布新版本,请执行以下操作:
- 更新
version在package.json - 将更改提交给
main - 创建并推送版本标签:
git tag v1.0.2
git push origin v1.0.2GitHub Actions将自动发布:
| 包 | npm | GitHub包 | Docker(GHCR) |
|---|---|---|---|
| MCP服务器 | npm i powerplatform-mcp | npm i @michsob/powerplatform-mcp | ghcr.io/michsob/powerplatform-mcp |
| CLI | npm i powerplatform-cli | npm i @michsob/powerplatform-cli | ghcr.io/michsob/powerplatform-cli |
npm发布使用 可信发布(OIDC) --不需要令牌或秘密。GitHub软件包和GHCR使用内置 GITHUB_TOKEN 自动。
许可证
麻省理工学院
](https://mseep.ai/app/michsob-powerplatform-mcp)
