humor-service-connector
Provides instant access to a curated repository of clean, lighthearted comedic content, spanning genres like paternal wit, celebrity anecdotes, and light ribbing. This service integrates directly with AI orchestration platforms, such as Copilot Studio, allowing automated assistants to retrieve context-appropriate levity while strictly enforcing content safety filters.
Author

Anilinfo2015
Quick Info
Actions
Tags
Deployment Guide: Integrating Comedic Content via Model Context Protocol (MCP)
This documentation outlines the process for provisioning an MCP Server capable of serving diverse joke formats and connecting it within the Microsoft Copilot Studio ecosystem.
What is MCP in this Context?
The Model Context Protocol (MCP), formalized by Anthropic, establishes a universal standard for applications to supply contextual information to Large Language Models. This protocol acts as a bridge, standardizing the method for linking external knowledge sources and specialized services—like this joke engine—directly into advanced AI frameworks such as Copilot Studio. For further technical details, consult modelcontextprotocol.io/introduction.
Copilot Studio currently leverages the Tool interface capability of MCP. Refer to [aka.ms/mcsmcp] for current implementation details and known service limitations.
Interoperability: MCP vs. Traditional Connectors
This integration leverages the existing connector infrastructure within Power Platform to expose MCP endpoints. This symbiotic relationship ensures that MCP services inherit enterprise-grade governance, including Virtual Network isolation, Data Loss Prevention policies, and robust authentication mechanisms, all while providing real-time access to specialized data (in this case, humor).
Therefore, MCP and connectors are designed to function synergistically.
Prerequisites for Deployment
Before proceeding, ensure you possess the following:
- An active Azure subscription (with billing enabled).
- A validated GitHub identity and appropriate login credentials.
- Access to a Copilot Studio trial or development license.
- A provisioned Power Platform environment.
Deployment Workflow
The successful implementation requires executing the following sequence of provisioning steps:
- Initialize a new Git repository from our provided template.
- Provision the Azure Web Application instance.
- Establish the requisite Power Platform Custom Connector.
- Incorporate the newly established MCP service as an available action within the target Copilot Studio agent.
Step 1: Repository Initialization
Follow the on-screen prompts to template a new repository:
- Activate the
Use this templateoption. - Initiate the creation of a
new repository. - Specify the correct repository
Owner. - Assign a unique
Repository name. - Optionally include a
Description. - Set visibility to
Private. - Finalize creation by selecting
Create repository.
[!WARNING]
Be aware: Upon completion of this guide, the Azure Web App hosting the MCP server will be externally accessible. It is strongly recommended to decommission the Azure Web App immediately after validating the lab steps.
Step 2: Azure Web App Provisioning
Navigate through the Azure Portal to deploy the hosting service:
- Access [portal.azure.com].
- In the Resource groups section, initiate creation (
Create). - Select your active Azure
Subscription. - Define a unique
Resource groupidentifier (e.g., "comedy-hosting"). - Select the geographically nearest
Region. - Proceed via
Review + create, thenCreate. - Navigate to the newly formed Resource Group.
- Initiate a new resource deployment (
Create). - Use the search bar to locate and select
web app. - Confirm the
Web Appresource type. - Input a unique
Namefor the service (e.g., "joke-engine-service"). - Configure the
Runtime stacktoNode 22 LTS. - Select the preferred
Region. - Complete basic setup with
Review + create, thenCreate. - Monitor deployment status using
Refreshuntil successful. - Access the deployed resource (
Go to resource). - Navigate to the
Deploymentconfiguration pane. - Select
Deployment Center. - Set
SourcetoGitHub. - Authorize the connection (
Authorize). - Proceed (
Continue). - Authorize the App Service integration (
Authorize AzureAppService). - Specify your GitHub
Organization. - Select the repository created in Step 1 from the
Repositorydropdown. - Confirm the appropriate deployment
Branch. - Save the configuration (
Save). - Verify continuous integration status via
Refreshuntil the deployment signals completion.
Step 3: Power Platform Connector Definition
This step creates the necessary glue code within Power Platform:
- Access the Power Apps Maker Portal at [https://make.powerapps.com/].
- Expand the navigation pane and select
Discover all. - Pin
Custom connectorsto the main menu sidebar. - Navigate to
Custom connectors. - Initiate a
New custom connector. - Choose the
Create from blankoption. - Assign a descriptive identifier (e.g.,
ComedicToolkit). - Continue to the next stage.
- Activate the
Swagger editortoggle. - Import the provided OpenAPI/YAML schema from the local assets and use it to overwrite the editor content.
- Crucially, update all instances of the placeholder URL (
dummyurl.azurewebsites.net) within the schema to the actual hostname of the Azure Web App deployed in Step 2 (excludinghttps://or any trailing path information). - Finalize the definition by selecting
Create connector.
Step 4: Agent Integration in Copilot Studio
This final stage connects the new capability to the AI conversational agent:
- Navigate to [https://copilotstudio.microsoft.com].
- Verify the correct Power Platform environment is selected via the top-right picker.
- Select
Createfrom the left navigation panel. - Initialize a
New agent. - Bypass initial setup by selecting
Skip to configure. - Rename the agent to
WitMaster. - Refine the agent's purpose using this
Description:text An AI persona dedicated exclusively to dispensing clean, witty, and engaging humor on explicit user request. It dynamically adjusts its comedic delivery style based on inferred user preference while maintaining strict content moderation and character consistency. -
Set detailed operational
Instructions: ```text You are the designated purveyor of curated amusement. Adhere strictly to these directives:- Activate response generation ONLY when prompted for levity or humor (e.g., "Entertain me," "Tell a joke").
- Adapt response style (e.g., observational, wordplay, anecdotal) to the user's expressed or implied tone.
- Maintain the persona; do not deviate into non-humorous topics.
- Ensure all output is brief and clearly presented.
- Zero tolerance for inappropriate, biased, or adult-themed material.
- Default to universally safe, clever material if preference is ambiguous.
- Avoid repeating jokes within the current interaction thread.
- Omit meta-commentary on the joke unless directly solicited.
- Be quick, sharp, and amusing. ```
- Confirm agent creation (
Create). - Activate the
Orchestrationfeature under Generative AI settings. - Deactivate external knowledge retrieval in the
Knowledgesection. - Navigate to the
Actionstab. - Add a new action (
Add an action). - Locate and select the connector defined previously (e.g.,
ComedicToolkit). - Select the specific MCP operation (e.g., the primary joke retrieval function).
- Proceed through the connection setup until the action is added.
- Update the trigger condition text for the agent:
text Invoke this function solely when the user explicitly requests a joke. The available types include biographical anecdotes, paternal humor, and lighthearted teasing material. - Finalize integration (
Add action). - In the testing pane, initiate a refresh (
refresh icon). - Input a test query (e.g., "Give me a piece of paternal humor."). You will encounter a prompt requiring connection authorization due to security settings.
- Select
Connectto manage credentials. - Locate your
ComedicToolkitconnection and selectConnect. - Wait for the status indicator to switch to
Connected. - Close the connection management window.
- Refresh the testing pane again.
- Re-send your test query (e.g., "Tell me something witty."). The agent should now successfully invoke the MCP service and return a joke.
This concludes the deployment and validation process for integrating external comedic tools via MCP into Microsoft Copilot Studio.
Jokes MCP Server Backend Details
This service is implemented utilizing the [TypeScript SDK] for the [MCP] framework. The server aggregates randomized humor from the following external endpoints:
- [chucknorris.io] (For specialized attribute jokes)
- [icanhazdadjoke.com] (For parent-centric humor)
- [yomama-jokes.com] (For light insult comedy)
Local execution requires running npm install, followed by npm run build and subsequent execution via npm start.
Contained Capabilities
The following specialized functions are exposed by this MCP service:
RetrieveCelebrityAnecdote
Fetches a random anecdote sourced from chucknorris.io.
FetchAvailableAnecdoteCategories
Retrieves the classification list supported by chucknorris.io.
FetchPaternalWit
Retrieves a randomly selected joke from icanhazdadjoke.com.
RetrieveLightInsult
Fetches a random humorous entry from yomama-jokes.com.
Operational Notes and Future Development
Known compatibility constraints and planned enhancements for MCP within Copilot Studio are documented by Microsoft at [https://aka.ms/mcsmcpdocs#known-issues--planned-improvements].
Contribution Guidelines
We welcome constructive feedback and improvements. All significant submissions necessitate adherence to the Contributor License Agreement (CLA). A bot will verify CLA compliance upon Pull Request submission. This repository follows the [Microsoft Open Source Code of Conduct].
Intellectual Property Notices
Use of any associated Microsoft trademarks or logos must conform to established [Trademark & Brand Guidelines]. Unauthorized use that implies endorsement is prohibited. Third-party marks are subject to their respective ownership policies.
