MSBA-370 · Lesson 5 of 12 · 18 min

Model Context Protocol

▶ Video coming soon A video version of this lesson is on the way.

Malik's small server with the list_stale_trails tool had been a quick experiment, and it raised a question he could not answer: how did agent mode in his editor, Copilot CLI in his terminal and the cloud agent on GitHub.com all know how to talk to it? The answer is the Model Context Protocol, and the GH-600 outline gives it its own skill: adding an MCP server as a tool to an agent, configuring the GitHub remote MCP server, configuring MCP registries and configuring MCP allow lists.

What MCP is

The Model Context Protocol (MCP) is an open standard that lets AI applications connect to tools and data in a uniform way. Anthropic published it in November 2024, and it was quickly adopted across the industry, including by GitHub, Microsoft and OpenAI; in late 2025 its stewardship moved to a foundation hosted by the Linux Foundation. Before MCP, every AI product needed its own plug-in format, so a tool written for one assistant could not be used by another. With MCP, a team writes a server once and any compatible client can use it.

MCP has three roles. The host is the AI application the user works in, such as Visual Studio Code, Copilot CLI or the cloud agent. The host runs one client for each server it connects to. An MCP server is a program that offers capabilities through the protocol. Servers can offer three kinds of capabilities: tools, which the model can call; resources, which are data the application can read into context; and prompts, which are reusable templates a user can choose. Coding agents rely mostly on tools, and some hosts support only tools.

A host box labelled Visual Studio Code, Copilot CLI or the cloud agent contains three client boxes. Each client connects by a line to a server: a local server over standard input and output, the GitHub remote MCP server over HTTP, and a company server over HTTP. Each server lists tools, resources and prompts.
MCP hosts, clients and servers. One host can connect to many servers.

Local and remote servers

MCP defines how messages travel between client and server. A local server runs as a process on the same machine and communicates through standard input and output; the host starts it with a command. A remote server runs somewhere else and is reached over HTTP using the protocol's streamable HTTP transport, often with OAuth sign-in or a token. Local servers are easy to write and can reach local files, but run with the user's permissions. Remote servers can be shared by a whole team and managed centrally, but need authentication and a network path.

Local and remote MCP servers compared.
Local serverRemote server
RunsAs a process started by the hostAs a hosted service
TransportStandard input and outputStreamable HTTP
AuthenticationUsually none; runs as the userOAuth or a token
Good forLocal files, personal tools, experimentsShared services, central management
Main riskRuns with the user's full permissionsCredentials and data leave the machine

The GitHub MCP server

GitHub publishes the GitHub MCP server, which gives agents tools for repositories, issues, pull requests, Actions, code security alerts and more. It can be used as a remote server hosted by GitHub, which needs no installation and signs in with the user's GitHub account, or run locally from GitHub's open source release with a personal access token. Its tools are grouped into toolsets, and GitHub recommends enabling only the toolsets a task needs. It also offers a read-only mode that turns off every tool that changes anything.

Configuring the remote GitHub MCP server in Visual Studio Code's .vscode/mcp.json with three toolsets in read-only mode. Header names follow the GitHub MCP server documentation at the time of writing; check it for your version.
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "X-MCP-Toolsets": "repos,issues,pull_requests",
        "X-MCP-Readonly": "true"
      }
    }
  }
}

Copilot CLI includes the GitHub MCP server by default, and the cloud agent has the GitHub MCP server and a browser automation server configured by default, scoped to the repository it is working in. Tidewater used the remote server in editors, because nobody had to install anything and sign-in followed each person's own GitHub permissions.

Adding a server to an agent

Each host has its own place to configure servers, but the content is similar: a name, how to start or reach the server, and any credentials or settings. In Visual Studio Code a workspace file, .vscode/mcp.json, can be committed so that everyone on the team gets the same servers. Copilot CLI keeps its own MCP configuration and offers a command to add servers. For the cloud agent, repository administrators add servers as JSON in the repository's Copilot settings on GitHub.com, and any secrets the servers need are stored in the repository's Copilot environment, where GitHub's documentation requires names that begin with COPILOT_MCP_.

An illustrative MCP configuration for the cloud agent in a repository's Copilot settings, allowing only two tools from Tidewater's trail data server. Field names follow GitHub's documentation pattern; check the current reference before copying.
{
  "mcpServers": {
    "trail-data": {
      "type": "local",
      "command": "npx",
      "args": ["-y", "@tidewater/trail-data-mcp@1.2.0"],
      "env": { "TRAIL_DATA_TOKEN": "COPILOT_MCP_TRAIL_DATA_TOKEN" },
      "tools": ["list_stale_trails", "get_trail"]
    }
  }
}

Two details in that configuration are deliberate. The package version is pinned, so a new release of the server cannot change the agent's tools without a review. And the tools list names exactly the two tools the agent may use, even though the server offers more. GitHub's cloud agent configuration lets administrators list allowed tools for each server for this reason.

Registries and allow lists

As MCP spread, public registries appeared: catalogues of servers with names, descriptions and installation details. GitHub runs the GitHub MCP Registry, which lists servers from GitHub's partners and the community and lets users install them into Visual Studio Code with a click. A registry makes servers easy to find; it does not make them safe. Anyone choosing a server still has to ask who publishes it, what it can reach, what credentials it needs and whether its tools can change anything.

For organizations, two controls matter. First, the MCP servers in Copilot policy decides whether members with Copilot Business or Enterprise seats can use MCP servers at all; GitHub documents it as disabled by default. Second, an enterprise or organization can point Copilot at its own MCP registry URL and restrict members to servers listed there, which acts as an allow list. GitHub made its enterprise AI controls generally available in February 2026; the MCP allow list capability within them was still described as public preview at that point.

A flow from a developer choosing an MCP server. First check: is the MCP policy enabled for the organization? If no, the server cannot be used. If yes, second check: is the server in the organization's registry allow list? If no, it is blocked. If yes, it can be added, and the agent can use only the tools allowed for it.
How Skerry controlled MCP servers: policy first, then a registry allow list, then per-tool limits.

Worked problem

Skerry's MCP allow list

Seraphine described Skerry's approach. Developers wanted about thirty different MCP servers in the first month. How did Skerry decide what to allow, and how did it enforce the decision?

Show solution
  1. Skerry enabled the MCP policy only after publishing its own internal registry.
  2. Each requested server went through a short review: publisher, data reached, credentials, write tools and how it is updated.
  3. Approved servers, eleven in the first month, were added to the internal registry with pinned versions.
  4. The enterprise registry URL setting pointed Copilot at that registry and restricted members to it, so unreviewed servers could not be added in editors.
  5. The cloud agent configurations in each repository listed only the tools each team needed.

Trusting a server

An MCP server is code, and its tools run with whatever access it has. A local server runs with the developer's permissions; a remote server sees whatever data is sent to it. Tool descriptions and tool results also flow into the model's prompt, so a malicious or compromised server can try to steer the agent by putting instructions in them, a form of prompt injection that MSBA-371 covers in detail. The defences are the ones in this lesson: use few, reviewed, pinned servers; prefer read-only tools; restrict tools per agent; and keep credentials scoped to what each server needs.

Tools, resources and prompts

An MCP server can offer three kinds of thing. Tools are actions the model can request, such as listing issues or querying a database. Resources are pieces of content the host can read and add to context, such as a file, a schema or a document. Prompts are reusable prompt templates the server offers to users. Most of what coding agents use today is tools, and the GitHub MCP server is almost entirely tools. Resources and prompts matter more in hosts where a person chooses what to bring into a conversation.

How a host talks to a server

MCP defines the messages that pass between client and server and two common ways to carry them. A local server runs as a process on the same machine, started by the host, and exchanges messages over standard input and output. A remote server runs somewhere else and is reached over HTTP. The difference matters for security as much as for convenience. A local server runs with the permissions of the person who started it, can read their files and may need credentials stored on their machine. A remote server runs under its operator's control and usually authenticates each user, often with OAuth, so that it acts with that user's permissions.

Local and remote MCP servers compared.
QuestionLocal serverRemote server
Where does it run?On the developer's machine or in the agent's environmentOn the operator's infrastructure
How is it started?By the host, as a processIt is already running; the host connects
Whose permissions?The local account's, plus any keys it is givenUsually the signed-in user's
UpdatesWhen the local package is updatedWhen the operator deploys

Toolsets and read-only mode

The GitHub MCP server groups its tools into toolsets, such as repositories, issues, pull requests and Actions, and lets a host enable only the ones a task needs. It can also run in a read-only mode that exposes only tools that do not change anything. Both are least privilege in practice. An agent that triages issues does not need tools that merge pull requests, and an agent that answers questions about a codebase needs no write tools at all. Fewer tools also mean less text in every prompt and fewer wrong choices, the point lesson 4 made about tool count.

The cloud agent and MCP

For the cloud agent, MCP servers are configured in the repository's Copilot settings as JSON, and any secrets they need are stored in the Copilot environment with names that begin COPILOT_MCP_. The agent can use only the tools the configuration allows, and GitHub's documentation recommends listing specific tools rather than allowing all of them. Because the cloud agent acts without a person approving each tool call, an MCP tool that writes to an outside system is effectively an autonomous action. Tidewater configured no additional servers for its cloud agent; the built-in GitHub server and browser tools were enough for its tasks.

Evaluating a server before approval

Seraphine shared Skerry's review questions for a new MCP server. Who publishes it and how is it maintained? Is it local or remote, and what does it need access to? Which tools does it offer, and which of them write? What data could flow out through it? Can it be pinned to a version? And who inside Skerry owns the decision to keep it? Of the first eleven servers approved through Skerry's internal registry, three were approved in read-only form only, and two were approved for editors but not for the cloud agent, because their write tools reached systems outside GitHub.

MCP beyond GitHub

MCP is not a GitHub technology. It was introduced by Anthropic in November 2024 as an open protocol and moved to a foundation hosted by the Linux Foundation in late 2025, and many editors, agents and services support it. That is its main value: a team that writes one MCP server for an internal system can use it from Copilot, from other agent tools and from its own scripts. It is also the main risk, because servers from many sources are easy to add. The governance in this lesson, policies, registries, allow lists and reviews, exists because the protocol makes connecting so easy.

Common mistakes

  • MistakeTreating a public registry listing as a security review.

    InsteadA registry helps discovery; each server still needs a review of publisher, data, credentials and write tools.

  • MistakeInstalling the latest version of an MCP server automatically.

    InsteadPin versions so tool changes are reviewed.

  • MistakeEnabling every GitHub MCP server toolset.

    InsteadEnable only the toolsets needed, and use read-only mode where possible.

  • MistakeStoring MCP server secrets in a configuration file in the repository.

    InsteadStore them as Copilot environment secrets or in the client's secure settings.

Summary and key terms

  • MCP is an open standard connecting AI hosts to servers that offer tools, resources and prompts.
  • Local servers run as processes over standard input and output; remote servers use streamable HTTP with authentication.
  • The GitHub MCP server is available remotely or locally, groups tools into toolsets and supports read-only mode.
  • Servers are configured per host; for the cloud agent, in repository Copilot settings with COPILOT_MCP_ secrets.
  • The MCP policy and an enterprise or organization registry allow list control which servers can be used.
Model Context Protocol (MCP)
An open standard for connecting AI applications to tools and data.
MCP host
The AI application that connects to MCP servers through clients.
MCP server
A program that offers tools, resources or prompts through MCP.
GitHub MCP server
GitHub's MCP server offering tools for repositories, issues, pull requests and more.
MCP registry
A catalogue of MCP servers; an organization's own registry can act as an allow list.
Streamable HTTP
The MCP transport used by remote servers.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Name the three kinds of capability an MCP server can offer.

    Show answer

    Tools, resources and prompts.

  2. Which MCP servers does the cloud agent have configured by default?

    Show answer

    The GitHub MCP server and a browser automation server.

  3. What prefix must cloud agent MCP secret names use?

    Show answer

    COPILOT_MCP_.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz