Access various categories of jokes via the Model Context Protocol.
Microsoft Copilot Studio ❤️ MCP
Welcome to the Microsoft Copilot Studio ❤️ MCP lab. In this lab, you will learn how to deploy an MCP Server, and how to add it to Microsoft Copilot Studio.
❓ What is MCP?
Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs, defined by Anthropic. MCP provides a standardized way to connect AI models to different data sources and tools. MCP allows makers to seamlessly integrate existing knowledge servers and APIs directly into Copilot Studio.
Currently, Copilot Studio only supports Tools. To learn more about current capabilities, see aka.ms/mcsmcp. There are some known issues & planned improvements. These are listed here.
🆚 MCP vs Connectors
When do you use MCP? And when do you use connectors? Will MCP replace connectors?
MCP servers are made available to Copilot Studio using connector infrastructure, so these questions are not really applicable. The fact that MCP servers use the connector infrastructure means they can employ enterprise security and governance controls such as Virtual Network integration, Data Loss Prevention controls, multiple authentication methods—all of which are available in this release—while supporting real-time data access for AI-powered agents.
So, MCP and connectors are really better together.
⚙️ Prerequisites
- Visual Studio Code installed (link)
- Node v22 (ideally installed via nvm for Windows or nvm)
- Git installed (link)
- Docker installed (link)
- Azure Developer CLI installed (link)
- Azure Subscription (with payment method added)
- GitHub account
- Copilot Studio trial or developer account
➕ Create a new GitHub repository based on the template
Select
Use this templateSelect
Create a new repository
Select the right
Owner(it might already be selected when you have only one owner to choose from)Give it a
Repository nameOptionally you can give it a
DescriptionSelect
PrivateSelect
Create repositoryThis will take a little while. After it's done, you will be directed to the newly created repository.
⚖️ Choice: Run the server locally or deploy to Azure
Now you have a choice! You either run the server locally - or you can deploy it to Azure.
There are a couple of steps that you need to do for both:
Clone this repository by running the following command (replace
{account}by your own GitHub account name):git clone https://github.com/{account}/mcsmcp.gitOpen Visual Studio Code and open the cloned folder
Open the terminal and navigate to the cloned folder
🏃♀️ Run the MCP Server Locally
Run
npm installRun
npm run build && npm run start
Select
PORTSat the top of the Visual Studio Code Terminal
Select the green
Forward a Portbutton
Enter
3000as the port number (this should be the same as the port number you see when you ran the command in step 5). You might be prompted to sign in to GitHub, if so please do this, since this is required to use the port forwarding feature.Right click on the row you just added and select
Port visibility>Publicto make the server publicly availableCtrl + click on the
Forwarded address, which should be something like:https://something-3000.something.devtunnels.msSelect
Copyon the following pop-up to copy the URL
Open to the browser of your choice and paste the URL in the address bar, type
/mcpbehind it and hit enter
If all went well, you will see the following error message:
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed."},"id":null}
Don't worry - this error message is nothing to be worried about!
🌎 Deploy to Azure
[!IMPORTANT] As listed in the [prerequisites](#️-prereq
Tools (1)
get_jokeRetrieves a joke from a specified category.Configuration
{"mcpServers":{"jokes":{"command":"node","args":["/path/to/jokes-server/index.js"]}}}