humor-provision-service
Provides curated, contextually-aware comedic content, prioritizing safety and user-defined taste profiles. Seamlessly interfaces with Microsoft Copilot Studio via the Model Context Protocol (MCP) infrastructure, enabling access to diverse joke categories such as observational humor, anecdotal setups, and lighthearted roasts.
Author

kusbr
Quick Info
Actions
Tags
Deploying the Humor Provision Service via Model Context Protocol (MCP) in Copilot Studio
This guide outlines the procedure for establishing an MCP endpoint—the humor-provision-service—and integrating it as an actionable tool within your Microsoft Copilot Studio agents.
Understanding the Model Context Protocol (MCP)
The Model Context Protocol (MCP), standardized by Anthropic, defines a common framework for applications to supply contextual data and capabilities to Large Language Models (LLMs). MCP standardizes the linkage between proprietary data repositories, external APIs, and platforms like Copilot Studio, facilitating immediate access to specialized functions.
Presently, Copilot Studio primarily supports integration through its 'Tools' mechanism. For details on current functionalities, consult aka.ms/mcsmcp. Known limitations and future enhancements are documented here.
MCP Versus Traditional Connectors
When should one opt for MCP integration over conventional connectors?
Since MCP service implementations leverage the existing connector framework for exposure within Copilot Studio, the distinction is synergistic rather than mutually exclusive. This architectural choice inherently grants MCP services access to robust enterprise security and compliance mechanisms, including Virtual Network integration, Data Loss Prevention policies, and diverse authentication methods. This robust foundation ensures real-time data accessibility for intelligent agents.
Consequently, MCP and connectors are designed to be mutually reinforcing assets.
Prerequisites for Deployment
To successfully complete this setup, you will require:
- An active Azure Subscription (with billing enabled)
- A GitHub account (logged in)
- Access to a Copilot Studio trial or developer license
- A provisioned Power Platform environment
Implementation Workflow
The process involves four main phases to operationalize the humor engine within Copilot Studio:
- Phase 1: Repository Initialization from Template
- Phase 2: Azure Web App Provisioning
- Phase 3: Custom Connector Definition
- Phase 4: Agent Action Integration in Copilot Studio
Phase 1: Repository Initialization from Template
- Invoke the
Use this templateoption. -
Initiate the creation of a
new repository. -
Designate the appropriate
Owner. - Assign a clear
Repository name. - Optionally furnish a
Description. - Set the visibility to
Private. - Finalize by selecting
Create repository.
This operation will take a brief period before redirecting you to your newly formed repository.
[!WARNING]
The configuration resulting from this laboratory exercise leaves the deployed Azure Web App publicly accessible. It is strongly recommended to de-provision (delete) this Azure Web App immediately upon concluding the exercise to mitigate unwarranted exposure.
Phase 2: Azure Web App Provisioning
-
Navigate to
portal.azure.com. -
Locate the
Resource groupssection and selectCreate. -
In the
Subscriptiondropdown, select your active subscription. -
Input a name for the resource group (e.g., "jokesgrp") in the designated text field.
-
Select the geographically closest
Region. -
Proceed by clicking
Review + create. -
Confirm deployment via
Create. -
Navigate to the newly established resource group via
Go to resource group. -
Initiate a new resource creation via
Create. -
Utilize the
search boxto locate the service. -
Enter
web appinto the search field. -
Select the
Create buttonassociated with the Web App service result. -
Choose the
Web Appresource type. -
Define the Web App's unique
Name(e.g., "wegotjokes"). -
In the
Runtime stackselector, chooseNode 22 LTS. -
Select the nearest operational
Region. -
Advance to
Review + create. -
Execute deployment with
Create. -
Use
Refreshto monitor deployment progression. -
Upon successful deployment, navigate to the resource via
Go to resource. -
Expand the
Deploymentconfiguration panel. -
Access the
Deployment Center. -
Set the
Sourcedropdown value toGitHub. -
Select
Authorizeto grant necessary permissions. -
Select
Continue. -
Authorize the deployment service via
Authorize AzureAppService. -
Select your organizational unit from the
Organizationdropdown. -
Choose the GitHub repository created in Phase 1 from the
Repositorylist. -
Specify the desired deployment
Branch. -
Retain all other settings as default and click
Save. -
Employ
Refreshto track the continuous integration/continuous deployment (CI/CD) status. -
Confirm deployment completion.
Phase 3: Custom Connector Definition
- Navigate to the Power Apps customization portal: https://make.powerapps.com/.
- Select the
Moreoption in the navigation sidebar. - Click the
Discover allbutton. - Locate
Custom connectorsunder the Data section and utilize thepin iconto dock it on the primary menu. - Select the newly pinned
Custom connectors. - Initiate the creation process by selecting
New custom connector. -
Choose the
Create from blankprovisioning method. -
Assign a meaningful identifier to the connector (e.g.,
JokesMCP). - Select the
Continueadvancement button. -
Activate the
Swagger editorinterface toggle. -
Substitute the default content in the Swagger editor with the contents of the YAML definition provided here.
- Critically, in the Swagger definition, replace the placeholder hostname
dummyurl.azurewebsites.netwith the actual URL of the Azure Web App deployed in Phase 2. Ensure the replacement excludes thehttps://prefix and any path segments following.azurewebsites.net. - Finalize the setup by clicking
Create connector.
Phase 4: Agent Action Integration in Copilot Studio
With the MCP backend service hosted in Azure and the communication bridge established via the Power Platform connector, the final step involves equipping a Copilot Studio agent with this capability.
- Access the Copilot Studio portal: https://copilotstudio.microsoft.com.
- Utilize the environment selector located at the top right to select the target environment.
- Navigate to
Createin the left navigation pane. -
Initiate a new agent by clicking the blue
New agentbutton. -
Bypass initial configuration by selecting
Skip to configureat the top. -
Rename the agent to
Jokester. -
Populate the agent
Descriptionwith the following directive:text 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.
-
Define the agent's operational
Instructionsas follows:text 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.
-
Finalize agent creation by clicking
Create. -
Activate the Generative AI
Orchestrationfeature. -
In the
Knowledgeconfiguration area, deactivate general knowledge retrieval. -
Navigate to the
Actionssection in the primary toolbar. -
Select
Add an action. -
Search for the connector identifier (e.g.,
jokes) created in Phase 3. -
Select the corresponding action, referencing the
Jokes MCP server. -
Await the automatic connection establishment and then select
Next. -
Update the directive used by the agent to invoke this action:
text Trigger this action when a user asks for a joke. It can provide Chuck Norris jokes, Dad jokes and Yo Mama jokes.
Maintain default settings for auxiliary configurations, such as end-user authorization.
-
Add the configured tool to the agent by selecting
Add action. -
In the agent testing pane, click the
refresh icon. -
In the testing interface, input the query:
text Can I get a Chuck Norris joke?
This initial attempt will likely prompt a request for additional connection permissions due to initial authorization setup.
- Explicitly authorize the connection by selecting
Connect.
This action launches a separate window for managing service connections.
-
Select
Connectadjacent to theJokesMCPentry. -
Wait for the connection status to transition to established, then confirm by selecting
Submit. -
Verify the status indicator shows
Connected. -
Close the connection management tab.
-
Return to the Jokester agent configuration and refresh the testing pane icon.
-
In the test panel, submit the request again:
text Can I get a Chuck Norris joke?
The agent should now respond with a relevant Chuck Norris joke, bypassing the permission prompt.
-
Test a different capability by submitting:
text Can I get a Dad joke?
This should yield a Dad joke.
-
Test the final category:
text Can I get a Yo Mama joke?
This will retrieve a Yo Mama joke.
Congratulations! The Jokes MCP Server is now fully operational within Microsoft Copilot Studio. This concludes the instructional guide. We value your participation; kindly consider providing feedback via https://aka.ms/mcsmcp/lab/feedback.
Jokes MCP Server Technical Specifications
This MCP implementation is constructed utilizing the TypeScript SDK for the Model Context Protocol.
This server instance facilitates the retrieval of humorous content sourced from: - chucknorris.io - icanhazdadjoke.com - yomama-jokes.com
For local execution, ensure you execute npm install within the repository's root directory, followed by npm run build to compile, and npm start to initiate the service.
Included Utility Functions (Tools)
get-chuck-joke
Fetches an arbitrary Chuck Norris anecdote sourced from chucknorris.io.
get-chuck-categories
Retrieves the complete enumeration of available joke categories from chucknorris.io.
get-dad-joke
Retrieves a random instance of parental wordplay from icanhazdadjoke.com.
get-yo-mama-joke
Fetches a randomized comedic statement targeting maternal figures from yomama-jokes.com.
Operational Caveats and Future Enhancements
Details concerning known limitations and planned upgrades for MCP integration within Microsoft Copilot Studio are cataloged in the official documentation found at https://aka.ms/mcsmcpdocs#known-issues--planned-improvements.
Collaboration Guidelines
We actively encourage community contributions and suggestions. Most submissions necessitate agreement with a Contributor License Agreement (CLA) affirming your right to grant usage rights to your input. Specifics are available at https://cla.opensource.microsoft.com.
A CLA bot will automatically assess PRs to determine if a CLA signature is required and apply necessary status indicators or comments. This signing requirement is typically a one-time action across all repositories using this CLA framework.
This repository adheres to the Microsoft Open Source Code of Conduct. Further inquiries or commentary should be directed to opencode@microsoft.com, or consult the Code of Conduct FAQ.
Intellectual Property Notices
This software project may incorporate trademarks or branding assets belonging to various entities. Authorized utilization of Microsoft's proprietary marks must strictly comply with Microsoft's Trademark & Brand Guidelines. Any incorporation of Microsoft assets into derived versions must avoid creating user confusion or implying Microsoft endorsement. Any use of non-Microsoft third-party intellectual property is governed by those respective third parties' policies.
WIKIPEDIA CONTEXT INSERT: Management systems encompass the comprehensive array of applications, protocols, computational frameworks, and operational philosophies utilized by enterprises to navigate dynamic market conditions, secure advantageous positioning, and elevate overall organizational efficacy.
== Comprehensive View == Management functionalities can be segmented across departmental lines and operational aspects, such as forecasting, procedural control, archival management, human capital oversight, decision support, and performance monitoring. A functional breakdown typically includes:
- Interfaces for data ingestion and integrity verification across all operational units.
- Mechanisms for auditing and optimizing organizational workflows.
- Systems for data aggregation and strategic judgment formulation.
The evolution of management technology over the past decade has been profoundly influenced by rapid technological shifts, often making the selection of optimal business tooling a complex undertaking. This complexity is driven by persistent pressures to minimize expenditure, maximize revenue generation, accurately interpret client necessities, and deliver products tailored precisely to those demands.
In this competitive landscape, managerial focus must shift towards a strategic framework for tooling adoption, rather than merely chasing the newest software release. Over-reliance on unadapted tools frequently results in systemic instability. Business management solutions demand careful vetting followed by meticulous customization to align with specific organizational mandates, reversing the common practice of forcing organizational structure around generic software features.
== Prevalent Methodologies == Data published by Bain & Company in 2013 highlighted global usage patterns for business tools, reflecting how their output addresses regional requirements amid varying economic climates. The leading ten instruments identified were:
Strategic forecasting Client Relationship Management (CRM) Employee sentiment analysis Comparative performance analysis (Benchmarking) Balanced organizational assessment (BSC) Identification of core competencies Utilization of external sourcing (Outsourcing) Organizational transformation programs Logistics and inventory network orchestration (SCM) Articulation of foundational purpose (Mission/Vision) Customer base segmentation Comprehensive quality assurance (TQM)
== Enterprise Software Applications == Software solutions, defined as integrated sets of programs servicing business users, are termed business software or business applications. These tools are designed to augment productivity, quantify results, and execute diverse corporate functions with precision. The progression began with rudimentary Management Information Systems (MIS), expanded into Enterprise Resource Planning (ERP), subsequently integrated CRM capabilities, and has culminated in the current cloud-centric suite of business management platforms.
While a demonstrable link exists between IT investment and corporate performance, value realization hinges on two critical factors: the proficiency of the deployment execution and the judicious selection and subsequent tailoring of the chosen tools.
== Tools Focused on Small and Medium Enterprises (SMEs) == Toolsets specifically engineered for SMEs are vital as they provide mechanisms to conserve resources...
