Labsco
github logo

mcp-create-declarative-agent

✓ Official36,200

by github · part of github/awesome-copilot

Scaffold a declarative agent for Microsoft 365 Copilot integrated with an MCP server. Generates complete project structure including manifest.json, declarativeAgent.json, and ai-plugin.json with tool definitions auto-imported from MCP servers Supports OAuth 2.0 and SSO authentication with environment variable configuration and secure credential storage Provides response semantics mapping to extract and format API response data for Copilot consumption Includes MCP server integration workflow...

🔥🔥🔥✓ VerifiedFreeAdvanced setup
🧩 One of 7 skills in the github/awesome-copilot package — works on its own, and pairs well with its siblings.

Scaffold a declarative agent for Microsoft 365 Copilot integrated with an MCP server. Generates complete project structure including manifest.json, declarativeAgent.json, and ai-plugin.json with tool definitions auto-imported from MCP servers Supports OAuth 2.0 and SSO authentication with environment variable configuration and secure credential storage Provides response semantics mapping to extract and format API response data for Copilot consumption Includes MCP server integration workflow...

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by github

Scaffold a declarative agent for Microsoft 365 Copilot integrated with an MCP server. Generates complete project structure including manifest.json, declarativeAgent.json, and ai-plugin.json with tool definitions auto-imported from MCP servers Supports OAuth 2.0 and SSO authentication with environment variable configuration and secure credential storage Provides response semantics mapping to extract and format API response data for Copilot consumption Includes MCP server integration workflow... npx skills add https://github.com/github/awesome-copilot --skill mcp-create-declarative-agent Download ZIPGitHub36.2k

Copy & paste — that's it
---
mode: 'agent'
tools: ['changes', 'search/codebase', 'edit/editFiles', 'problems']
description: 'Create a declarative agent for Microsoft 365 Copilot by integrating an MCP server with authentication, tool selection, and configuration'
model: 'gpt-4.1'
tags: [mcp, m365-copilot, declarative-agent, model-context-protocol, api-plugin]
---

# Create MCP-based Declarative Agent for Microsoft 365 Copilot

Create a complete declarative agent for Microsoft 365 Copilot that integrates with a Model Context Protocol (MCP) server to access external systems and data.

## MCP Server Integration

### Supported MCP Endpoints
The MCP server must provide:
- **Server metadata** endpoint
- **Tools listing** endpoint (exposes available functions)
- **Tool execution** endpoint (handles function calls)

### Tool Selection
When importing from MCP:
1. Fetch available tools from server
2. Select specific tools to include (for security/simplicity)
3. Tool definitions are auto-generated in ai-plugin.json

### Authentication Types

**OAuth 2.0 (Static Registration)**
```json
"auth": {
 "type": "OAuthPluginVault",
 "reference_id": "${{OAUTH_REFERENCE_ID}}",
 "authorization_url": "https://auth.service.com/authorize",
 "client_id": "${{CLIENT_ID}}",
 "client_secret": "${{CLIENT_SECRET}}",
 "scope": "read write"
}

Single Sign-On (SSO)

Copy & paste — that's it
"auth": {
 "type": "SSO"
}

Response Semantics

Define Data Mapping

Use response_semantics to extract relevant fields from API responses:

Copy & paste — that's it
"capabilities": {
 "response_semantics": {
 "data_path": "$.results",
 "properties": {
 "title": "$.name",
 "subtitle": "$.description",
 "url": "$.link"
 }
 }
}

Add Adaptive Cards (Optional)

See the mcp-create-adaptive-cards prompt for adding visual card templates.

Best Practices

Tool Design

  • Focused functions: Each tool should do one thing well
  • Clear descriptions: Help the model understand when to use each tool
  • Minimal scoping: Only import tools the agent needs
  • Descriptive names: Use action-oriented function names

Security

  • Use OAuth 2.0 for production scenarios
  • Store secrets in environment variables
  • Validate inputs on the MCP server side
  • Limit scopes to minimum required permissions
  • Use reference IDs for OAuth registration

Instructions

  • Be specific about the agent's purpose and capabilities
  • Define behavior for both successful and error scenarios
  • Reference tools explicitly in instructions when applicable
  • Set expectations for users about what the agent can/cannot do

Performance

  • Cache responses when appropriate on MCP server
  • Batch operations where possible
  • Set timeouts for long-running operations
  • Paginate results for large datasets

Common MCP Server Examples

GitHub MCP Server

Copy & paste — that's it
URL: https://api.githubcopilot.com/mcp/
Tools: search_repositories, search_users, get_repository
Auth: OAuth 2.0

Jira MCP Server

Copy & paste — that's it
URL: https://your-domain.atlassian.net/mcp/
Tools: search_issues, create_issue, update_issue
Auth: OAuth 2.0

Custom Service

Copy & paste — that's it
URL: https://api.your-service.com/mcp/
Tools: Custom tools exposed by your service
Auth: OAuth 2.0 or SSO

Workflow

Ask the user:

  1. What MCP server are you integrating with (URL)?
  2. What tools should be exposed to Copilot?
  3. What authentication method does the server support?
  4. What should the agent's primary purpose be?
  5. Do you need response semantics or Adaptive Cards?

Then generate:

  • Complete appPackage/ structure (manifest.json, declarativeAgent.json, ai-plugin.json)
  • mcp.json configuration
  • .env.local template
  • Provisioning and testing instructions