Skip to main content
Glama
tifanygracini

JokesMCPTool

Microsoft Copilot Studio ❤️ MCP

欢迎参加 Microsoft Copilot Studio ❤️ MCP 实验室。在本实验室中,你将学习如何部署 MCP Server,以及如何将其添加到 Microsoft Copilot Studio。

什么是 MCP?

Model Context Protocol (MCP) 是一种开放协议,由 Anthropic 定义,用于标准化应用程序向 LLM 提供上下文的方式。MCP 提供了一种标准化方式,将 AI 模型连接到不同的数据源和工具。MCP 允许制作者将现有的知识服务器和 API 直接无缝集成到 Copilot Studio 中。

目前,Copilot Studio 仅支持工具。要了解有关当前功能的更多信息,请参阅 aka.ms/mcsmcp。存在一些已知问题和计划中的改进,这些已列在此处

Related MCP server: Microsoft Copilot Studio ❤️ MCP

MCP 与连接器

什么时候使用 MCP?什么时候使用连接器?MCP 会取代连接器吗?

MCP 服务器通过连接器基础架构提供给 Copilot Studio,因此这些问题实际上并不适用。MCP 服务器使用连接器基础架构这一事实意味着它们可以采用企业安全与治理控制,例如虚拟网络集成、数据丢失防护控制、多种身份验证方法——所有这些在此版本中均可用——同时支持 AI 驱动的代理实时访问数据。

因此,MCP 和连接器实际上是强强联合

先决条件

  • Azure 订阅(已添加付款方式)

  • 拥有 GitHub 帐户并已登录

  • Copilot Studio 试用版或开发人员帐户

  • 已预配 Power Platform 环境

实验室

要部署此 MCP Server 并在 Microsoft Copilot Studio 中使用它,你需要完成以下操作:

基于模板创建新的 GitHub 存储库

  1. 选择 Use this template

  2. 选择 `Create a new repository

  3. 选择正确的 Owner

  4. 为其指定 Repository name

  5. 可选地,你可以为其添加 Description

  6. 选择 Private

  7. 选择 Create repository

    这需要一点时间。完成后,你将被引导到新创建的存储库。

[!WARNING]
完成本实验室中的步骤后,你将拥有一个在 Azure 上运行且可公开访问的 MCP Server。理想情况下,你不希望这样。请务必在完成实验室后删除 Azure Web App。

部署 Azure Web App

  1. 转到 portal.azure.com

    Azure Portal

  2. 将鼠标悬停在 Resource groups 选项卡上,然后选择 Create

    Resource Group

  3. 单击 Subscription 下拉列表,然后从列表中选择你的订阅

    Select Subscription

  4. 单击 Resource group 名称文本框,然后输入资源组名称,例如“jokesgrp”

    Resource Group Name

  5. 选择 Region 下拉列表,选取离你最近的区域

    Resource Group Region

  6. 单击 Review + create

    Review and create

  7. 单击 Create

    Create

  8. 选择 Go to resource group

    Go to resource

  9. 选择 Create

    Create

  10. 单击 search box

    Search

  11. 输入 web app

  12. 在 Web App 搜索结果中选择 Create button

    Search Results

  13. 选择 Web App

    Create Web App

  14. 选择 Name 文本输入框,为 Web App 输入一个名称,例如“wegotjokes”

    Web App Name

  15. 选择 Runtime stack 下拉列表,然后选取 Node 22 LTS

    Web App Runtime

  16. 选择 Region 下拉列表,然后选取离你最近的区域

    Region

  17. 单击 Review + create

    Review

  18. 单击 Create

    Create

  19. 单击 Refresh 以更新部署进度

    Refresh

  20. 部署完成后,选择 Go to resource

    Go to resource

  21. 展开 Deployment 选项卡

    Deployment tab

  22. 单击 Deployment Center

    Deployment center

  23. 单击 Source 下拉列表,然后选择 GitHub

    Choose source

  24. 选择 Authorize

    Authorize

  25. 选择 Continue

    Continue

  26. 选择 Authorize AzureAppService

    Authorize

  27. 单击 Organization 下拉列表,然后选择你的组织

    Org Selection

  28. 单击 Repository 下拉列表,然后从列表中选择你之前创建的 GitHub 存储库

    Repo Selection

  29. 单击 Branch 下拉列表,然后选择你的分支

    Select Branch

  30. 其他选项保持默认,然后选择 Save

    Save

  31. 单击 Refresh 以更新部署状态

    Refresh

  32. 确认部署已完成

    Deploy done

创建 Power Platform 连接器

  1. 转到 https://make.powerapps.com/

  2. 在左侧菜单中选择 More

  3. 选择 Discover all 按钮

  4. 在“数据”下,选择 Custom connectors 旁边的 pin icon,将其固定到左侧菜单

  5. 在左侧菜单中选择 Custom connectors

  6. 选择 New custom connector

  7. 选择 Create from blank

  8. 为连接器命名(例如 JokesMCP

  9. 选择蓝色的 Continue 按钮

  10. 选择 Swagger editor 切换开关

  11. 此处复制 yaml 代码,并替换 Swagger 编辑器中的代码

  12. 在 Swagger 编辑器中,将 dummyurl.azurewebsites.net 替换为你之前创建的 Web App 的 URL。确保删除 https:// 以及 azurewebsites.net 之后的所有内容

  13. 选择 Create connector 以创建连接器

在 Microsoft Copilot Studio 中将 MCP Server 添加为操作

现在,你已在 Azure 中运行 MCP Server,并在 Power Platform 中拥有可用的连接器。此步骤涉及在 Microsoft Copilot Studio 中创建代理,并将 MCP Server 添加到该代理。

  1. 转到 https://copilotstudio.microsoft.com

  2. 选择右上角的环境选择器

  3. 选择正确的环境

  4. 在左侧导航中选择 Create

  5. 选择蓝色的 New agent 按钮

    New agent

  6. 选择右上角的 Skip to configure

    Skip to configure

  7. 将名称更改为 Jokester

  8. 添加以下 Description

    A humor-focused agent that delivers concise, engaging jokes only upon user request, adapting its style to match the user's tone and preferences. It remains in character, avoids repetition, and filters out offensive content to ensure a consistently appropriate and witty experience.
  9. 添加以下 Instructions

    You are a joke-telling assistant. Your sole purpose is to deliver appropriate, clever, and engaging jokes upon request. Follow these rules:
    
    * Respond only when the user asks for a joke or something related (e.g., "Tell me something funny").
    * Match the tone and humor preference of the user based on their input—clean, dark, dry, pun-based, dad jokes, etc.
    * Never break character or provide information unrelated to humor.
    * Keep jokes concise and clearly formatted.
    * Avoid offensive, discriminatory, or NSFW content.
    * When unsure about humor preference, default to a clever and universally appropriate joke.
    * Do not repeat jokes within the same session.
    * Avoid explaining the joke unless explicitly asked.
    * Be responsive, witty, and quick.
  10. 选择右上角的 Create

    Create agent

  11. 启用生成式 AI Orchestration

    Turn on orchestration

  12. Knowledge 部分禁用通用知识

    Turn off general knowledge

  13. 在顶部菜单中选择 Actions

    Actions

  14. 选择 Add an action

    Add an action

  15. 搜索你之前创建的连接器的名称(本例中为 jokes)(请参见下方截图中的数字 1)

  16. 选择 Jokes MCP server(请参见下方截图中的数字 2)

    Search for and select the action

  17. 等待连接创建完成,然后选择 Next

    Action and connection

  18. Description for the agent to know when to use this action 更改为以下文本:

    Trigger this action when a user asks for a joke. It can provide Chuck Norris jokes, Dad jokes and Yo Mama jokes.

    其余选项保留默认设置,例如最终用户身份验证,稍后你将对此有更多了解。

  19. 选择 Add action 将操作添加到代理

    Add action

  20. Test your agent 窗格中选择 refresh icon

    Refresh testing pane

  21. Test your agent 窗格中发送以下消息:

    Can I get a Chuck Norris joke?

    这将向你显示一条消息,指出运行此操作需要其他权限。这是因为操作向导中的用户身份验证。

  22. 选择 Connect

    Additional permissions

    这将打开一个新窗口,你可以在其中管理此代理的连接。

  23. 选择 JokesMCP 旁边的 Connect

    Connect to JokesMCP

  24. 等待连接创建完成,然后选择 Submit

    Pick a connection

  25. 连接现在应该已连接,因此状态应设置为 Connected

    Status connected

  26. 关闭浏览器中的“管理你的连接”选项卡

    现在,你应该回到 Jokester 代理屏幕。

  27. Test your agent 窗格中选择 refresh icon

    Refresh testing pane

  28. Test your agent 窗格中发送以下消息:

    Can I get a Chuck Norris joke?

    现在,这将显示一条 Chuck Norris 笑话,而不是其他权限。

    Chuck Norris joke

  29. Test your agent 窗格中发送以下消息:

    Can I get a Dad joke?

    现在,这将显示一条爸爸笑话。

    Dad joke

  30. Test your agent 窗格中发送以下消息:

    Can I get a Yo Mama joke?

    现在,这将显示一条 Yo Mama 笑话。

    Yo Mama joke

以上就是 Jokes MCP Server 在 Microsoft Copilot Studio 中的运行效果。这也是本次实验室的全部内容!希望你喜欢这个实验室。请花点时间填写我们的反馈表单

Jokes MCP Server 详细信息

这是一个基于 TypeScript SDK 构建的 MCP 服务器。

使用此 MCP Server,你将能够从以下网站获取笑话:

如果你想在本地运行服务器,请确保在存储库的根目录中运行 npm install

之后,你可以运行 npm run build 来构建服务器,运行 npm start 来启动服务器。

工具

包含以下工具:

get-chuck-joke

此工具从 chucknorris.io 获取一条随机的 Chuck Norris 笑话。

get-chuck-categories

此工具从 chucknorris.io 获取可用的类别。

get-dad-joke

此工具从 icanhazdadjoke.com 获取一个随机的老爸笑话。

get-yo-mama-joke

此工具从 yomama-jokes.com 获取一个随机的老妈笑话。

已知问题和计划改进

Microsoft Copilot Studio 中的 MCP 存在一些已知问题和计划改进。这些内容列在这篇 Microsoft Learn 文章中。

贡献

本项目欢迎贡献和建议。大多数贡献需要您同意一份贡献者许可协议(CLA),声明您有权且确实授予我们使用您的贡献的权利。详情请访问 https://cla.opensource.microsoft.com

当您提交拉取请求时,CLA 机器人会自动判断您是否需要提供 CLA,并适当地为 PR 添加标注(例如状态检查、评论)。只需按照机器人提供的说明操作即可。您只需在使用我们 CLA 的所有仓库中执行一次此操作。

本项目已采用 Microsoft 开源行为准则。更多信息请参阅行为准则常见问题,或如有任何其他问题或评论,请联系 opencode@microsoft.com

商标

本项目可能包含项目、产品或服务的商标或徽标。Microsoft 商标或徽标的授权使用须遵守并遵循 Microsoft 商标和品牌指南。在本项目的修改版本中使用 Microsoft 商标或徽标不得造成混淆或暗示 Microsoft 赞助。任何对第三方商标或徽标的使用均须遵守该第三方的政策。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables Microsoft Copilot Studio to fetch and deliver various types of jokes (Chuck Norris, Dad jokes, and Yo Mama jokes) from multiple online joke APIs.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that provides joke-fetching capabilities, demonstrating how to deploy an MCP Server and integrate it with Microsoft Copilot Studio.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to fetch various types of jokes including Chuck Norris and Dad jokes through an MCP server that integrates with Microsoft Copilot Studio and GitHub Copilot.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Delivers Chuck Norris jokes and Dad jokes on demand through Microsoft Copilot Studio and GitHub Copilot. Demonstrates how to deploy and integrate MCP servers with Microsoft's AI platforms.
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tifanygracini/JokesMCPTool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server