How to Set Up an MCP Server for GitHub Copilot in VS Code
What is MCP?
MCP stands for Model Context Protocol - a feature from GitHub Copilot that lets you extend Copilot’s capabilities by giving it access to tools like GitHub’s REST API. This enables Copilot to perform actions such as listing pull requests, merging PRs, or managing workflows, all through chat.
Basically, it gives Copilot more power by letting it connect to and interact with other tools that support MCP, like GitHub’s API. This allows Copilot to go beyond just suggesting code - it can take actions like managing pull requests, issues, and workflows directly from your editor.
Prerequisites
Before we begin, ensure you have the following set up:
- Create a Personal Access Token(PAT) via https://github.com/settings/personal-access-tokens
- Visual Studio Code installed
- An active GitHub Copilot for Business license (required for Agent Mode)
Step 1: Create the mcp.json File
Let's start by creating the mcp.json file in VS Code
mkdir -p .vscode && touch .vscode/mcp.json

Copy this exact config and paste it into mcp.json. This is copied from the official GitHub repo referenced below. Now there are several ways of authenticating and setting it up, but for this guide, I'll be using a PAT token, restricting which repos the MCP Server has access to
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${input:github_mcp_pat}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "github_mcp_pat",
"description": "GitHub Personal Access Token",
"password": true
}
]
}
Save the file
Step 2: Start the MCP Server
- Open the Command Palette (
F1orCtrl+Shift+P) - Search for “MCP: List Servers”
- Select your server, then choose “Start Server”

When prompted, enter your GitHub PAT. Once the server is running, you’ll see output logs confirming that Copilot has discovered your configured tools.

If not running, start it. It will show in the Output Panel if it has discovered the tools

To find out the tools it has access to, you can click on Configure Tools in the chat, then scroll through the tools from the dropdown


Step 3: Ask GitHub Copilot Questions
Now that your MCP server is active, open the Copilot Chat panel and try asking it something about your repository!
It should look similar to the below. Note (MCP Server)


Some generated prompts you can ask:
Prompts
- List all open, closed, or merged pull requests
- Get details, comments, or reviews for a specific pull request
- Merge, close, or update a pull request
- List, create, update, or close issues
- Get or add comments to issues or pull requests
- List branches, tags, or recent commits
- Get repository settings or collaborators
- List or re-run GitHub Actions workflows and jobs
- Download workflow logs or artifacts
- List Dependabot, code scanning, or secret scanning alerts
- Get your GitHub notifications or mark them as read
- Fork, star, or watch repositories
- Search for code, issues, or pull requests across GitHub
And that's it! You're ready to go. With your MCP server now set up, GitHub Copilot becomes far more than just a code completion tool - it’s now your powerful assistant for managing repos, issues, PRs, and CI/CD workflows.
Optional: Change Your PAT Token
If you want to change the password, you can do so easily by navigating to the mcp.json file and hovering over the Edit button

Reference:
Community-curated list of MCP Servers
If you want to explore more or connect with other MCP Servers, see the link below, which is a great place to start.
Found this article useful? Why not buy Phi a coffee to show your appreciation?