Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

mcp-create-declarative-agentMCP create declarative Agent 搜索

Agent Skill

mcp-create-declarative-agent 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

199,592

周安装

8,327

GitHub Stars

31,730

下载量

66,584
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mcp-create-declarative-agent(MCP create declarative Agent 搜索)
来源仓库:https://github.com/github/awesome-copilot
仓库路径:skills/mcp-create-declarative-agent
安装命令:
npx skills add https://github.com/github/awesome-copilot --skill mcp-create-declarative-agent
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/github/awesome-copilot --skill mcp-create-declarative-agent

简介

Scaffold 是与 MCP 服务器集成的 Microsoft 365 Copilot 声明式代理。

  • 生成完整的项目结构,包括manifest.json、declarativeAgent.json和ai-plugin.json,并具有从MCP服务器自动导入的工具定义
  • 通过环境变量配置和安全凭证存储支持 OAuth 2.0 和 SSO 身份验证
  • 提供响应语义映射以提取和格式化 API 响应数据以供 Copilot 使用
  • 包括 MCP 服务器集成工作流程,涵盖工具选择、端点验证和通过 Teams 侧载进行的本地测试

SKILL.md

---
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.

## Requirements

Generate the following project structure using Microsoft 365 Agents Toolkit:

### Project Setup
1. **Scaffold declarative agent** via Agents Toolkit
2. **Add MCP action** pointing to MCP server
3. **Select tools** to import from MCP server
4. **Configure authentication** (OAuth 2.0 or SSO)
5. **Review generated files** (manifest.json, ai-plugin.json, declarativeAgent.json)

### Key Files Generated

**appPackage/manifest.json** - Teams app manifest with plugin reference:

{ "$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json", "manifestVersion": "devPreview", "version": "1.0.0", "id": "...", "developer": { "name": "...", "websiteUrl": "...", "privacyUrl": "...", "termsOfUseUrl": "..." }, "name": { "short": "Agent Name", "full": "Full Agent Name" }, "description": { "short": "Short description", "full": "Full description" }, "copilotAgents": { "declarativeAgents": [ { "id": "declarativeAgent", "file": "declarativeAgent.json" } ] } }


**appPackage/declarativeAgent.json** - Agent definition:

{ "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", "version": "v1.0", "name": "Agent Name", "description": "Agent description", "instructions": "You are an assistant that helps with [specific domain]. Use the available tools to [capabilities].", "capabilities": [ { "name": "WebSearch", "websites": [ { "url": "https://learn.microsoft.com" } ] }, { "name": "MCP", "file": "ai-plugin.json" } ] }


**appPackage/ai-plugin.json** - MCP plugin manifest:

{ "schema_version": "v2.1", "name_for_human": "Service Name", "description_for_human": "Description for users", "description_for_model": "Description for AI model", "contact_email": "support@company.com", "namespace": "serviceName", "capabilities": { "conversation_starters": [ { "text": "Example query 1" } ] }, "functions": [ { "name": "functionName", "description": "Function description", "capabilities": { "response_semantics": { "data_path": "$", "properties": { "title": "$.title", "subtitle": "$.description" } } } } ], "runtimes": [ { "type": "MCP", "spec": { "url": "https://api.service.com/mcp/" }, "run_for_functions": ["functionName"], "auth": { "type": "OAuthPluginVault", "reference_id": "${{OAUTH_REFERENCE_ID}}" } } ] }


**/.vscode/mcp.json** - MCP server configuration:

{ "serverUrl": "https://api.service.com/mcp/", "pluginFilePath": "appPackage/ai-plugin.json" }


## 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)**

"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)**

"auth": { "type": "SSO" }


## Response Semantics

### Define Data Mapping
Use `response_semantics` to extract relevant fields from API responses:

"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.

## Environment Configuration

Create `.env.local` or `.env.dev` for credentials:

OAUTH_REFERENCE_ID=your-oauth-reference-id CLIENT_ID=your-client-id CLIENT_SECRET=your-client-secret


## Testing & Deployment

### Local Testing
1. **Provision** agent in Agents Toolkit
2. **Start debugging** to sideload in Teams
3. Test in Microsoft 365 Copilot at https://m365.cloud.microsoft/chat
4. Authenticate when prompted
5. Query the agent using natural language

### Validation
- Verify tool imports in ai-plugin.json
- Check authentication configuration
- Test each exposed function
- Validate response data mapping

## 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

URL: https://api.githubcopilot.com/mcp/ Tools: search_repositories, search_users, get_repository Auth: OAuth 2.0


### Jira MCP Server

URL: https://your-domain.atlassian.net/mcp/ Tools: search_issues, create_issue, update_issue Auth: OAuth 2.0


### Custom Service

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

## Troubleshooting

### MCP Server Not Responding
- Verify server URL is correct
- Check network connectivity
- Validate MCP server implements required endpoints

### Authentication Fails
- Verify OAuth credentials are correct
- Check reference ID matches registration
- Confirm scopes are requested properly
- Test OAuth flow independently

### Tools Not Appearing
- Ensure mcp.json points to correct server
- Verify tools were selected during import
- Check ai-plugin.json has correct function definitions
- Re-fetch actions from MCP if server changed

### Agent Not Understanding Queries
- Review instructions in declarativeAgent.json
- Check function descriptions are clear
- Verify response_semantics extract correct data
- Test with more specific queries

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.2%
按下载量换算25,435

Claude

28.21%
按下载量换算18,783

Cursor

19.26%
按下载量换算12,824

Gemini CLI

9.26%
按下载量换算6,166

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills