DEV Community

Cover image for How I Connected GitHub Copilot in VS Code to GitHub Using MCP
nithish rodrigo
nithish rodrigo

Posted on

How I Connected GitHub Copilot in VS Code to GitHub Using MCP

Understanding MCP Through a Practical Example

Recently, I’ve been learning about Model Context Protocol (MCP) and wanted to understand it beyond the theory.

Instead of just reading about MCP, I decided to try a practical integration:

Connect GitHub Copilot in VS Code to GitHub using the GitHub MCP Server.

This helped me understand how AI agents can interact with external systems and why MCP is becoming an important part of the AI ecosystem.


What is MCP?

MCP (Model Context Protocol) is a standardized protocol that allows AI applications and agents to communicate with external tools, services, and data sources.

For example, an AI agent may need to interact with:

  • GitHub
  • Jira
  • AWS
  • Databases
  • Internal documentation
  • Monitoring systems
  • APIs

Without a standard integration mechanism, each AI application would potentially need its own custom integration for every service.

MCP provides a standardized approach.

A simplified architecture looks like this:

AI Application / Agent
(Claude, Copilot, ChatGPT)
          │
          │ MCP Protocol
          ▼
      MCP Server
          │
          │ API / SDK / Service Integration
          ▼
External System
(GitHub, AWS, Jira, Database)
Enter fullscreen mode Exit fullscreen mode

How is MCP Similar to REST APIs?

When I first tried to understand MCP, I compared it with a traditional REST API architecture.

Traditional API communication

Client
(Postman / Application)
        │
        │ HTTP
        ▼
API Server
        │
        ▼
Application / Service
Enter fullscreen mode Exit fullscreen mode

For example, when using the GitHub REST API, a developer might manually call an endpoint like:

GET /repos/{owner}/{repo}/issues
Enter fullscreen mode Exit fullscreen mode

The client needs to know:

  • Which API endpoint to call
  • Which HTTP method to use
  • Which parameters are required
  • How authentication works
  • How to process the response

With MCP, the interaction can be more agent-oriented.

AI Agent
   │
   │ MCP
   ▼
MCP Server
   │
   ▼
External Service
Enter fullscreen mode Exit fullscreen mode

Instead of manually calling an API endpoint, you can tell the AI:

"Show me all open issues in this repository."

The AI agent can then determine which available tool is appropriate and use it through the MCP server.


My Practical Example: GitHub Copilot + GitHub MCP Server

For this experiment, I used:

  • Visual Studio Code
  • GitHub Copilot
  • GitHub MCP Server
  • GitHub authentication

The architecture looks like this:

Developer
    │
    ▼
VS Code
    │
    ▼
GitHub Copilot
    │
    │ MCP
    ▼
GitHub MCP Server
    │
    │ GitHub APIs / Services
    ▼
GitHub
Enter fullscreen mode Exit fullscreen mode

GitHub Copilot acts as the AI-powered client that can use tools exposed through the MCP server.


Step 1: Configure the GitHub MCP Server

In VS Code, MCP servers can be configured using an mcp.json configuration.

For the remote GitHub MCP server, the configuration looks similar to:

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Once configured, VS Code can connect to the MCP server.
for more on configuration check here


Step 2: Authenticate with GitHub

Since the MCP server needs permission to access GitHub resources, an authentication flow is required.

The flow is approximately:

VS Code
   │
   ▼
GitHub Copilot
   │
   ▼
GitHub MCP Server
   │
   │ Authentication Required
   ▼
GitHub OAuth
   │
   ▼
User Approves Access
   │
   ▼
MCP Server Can Access Authorized Resources
Enter fullscreen mode Exit fullscreen mode

MCP defines how the AI application and MCP server communicate.

Authentication and authorization determine:

Who are you, and what are you allowed to access?


Step 3: Let Copilot Use GitHub as a Tool

After connecting the MCP server, I can ask GitHub Copilot questions such as:

"Show me my open GitHub issues."

Or:

"Get information about this repository and explain its architecture."

Or even:

"Create a GitHub issue titled 'Add Terraform deployment documentation'."

Behind the scenes, the interaction looks something like this:

1. User
      │
      │ "Show me open issues"
      ▼

2. GitHub Copilot / AI Agent
      │
      │ Determines GitHub data is required
      ▼

3. MCP Client
      │
      │ MCP Request
      ▼

4. GitHub MCP Server
      │
      │ Interacts with GitHub
      ▼

5. GitHub
      │
      │ Returns Data
      ▼

6. GitHub MCP Server
      │
      │ MCP Response
      ▼

7. Copilot
      │
      ▼

8. User receives the result
Enter fullscreen mode Exit fullscreen mode

Tools, Resources, and Context

One of the things that made MCP clearer for me was understanding that MCP servers can expose capabilities to AI agents.

For example, an MCP server may provide tools such as:

get_repository()
list_issues()
create_issue()
get_pull_request()
Enter fullscreen mode Exit fullscreen mode

It may also provide access to resources, such as:

  • Repository information
  • Source code
  • Documentation
  • Issues
  • Pull requests
  • Infrastructure information
  • Logs

The AI agent can discover the capabilities available from the MCP server and use the appropriate one based on the user's request.


Why I Think MCP is Interesting

As someone working in Cloud and TechOps, I find MCP particularly interesting because I can imagine many practical use cases.

For example:

GitHub Copilot / AI Agent
           │
           ├── GitHub MCP Server
           │
           ├── AWS MCP Server
           │
           ├── Jira MCP Server
           │
           ├── Monitoring MCP Server
           │
           └── Internal Documentation MCP Server
Enter fullscreen mode Exit fullscreen mode

Imagine asking an AI agent:

"A production deployment failed. Check the GitHub pull request, investigate the AWS environment, review the monitoring alerts, and create a Jira incident with your findings."

The AI agent could potentially interact with multiple systems through MCP servers.

Of course, proper authentication, authorization, approval mechanisms, and security controls would be essential, especially when the agent can perform actions in production environments.


My Biggest Takeaway

The easiest way I currently understand MCP is:

MCP is a standardized integration layer that allows AI agents to discover and interact with external tools and data sources.

A simplified comparison would be:

Traditional Development:

Developer
   │
   ▼
Application Code
   │
   ▼
REST API
   │
   ▼
External Service
Enter fullscreen mode Exit fullscreen mode

Whereas an MCP-enabled workflow can look like:

User
   │
   ▼
AI Agent
   │
   ▼
MCP Client
   │
   ▼
MCP Server
   │
   ▼
Tools / APIs / Data / External Services
Enter fullscreen mode Exit fullscreen mode

Instead of building a completely custom integration for every AI application and external service, MCP provides a common protocol for connecting them.

Top comments (0)