home / mcp / powerplatform mcp server

PowerPlatform MCP Server

PowerPlatform Model Context Protocol server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "michsob-powerplatform-mcp": {
      "command": "powerplatform-mcp",
      "args": [],
      "env": {
        "POWERPLATFORM_URL": "https://yourenvironment.crm.dynamics.com",
        "POWERPLATFORM_CLIENT_ID": "YOUR_AZURE_CLIENT_ID",
        "POWERPLATFORM_TENANT_ID": "YOUR_TENANT_ID",
        "POWERPLATFORM_CLIENT_SECRET": "YOUR_AZURE_CLIENT_SECRET"
      }
    }
  }
}

You can deploy and run a PowerPlatform MCP Server to gain intelligent, context-aware access to Dataverse entities and records. This server exposes tools to explore metadata, build OData queries, map relationships, and generate AI-assisted data models, enabling powerful, integrated assistance for Power Platform development tasks.

How to use

To use the PowerPlatform MCP Server, run it with a compatible MCP client and interact with the available tools to retrieve entity metadata, fetch records, and build complex queries. You can leverage pre-defined prompts to get entity overviews, attribute details, query templates, and relationship maps. Use natural language requests or explicit tool invocations to guide the AI in your environment.

How to install

Prerequisites: Node.js installed on your machine. Ensure you have a supported MCP client that can communicate with the MCP server.

# Option 1: Install globally and run
npm install -g powerplatform-mcp

# Start the server
powerplatform-mcp

# Option 2: Run directly with npx
npx powerplatform-mcp

Configuration

Configure your Power Platform connection details using the following environment variables before starting the server.

# PowerPlatform/Dataverse connection details
POWERPLATFORM_URL=https://yourenvironment.crm.dynamics.com
POWERPLATFORM_CLIENT_ID=your-azure-app-client-id
POWERPLATFORM_CLIENT_SECRET=your-azure-app-client-secret
POWERPLATFORM_TENANT_ID=your-azure-tenant-id

For development

If you are developing or testing locally, follow these steps to clone, install, and run the project with your credentials.

# 1. Clone the repository and install dependencies
git clone https://github.com/michsob/powerplatform-mcp.git
cd powerplatform-mcp
npm install

# 2. Copy environment template and fill in credentials
cp .env.example .env

Notes and examples

The server provides tools for entity metadata and records retrieval, plus prompts for rich, context-aware information. You can invoke prompts to obtain an ENTITY_OVERVIEW, ATTRIBUTE_DETAILS, QUERY_TEMPLATE, or RELATIONSHIP_MAP for a given entity.

Tools and prompts overview

Available tools let you retrieve metadata, attributes, records, and relationship information, as well as use pre-defined prompts to generate structured outputs.

# Example tool usage
# Get metadata for an entity
get-entity-metadata

# Get a specific attribute
get-entity-attribute

# Use a powerplatform prompt to get an ENTITY_OVERVIEW for the account entity
USE Prompts:
- ENTITY_OVERVIEW
- ATTRIBUTE_DETAILS
- QUERY_TEMPLATE
- RELATIONSHIP_MAP

Security and access

Keep credentials secure and limit access to the MCP server to trusted clients. Use environment variables to supply sensitive information and avoid hard-coding secrets in code.

Troubleshooting

If you encounter connection or authentication issues, verify your POWERPLATFORM_URL, CLIENT_ID, CLIENT_SECRET, and TENANT_ID. Ensure the MCP server process has network access to your Dataverse environment and that the Azure app has the required permissions.

Available tools

get-entity-metadata

Retrieve comprehensive metadata for a PowerPlatform entity including schema, display names, and key attributes.

get-entity-attributes

Fetch all attributes/fields for a specified entity.

get-entity-attribute

Retrieve details for a single attribute of an entity.

get-entity-relationships

Obtain the relationships associated with a specific entity.

get-global-option-set

Access the global option sets available in the Dataverse environment.

get-record

Fetch a single record by entity name and ID.

query-records

Query multiple records using an OData filter expression.

use-powerplatform-prompt

Invoke predefined AI prompts to generate structured, context-rich outputs about entities.

ENTITY_OVERVIEW

Prompt type that provides a comprehensive overview of an entity.

ATTRIBUTE_DETAILS

Prompt type that gives detailed information about a specific attribute.

QUERY_TEMPLATE

Prompt type that returns an OData query template for an entity.

RELATIONSHIP_MAP

Prompt type that produces a visual-like map of entity relationships.