๐ด Employee Vacations MCP Server Sample (Streamable HTTP version) - C# โ
Welcome to the **Employee Vacations MCP Server Sample (Streamable HTTP version)*. In this sample, you will learn how to deploy the MCP Server and then add it to Microsoft Copilot Studio. This sample simulates the scenario of using MCP to connect an internal LOB system to an agent created in Copilot Studio. In this case, the sample mimics an internal application to manage employee vacations.
This MCP Server has multiple tools available:
getAllEmployeesAsync| Get the list of all the available employees and their vacation daysgetVacationDaysLeftAsync| Get the number of vacation days left for as specific employeechargeVacationDaysAsync| Charge vacation days for a specific employee
This is the C# version. For the TypeScript version, please check the employeevacations-http-typescript folder.
โ๏ธ Prerequisites โ
- Visual Studio Code (link)
- The .NET SDK (link)
- The Azurite extension for Visual Studio Code (link)
- GitHub account
๐ Minimal path to awesome โ
Clone this repository by running
git clone https://github.com/microsoft/copilot-studio-mcp/in your terminalOpen Visual Studio Code on the subfolder
samples/employeevacations-http-csharpLaunch the Azurite emulator for the Table service by running the command
Azurite: Start Table Servicein the command palette (pressctrl+shift+Porcmd+shift+Pon Mac)Open the terminal and navigate to the same folder
Run
dotnet run buildto start the serverSelect
PORTSat the top of the Visual Studio Code Terminal
Select the green
Forward a Portbutton
Enter
5248as 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 and hit enter
If all went well, you will see the following error message:
{"error":{"code":-32000,"message":"Not Acceptable: Client must accept text/event-stream"},"id":"","jsonrpc":"2.0"}Don't worry - this error message is nothing to be worried about!
๐จโ๐ป Use the Employee Vacations MCP Server in Visual Studio Code / GitHub Copilot โ
To use the Employee Vacations MCP Server, you need to use the URL of your server (can be either your devtunnel URL or your deployed Azure Container App) with the /mcp part at the end and add it as an MCP Server in Visual Studio Code.
Press either
ctrl+shift+P(Windows/Linux) orcmd+shift+P(Mac) and typeMCPSelect
MCP: Add Server...Select
HTTP (HTTP or Server-Sent Events)Paste the URL of your server in the input box
Press
EnterEnter a name for the server, for instance
JokesMCPSelect
User Settingsto save the MCP Server settings in your user settingsOpen
GitHub CopilotSwitch from
AsktoAgentMake sure the
EmployeeVacationMCPserver actions are enabledAsk the following question:
textGive me the list of employees and their vacation days
This should give you a response like this:

Now you have added the EmployeesVacationMCP server to Visual Studio Code!
