Real-world MCPs in GitHub Copilot Agent Mode

Jon Peck, Microsoft14:27 · Jul 2025 · 5,133 views
Thumbnail for Real-world MCPs in GitHub Copilot Agent Mode Watch on YouTube
TL;DR
  1. 1

    GitHub Copilot Agent Mode can carry out complete development tasks, while asking for permission before using the terminal or external tools.

  2. 2

    MCP lets Copilot connect to services such as a local PostgreSQL database and use their data during an agent workflow.

  3. 3

    The GitHub MCP can create branches and pull requests, while repository instructions can require practices such as security checks and change logs.

Summary

Jon Peck explains how GitHub Copilot has moved from inline code completion and chat to Agent Mode, where it works through a complete task across a codebase. He demonstrates starting from a detailed README and having Copilot build a basic travel application. The agent asks permission before running terminal commands and responds to their output. Peck then adds Model Context Protocol servers. A PostgreSQL MCP lets Copilot read local database data and create mock JSON for tests. He prefers this server because it operates in read-only mode. He also shows the GitHub MCP, authenticated with a personal access token, which can create a branch, commit changes, and open a pull request. Peck recommends being explicit about which MCP to use, because Copilot does not always infer it. He also recommends README files, prompt files, and copilot-instructions.md for reusable standards and a change log.

Key ideas
00:39

Agent Mode works through complete development tasks

Peck contrasts Agent Mode with inline completion and chat. Instead of suggesting code at the moment it is typed or changing a few files from a single prompt, Agent Mode works through a complete task while the developer interacts with it. The developer can tell the agent what it may do at the command prompt and allow it to read responses. Peck says this can range from building a greenfield application to performing a deep refactor across a large codebase.

01:20

A detailed README gives the agent a workable project brief

Peck starts with a repository containing no code, only a detailed README. It describes the application, project structure, environment variables, database schema, API endpoints, and workflow graphs. Images can contain diagrams when the model has vision support; otherwise, Peck suggests Mermaid or another text-based diagram format. He switches Copilot to Agent Mode, chooses a model, and asks it to implement the README. The agent builds data models, an application, and a front end.

02:36

Agent Mode requires permission before terminal actions

When Copilot reaches a continue box, it wants to interact with the terminal. Peck must approve that action before the agent can continue. Copilot then reads the terminal response and can react if something goes wrong. In his demonstration, the process takes about eight minutes in real time and produces a basic working travel reservation application. The application is functional, although Peck says he would improve its styling in later iterations.

03:29

MCP connects Copilot to external data and services

Peck describes Model Context Protocol as an open protocol, similar to an API for AI. It lets language models communicate with external data sources and references. Those connections may provide general information, account-specific information when authentication is configured, or advice. In VS Code, the developer configures the MCP servers that Copilot may use. Copilot chooses a suitable server for a request, which might run locally, connect to a local database, call a web API, or run remotely in a protected environment.

05:20

A PostgreSQL MCP can provide test data without changing the database

For an application using PostgreSQL, Peck adds a PostgreSQL MCP from the Model Context Protocol server list. VS Code can install many servers with a one-click configuration, after which the developer fills in the connection details and starts the local server. He asks Copilot explicitly to use the PostgreSQL MCP, read the database, and create mock.json for testing. The server requests permission before connecting. Peck likes this particular MCP because it is read-only, so it can inspect data without mutating the database.

08:41

Copilot and an MCP exchange several tool calls during one task

Peck breaks down the database example as a sequence of handshakes. Copilot identifies that an MCP is needed, asks the developer for permission, and calls the MCP server. The server first obtains the database schema, then identifies and selects the relevant tables, and finally retrieves their data. Copilot parses each response, creates the requested files, and adds the results to its context for the rest of the workflow. Peck warns that the first prompt will not be right and recommends README files, Copilot instructions, and reusable prompt files.

09:55

The GitHub MCP can take completed work through a pull request

Peck demonstrates GitHub's MCP server for work that developers might otherwise do with Git commands, the GitHub CLI, VS Code controls, or the GitHub website. After adding the server to VS Code, he authenticates with a GitHub personal access token. He can then ask Copilot to commit the changes to a new branch and create a pull request. The agent asks permission, creates the branch, and opens the pull request through the MCP.

10:48

Repository instructions can require a change log

Peck recommends using the specially named .github/copilot-instructions.md file for standards that should be included in every prompt. Examples include following PEP 8 and running a security check on installed code. He also asks agents to maintain a change log of everything they do. Even when commits provide history, the explicit log gives him a direct record of each step in the agent's work.

13:13

GitHub's issue-assignment agent is aimed at longer-running work

In the question period, Peck describes the feature he informally calls 'assign issue to Copilot.' A developer creates an issue on GitHub, assigns it to Copilot, and lets the agent work in the background. GitHub provides a session that can be viewed on the site, and the agent works toward a pull request. Peck says MCP is available there too, with configuration in repository settings under the Copilot area. He describes this as more oriented toward enterprise use for now, while acknowledging that the product direction remains fluid.

"The reason I love this is because there's a lot of things that I don't necessarily want to do manually using, you know, GitHub command line or Git or even having to go out to the site and actually click buttons."09:55
Who should watch
  • You are using GitHub Copilot for existing applications and want it to work with databases, tests, or DevOps tasks.
  • Your team needs a practical way to give an agent controlled access to local or remote services.
  • You want repository instructions and pull-request automation without giving an agent unrestricted access to your systems.