Feedback

Chat Icon

Building with GitHub Copilot

From Autocomplete to Autonomous Agents

GitHub Copilot Agent Tools, Extensions, and MCPs
78%

Extending Copilot with the Model Context Protocol (MCP)

Copilot has adopted the MCP standard to allow developers to create custom tools and functions that can be used within your chat sessions. To better understand how this works, let's start with a very simple example. We will use the local "Time MCP Server" from the MCP Server repository.

"Time MCP Server" is a simple MCP server written in Python that provides time and timezone conversion capabilities. Since we are using Python, we have several options to run it. Here are three of them:

The first option:

Use uvx (or uv), an extremely fast Python package and project manager, written in Rust. A single tool can replace pip, pip-tools, pipx, poetry, pyenv, twine, virtualenv, and more. This is the recommended way.

Example:

uvx mcp-server-time

The second option:

Use pip and python -m - the traditional way of installing Python packages and running Python modules:

pip install mcp-server-time
python -m mcp_server_time

The third option:

Use docker - if you prefer to run the server in a container:

docker run -i --rm e LOCAL_TIMEZONE mcp/time

The first option is probably the easiest and fastest. In all cases, to add the MCP server to Copilot, you have two options:

  • Option 1: Add the MCP server to the .vscode/mcp.json file in your project. This is the recommended way if you want to use the MCP server in a specific project. You can add this to code versioning if needed.
  • Option 2: Add the MCP server to the global settings.json file in VS Code. This is useful if you want to use the MCP server in all your projects.

Both options require the same configuration. For example, we can start by creating a .vscode/mcp.json file in our project with the following content:

{
  // The servers section defines the MCP servers to be used
  "servers": {
    // Add the MCP server name
    "time": {
      // Define the command to start the MCP server
      "command": "uvx",
      // Define the arguments to pass to the command
      "args": ["mcp-server-time", "--local-timezone", "Europe/Paris"],
    }
  }
}

Start the MCP server by clicking on the "Start" button.

Start MCP server

Start MCP server

Switch to the Agent mode

Building with GitHub Copilot

From Autocomplete to Autonomous Agents

Enroll now to unlock all content and receive all future updates for free.