Sponsored by Deepsite.site

powerplatform mcp/cli

Created By
michsoba year ago
A Model Context Protocol (MCP) server and standalone CLI for querying PowerPlatform / Dataverse environments. Supports multiple environments, entity metadata, records, plugins, flows, solutions, workflows, business rules, security roles, and more.
Content

PowerPlatform MCP / CLI

A Model Context Protocol (MCP) server and standalone CLI for querying PowerPlatform / Dataverse environments. Supports multiple environments, entity metadata, records, plugins, flows, solutions, workflows, business rules, security roles, and more.

Why MCP + CLI?

MCP integrates directly with AI clients (Claude, Cursor, GitHub Copilot) for interactive, conversational exploration of your environments.

CLI writes results to a file system cache instead of returning them inline. MCP tool responses are bound by the AI client's context window, which can truncate or degrade results when querying environments with hundreds of entities, flows, or plugin steps. The CLI avoids this limitation by persisting full results to disk, making them available for follow-up analysis without context pressure. Both interfaces share the same tools and capabilities.

Installation

Requires Node.js 22+ (< 25).

MCP Server

npm install -g powerplatform-mcp
# or
npx powerplatform-mcp

CLI

npm install -g powerplatform-cli
# or
npx powerplatform-cli

Docker

# MCP Server
docker pull ghcr.io/michsob/powerplatform-mcp
docker run --env-file .env ghcr.io/michsob/powerplatform-mcp

# CLI
docker pull ghcr.io/michsob/powerplatform-cli
docker run --env-file .env ghcr.io/michsob/powerplatform-cli entity-attributes account

Configuration

The tool supports multiple environments. Define them via environment variables:

POWERPLATFORM_ENVIRONMENTS=DEV,UAT,PROD

# For each environment, set:
POWERPLATFORM_DEV_URL=https://dev-org.crm.dynamics.com
POWERPLATFORM_DEV_CLIENT_ID=your-client-id
POWERPLATFORM_DEV_CLIENT_SECRET=your-client-secret
POWERPLATFORM_DEV_TENANT_ID=your-tenant-id

POWERPLATFORM_UAT_URL=https://uat-org.crm.dynamics.com
POWERPLATFORM_UAT_CLIENT_ID=...
POWERPLATFORM_UAT_CLIENT_SECRET=...
POWERPLATFORM_UAT_TENANT_ID=...

For local development, copy .env.example to .env and fill in your credentials.

MCP Server

The MCP server is designed for AI-powered clients (Claude, Cursor, GitHub Copilot).

Available MCP Tools (38)

All tools accept an optional environment parameter to target a specific environment (defaults to the first configured).

Entity

ToolDescriptionRequired Params
get-entity-metadataGet entity metadataentityName
get-entity-attributesList all attributes/fieldsentityName
get-entity-attributeGet a specific attributeentityName, attributeName
get-entity-relationshipsGet 1:N and N:N relationshipsentityName

Records

ToolDescriptionRequired ParamsOptional
get-recordGet a record by IDentityNamePlural, recordId
query-recordsOData queryentityNamePlural, filtermaxRecords (default 50)

Plugins

ToolDescriptionRequired ParamsOptional
get-plugin-assembliesList plugin assembliesincludeManaged, maxRecords
get-plugin-assembly-completeAssembly with types, steps, imagesassemblyNameincludeDisabled
get-entity-plugin-pipelinePlugins executing on an entityentityNamemessageFilter, includeDisabled
get-plugin-trace-logsPlugin trace logsentityName, messageName, correlationId, pluginStepId, exceptionOnly, hoursBack, maxRecords
get-all-plugin-stepsAll SDK message processing stepsincludeDisabled, maxRecords

Flows (Power Automate)

ToolDescriptionRequired ParamsOptional
get-flowsList cloud flows (smart filtering)activeOnly, maxRecords, nameContains, excludeSystem, excludeCustomerInsights, excludeCopilotSales
search-workflowsSearch workflows and flowsname, primaryEntity, description, category, statecode, maxResults
get-flow-definitionFull definition or parsed summaryflowIdsummary
get-flow-runsFlow run historyflowIdstatus, startedAfter, startedBefore, maxRecords
get-flow-run-detailsRun details with action-level errorsflowId, runId
cancel-flow-runCancel a running/waiting runflowId, runId
resubmit-flow-runRetry a failed runflowId, runId
scan-flow-healthBatch health scan (success rates)daysBack, maxRunsPerFlow, maxFlows, activeOnly
get-flow-inventoryLightweight flow inventorymaxRecords

Solutions

ToolDescriptionRequired ParamsOptional
get-publishersList non-readonly publishers
get-solutionsList visible solutions
get-solutionGet solution by unique nameuniqueName
get-solution-componentsList components in a solutionsolutionUniqueName
export-solutionExport solution (base64)solutionNamemanaged

Workflows (Classic)

ToolDescriptionRequired ParamsOptional
get-workflowsList classic workflowsactiveOnly, maxRecords
get-workflow-definitionXAML definition or summaryworkflowIdsummary
get-ootb-workflowsBackground, BPFs, actions, on-demandmaxRecords, categories

Business Rules

ToolDescriptionRequired ParamsOptional
get-business-rulesList business rulesactiveOnly, maxRecords
get-business-ruleBusiness rule with XAMLworkflowId

Option Sets

ToolDescriptionRequired Params
get-global-option-setGet a global option set definitionoptionSetName

Configuration

ToolDescriptionOptional
get-connection-referencesConnection referencesmaxRecords, managedOnly, hasConnection, inactive
get-environment-variablesEnvironment variable definitions + valuesmaxRecords, managedOnly

Security Roles

ToolDescriptionRequired ParamsOptional
get-security-rolesList customizable security rolessolutionUniqueName, excludeSystemRoles, includePrivileges, maxRecords
get-security-role-privilegesPrivileges for a roleroleIdentityFilter, accessRightFilter

Dependencies

ToolDescriptionRequired Params
check-component-dependenciesDependencies blocking deletioncomponentId, componentType
check-delete-eligibilityCheck if a component can be deletedcomponentId, componentType

Service Endpoints

ToolDescriptionOptional
get-service-endpointsService Bus, webhooks, Event Hub, Event GridmaxRecords

MCP Prompts

PromptDescriptionRequired Args
entity-overviewEntity overview with key attributes and relationshipsentityName
attribute-detailsDetailed attribute info (type, format, requirements)entityName, attributeName
query-templateOData query template with example filtersentityName
relationship-mapComplete 1:N and N:N relationship mapentityName

CLI

Same tools as the MCP server, but results are cached to the file system for full-fidelity output on large data sets.

Global Option

--env <name> — target environment (defaults to first configured).

Commands

Entity

entity-metadata <entityName>
entity-attributes <entityName>
entity-attribute <entityName> <attributeName>
entity-relationships <entityName>

Records

record <entityNamePlural> <recordId>
query-records <entityNamePlural> <filter>  [--max <n>]

Plugins

plugin-assemblies                          [--include-managed] [--max <n>]
plugin-assembly <assemblyName>
entity-pipeline <entityName>               [--message <msg>] [--include-disabled]

Flows

flows                                      [--active] [--name <contains>] [--max <n>]
flow-definition <flowId>                   [--summary]
search-workflows                           (interactive filters)

Solutions

solutions
solution <uniqueName>
solution-components <uniqueName>

Workflows

workflows                                  [--active] [--max <n>]
workflow-definition <workflowId>           [--summary]
ootb-workflows                             [--categories <0,1,2,3,4>]

Business Rules

business-rules                             [--active] [--max <n>]
business-rule <workflowId>

Option Sets

optionset <optionSetName>

Dependencies

check-dependencies <componentId> <componentType>

Configuration

connection-references                      [--managed-only] [--has-connection] [--no-connection] [--inactive] [--max-records <n>]
environment-variables                      [--managed-only] [--max-records <n>]

Security Roles

security-roles                             [--solution <name>] [--include-system] [--include-privileges] [--max-records <n>]
security-role-privileges <roleId>          [--entity <name>] [--access-right <type>]

Service Endpoints

service-endpoints                          [--max <n>]

Development

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

Releasing

To publish a new version:

  1. Update version in package.json
  2. Commit the change to main
  3. Create and push a version tag:
    git tag v1.0.2
    git push origin v1.0.2
    

GitHub Actions will automatically publish:

PackagenpmGitHub PackagesDocker (GHCR)
MCP Servernpm i powerplatform-mcpnpm i @michsob/powerplatform-mcpghcr.io/michsob/powerplatform-mcp
CLInpm i powerplatform-clinpm i @michsob/powerplatform-clighcr.io/michsob/powerplatform-cli

npm publishing uses Trusted Publishing (OIDC) — no tokens or secrets needed. GitHub Packages and GHCR use the built-in GITHUB_TOKEN automatically.

License

MIT

Server Config

{
  "mcpServers": {
    "powerplatform": {
      "command": "npx",
      "args": [
        "-y",
        "powerplatform-mcp"
      ],
      "env": {
        "POWERPLATFORM_ENVIRONMENTS": "DEV,UAT,PROD",
        "POWERPLATFORM_DEV_URL": "https://dev-org.crm.dynamics.com",
        "POWERPLATFORM_DEV_CLIENT_ID": "...",
        "POWERPLATFORM_DEV_CLIENT_SECRET": "...",
        "POWERPLATFORM_DEV_TENANT_ID": "...",
        "POWERPLATFORM_UAT_URL": "https://uat-org.crm.dynamics.com",
        "POWERPLATFORM_UAT_CLIENT_ID": "...",
        "POWERPLATFORM_UAT_CLIENT_SECRET": "...",
        "POWERPLATFORM_UAT_TENANT_ID": "..."
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Tavily Mcp
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs