Skip to main content
rule official · GitHub

power-platform-mcp-development — GitHub Copilot rule

This rule guides Power Platform custom connector work with MCP for Microsoft Copilot Studio. Use it when shaping schemas, auth flows, scripts, and validation.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/power-platform-mcp-development.instructions.md
Open on GitHub

What power-platform-mcp-development does

The rule steers GitHub Copilot toward Power Platform custom connectors that integrate with MCP. It calls for JSON-RPC 2.0, the x-ms-agentic-protocol: mcp-streamable-1.0 header, and endpoints that cover both REST behavior and MCP tool calls. Responses must fit Copilot Studio limits, including single-value types and self-contained schemas.

It covers OAuth 2.0, token audience checks, connection parameter sets, and OAuth or API key authentication options. The script.csx file handles JSON-RPC conversion, error responses, token checks, and MCP response transformation. Connector definitions use Swagger 2.0 with operationId values, response schemas, HTTP status codes, and headers.

The rule also addresses tools/list, tools/call, and resources/list, along with MIME types, streaming responses, capability detection, and tests against MCP servers. Copilot Studio will not handle $ref, so schemas need to be flattened and anyOf or oneOf reduced to a single compatible shape.

What it helps with

  • design a Power Platform MCP custom connector
  • convert JSON-RPC replies for Copilot Studio
  • flatten Swagger schemas without $ref
  • configure OAuth 2.0 and token audience checks
  • test MCP tools, resources, and error paths

Example prompts for the agent

  • Create a Power Platform custom connector for MCP using JSON-RPC 2.0 and x-ms-agentic-protocol: mcp-streamable-1.0.
  • Review the connector schemas for $ref, anyOf, and oneOf, then reshape them for Copilot Studio.
  • Update script.csx to convert MCP replies and return JSON-RPC 2.0 errors.

How to install power-platform-mcp-development

Manually: put the files in place

.github/instructions/power-platform-mcp-development.instructions.md

The applyTo field sets which files it applies to

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about power-platform-mcp-development

How do I install power-platform-mcp-development in GitHub Copilot?

Create .github/instructions/power-platform-mcp-development.instructions.md and place the rule in that file.

What does power-platform-mcp-development do?

It guides GitHub Copilot while building Power Platform custom connectors with MCP for Microsoft Copilot Studio, covering protocol handling, schemas, authentication, scripts, and tests.

What schema constraints does Copilot Studio require?

Schemas need to be self-contained. Remove $ref, use single types instead of type arrays, and flatten anyOf or oneOf constructs.

Source text

power-platform-mcp-development.instructions.md · MIT
---
description: 'Instructions for developing Power Platform custom connectors with Model Context Protocol (MCP) integration for Microsoft Copilot Studio'
applyTo: '**/*.{json,csx,md}'
---

# Power Platform MCP Custom Connector Development

## Instructions

### MCP Protocol Integration
- Always implement JSON-RPC 2.0 standard for MCP communication
- Use `x-ms-agentic-protocol: mcp-streamable-1.0` header for Copilot Studio compatibility
- Structure endpoints to support both standard REST operations and MCP tool invocation
- Transform responses to comply with Copilot Studio constraints (no reference types, single types only)

### Schema Design Best Practices
- Remove `$ref` and other reference types from JSON schemas as Copilot Studio cannot handle them
- Use single types instead of arrays of types in schema definitions
- Flatten `anyOf`/`oneOf` constructs to single schemas for Copilot Studio compatibility
- Ensure all tool input schemas are self-contained without external references

### Authentication and Security
- Implement OAuth 2.0 with MCP security best practices within Power Platform constraints
- Use connection parameter sets for flexible authentication configuration
- Validate token audience to prevent passthrough attacks
- Add MCP-specific security headers for enhanced validation
- Support multiple authentication methods (OAuth standard, OAuth enhanced, API key fallback)

### Custom Script Implementation
- Handle JSON-RPC transformation in the custom script (script.csx)
- Implement proper error handling with JSON-RPC error response format
- Add token validation and audience checking in authentication flow
- Transform MCP server responses for Copilot Studio compatibility
- Use connection parameters for dynamic security configuration

### Swagger Definition Guidelines
- Use Swagger 2.0 specification for Power Platform compatibility
- Implement proper `operationId` values for each endpoint
- Define clear parameter schemas with appropriate types and descriptions
- Add comprehensive response schemas for all success and error cases
- Include proper HTTP status codes and response headers

### Resource and Tool Management
- Structure MCP resources to be consumable as tool outputs in Copilot Studio
- Ensure proper MIME type declarations for resource content
- Add audience and priority annotations for better Copilot Studio integration
- Implement resource transformation to meet Copilot Studio requirements

### Connection Parameter Configuration
- Use enum dropdowns for OAuth version and security level selection
- Provide clear parameter descriptions and constraints
- Support multiple authentication parameter sets for different deployment scenarios
- Include validation rules and default values where appropriate
- Enable dynamic configuration through connection parameter values

### Error Handling and Logging
- Implement comprehensive error responses following JSON-RPC 2.0 error format
- Add detailed logging for authentication, validation, and transformation steps
- Provide clear error messages that help with troubleshooting
- Include proper HTTP status codes aligned with error conditions

### Testing and Validation
- Test connector with actual MCP server implementations
- Validate schema transformations work correctly with Copilot Studio
- Verify authentication flows for all supported parameter sets
- Ensure proper error handling for various failure scenarios
- Test connection parameter configurations and dynamic behavior

## Additional Guidelines

### Power Platform Certification Requirements
- Include comprehensive documentation (readme.md, CUSTOMIZE.md)
- Provide clear setup and configuration instructions
- Document all authentication options and security considerations
- Include proper publisher and stack owner information
- Ensure compliance with Power Platform connector certification standards

### MCP Server Compatibility
- Design for compatibility with standard MCP server implementations
- Support common MCP methods like `tools/list`, `tools/call`, `resources/list`
- Handle streaming responses appropriately for `mcp-streamable-1.0` protocol
- Implement proper protocol negotiation and capability detection

### Copilot Studio Integration
- Ensure tool definitions work correctly within Copilot Studio's constraints
- Test resource access and tool invocation from Copilot Studio interface
- Validate that transformed schemas produce expected behavior in conversations
- Confirm proper integration with Copilot Studio's agent framework

© github · MIT · github/awesome-copilot

Similar IDE rules

All IDE rules for Backend and APIs →

From the same set861

The whole set →
qa-engineering-best-practices A GitHub Copilot instruction file covering test strategy, the test pyramid, naming, assertions and bug reports. Useful when Copilot writes or reviews tests in your repo. ★ 40,418repo stars python-mcp-server Instructions for GitHub Copilot to build Model Context Protocol servers using Python SDK v2. Keeps generation aligned with the 2026-07-28 protocol spec. ★ 40,418repo stars powershell A GitHub Copilot rule that pushes it toward idiomatic PowerShell scripts following Microsoft's cmdlet guidelines. Useful when your repo has .ps1 and .psm1 files. ★ 40,418repo stars powershell-pester-6 Directs GitHub Copilot to follow Pester v6 testing patterns in PowerShell. Useful when writing test suites in *.Tests.ps1 without outdated v5 habits. ★ 40,418repo stars power-platform-connector A GitHub Copilot rule for writing JSON schemas of Power Platform custom connectors: Swagger 2.0, apiProperties and settings. ★ 40,418repo stars power-bi-security-rls-best-practices Power BI Row-Level Security rule for GitHub Copilot. Guides DAX role filtering, embedded analytics security, and Fabric Warehouse policies. ★ 40,418repo stars power-bi-report-design-best-practices This rule guides Power BI chart selection and report layout. Use it when planning a page, navigation, or visual explanations. ★ 40,418repo stars power-bi-devops-alm-best-practices A GitHub Copilot rule that steers the agent through Power BI version control, CI/CD pipelines and multi-stage deployment. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor