MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Mcp-M365-Copilot

Mcp-M365-Copilot是一款code方向的AI技能,核心价值是Best practices for building MCP-based declarative agents and API plugins for Microsoft 365 Copilot with Model Context Protocol integration,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Best practices for building MCP-based declarative agents and API plugins for Microsoft 365 Copilot with Model Context Protocol integration

Last verified on: 2026-05-30
mkdir -p ./skills/mcp-m365-copilot && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/mcp-m365-copilot/SKILL.md -o ./skills/mcp-m365-copilot/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# MCP-based M365 Copilot Development Guidelines


Core Principles


Model Context Protocol First

- Leverage MCP servers for external system integration

- Import tools from server endpoints, not manual definitions

- Let MCP handle schema discovery and function generation

- Use point-and-click tool selection in Agents Toolkit


Declarative Over Imperative

- Define agent behavior through configuration, not code

- Use declarativeAgent.json for instructions and capabilities

- Specify tools and actions in ai-plugin.json

- Configure MCP servers in mcp.json


Security and Governance

- Always use OAuth 2.0 or SSO for authentication

- Follow principle of least privilege for tool selection

- Validate MCP server endpoints are secure

- Review compliance requirements before deployment


User-Centric Design

- Create adaptive cards for rich visual responses

- Provide clear conversation starters

- Design for responsive experience across hubs

- Test thoroughly before organizational deployment


MCP Server Design


Server Selection

Choose MCP servers that:

- Expose relevant tools for user tasks

- Support secure authentication (OAuth 2.0, SSO)

- Provide reliable uptime and performance

- Follow MCP specification standards

- Return well-structured response data


Tool Import Strategy

- Import only necessary tools (avoid over-scoping)

- Group related tools from same server

- Test each tool individually before combining

- Consider token limits when selecting multiple tools


Authentication Configuration

**OAuth 2.0 Static Registration:**

json
{
  "type": "OAuthPluginVault",
  "reference_id": "YOUR_AUTH_ID",
  "client_id": "github_client_id",
  "client_secret": "github_client_secret",
  "authorization_url": "https://github.com/login/oauth/authorize",
  "token_url": "https://github.com/login/oauth/access_token",
  "scope": "repo read:user"
}

**SSO (Microsoft Entra ID):**

json
{
  "type": "OAuthPluginVault",
  "reference_id": "sso_auth",
  "authorization_url": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
  "token_url": "https://login.microsoftonline.com/common/oauth2/v2.0/token",
  "scope": "User.Read"
}

File Organization


Project Structure

text
project-root/
├── appPackage/
│   ├── manifest.json           # Teams app manifest
│   ├── declarativeAgent.json   # Agent config (instructions, capabilities)
│   ├── ai-plugin.json          # API plugin definition
│   ├── color.png               # App icon color
│   └── outline.png             # App icon outline
├── .vscode/
│   └── mcp.json               # MCP server configuration
├── .env.local                  # Credentials (NEVER commit)
└── teamsapp.yml               # Teams Toolkit config

Critical Files


**declarativeAgent.json:**

- Agent name and description

- Instructions for behavior

- Conversation starters

- Capabilities (actions from plugins)


**ai-plugin.json:**

- MCP server tools import

- Response semantics (data_path, properties)

- Static adaptive card templates

- Function definitions (auto-generated)


**mcp.json:**

- MCP server URL

- Server metadata endpoint

- Authentication reference


**.env.local:**

- OAuth client credentials

- API keys and secrets

- Environment-specific config

- **CRITICAL**: Add to .gitignore


Response Semantics Best Practices


Data Path Configuration

Use JSONPath to extract relevant data:

json
{
  "data_path": "$.items[*]",
  "properties": {
    "title": "$.name",
    "subtitle": "$.description", 
    "url": "$.html_url"
  }
}

Template Selection

For dynamic templates:

json
{
  "data_path": "$",
  "template_selector": "$.templateType",
  "properties": {
    "title": "$.title",
    "url": "$.url"
  }
}

Static Templates

Define in ai-plugin.json for consistent formatting:

- Use when all responses follow same structure

- Better performance than dynamic templates

- Easier to maintain and version control


Adaptive Card Guidelines


Design Principles

- **Single-column la

🎯 Best For

  • UI designers
  • Product designers
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Generating component mockups
  • Creating design system tokens
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Mcp-M365-Copilot to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Is Mcp-M365-Copilot compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Mcp-M365-Copilot?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Mcp-M365-Copilot?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/mcp-m365-copilot/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping usability testing

AI-generated designs should be validated with real users before development.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills