Skip to content

๐ŸŒด Employee Vacations MCP Server Sample (Streamable HTTP version) โ€‹

Welcome to the Employee Vacations MCP Server Sample (Streamable HTTP version). In this sample, you will learn how to deploy the MCP Server to Azure or run it locally, 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 days
  • getVacationDaysLeftAsync | Get the number of vacation days left for a specific employee
  • chargeVacationDaysAsync | Charge vacation days for a specific employee

โš™๏ธ Prerequisites โ€‹

  • Visual Studio Code (link)
  • Node v22 (ideally installed via nvm for Windows)
  • The Azurite extension for Visual Studio Code (link)
  • GitHub account

๐Ÿš€ Minimal path to awesome โ€‹

  1. Clone this repository by running git clone https://github.com/microsoft/copilot-studio-mcp/ in your terminal

  2. Open Visual Studio Code on the subfolder samples/employeevacations-http-typescript

  3. Launch the Azurite emulator for the Table service by running the command Azurite: Start Table Service in the command palette (press ctrl + shift + P or cmd + shift + P on Mac)

  4. Open the terminal and navigate to the same folder

  5. Run npm install

  6. Run npm run build && npm run start

    Terminal view after building and starting the server

  7. Select PORTS at the top of the Visual Studio Code Terminal

    Image of VS Code where the terminal is open and the PORTS tab is highlighted

  8. Select the green Forward a Port button

    Image of VS Code where the PORTS tab is open and the green  button is highlighted

  9. Enter 3000 as 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.

  10. Right click on the row you just added and select Port visibility > Public to make the server publicly available

  11. Ctrl + click on the Forwarded address, which should be something like: https://something-3000.something.devtunnels.ms

  12. Select Copy on the following pop-up to copy the URL

    View of the PORTS setup with highlighted the port, the forwarded address and the visibility

  13. Open to the browser of your choice and paste the URL in the address bar, type /mcp behind it and hit enter

If all went well, you will see the following error message:

json
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed."},"id":null}

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.

  1. Press either ctrl + shift + P (Windows/Linux) or cmd + shift + P (Mac) and type MCP

  2. Select MCP: Add Server...

  3. Select HTTP (HTTP or Server-Sent Events)

  4. Paste the URL of your server in the input box (make sure /mcp in the end is included)

  5. Press Enter

  6. Enter a name for the server, for instance EmployeesVacationMCP

  7. Select User Settings to save the MCP Server settings in your user settings

  8. Open GitHub Copilot

  9. Switch from Ask to Agent

  10. Make sure the EmployeesVacationMCP server actions are enabled

  11. Ask the following question:

    text
    Give me the list of employees and their vacation days

This should give you a response like this:

Screenshot of question to provide the list from employees and the answer from GitHub Copilot

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

๐ŸŒด Employee Vacations MCP Server Sample (Streamable HTTP version)