Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

title VS Code MCP Server Configuration
description Configuration guide for GitHub MCP server integration with VS Code Copilot
author Microsoft
ms.date 2026-07-08
ms.topic reference
keywords
mcp
github copilot
vscode
configuration
estimated_reading_time 3

Note: MCP servers are not enabled by default. The available server configurations are stored in mcp.json.sample. To enable them, either rename mcp.json.sample to mcp.json, or create a new mcp.json and copy across only the servers you need.

Overview

This workspace uses the GitHub MCP server for enhanced Copilot capabilities.

Configuration

The MCP server configuration is provided in .vscode/mcp.json.sample.

Note: If you want to use the recommended GitHub MCP server setup, run npx @modelcontextprotocol/server-github and update your .vscode/mcp.json accordingly. See the GitHub MCP Server Documentation for details.

Authentication

Option 1: OAuth (Recommended)

  • Uses VS Code's built-in GitHub authentication
  • No manual token management required
  • Managed via: VS Code → Accounts menu → Manage Trusted MCP Servers

Option 2: Personal Access Token

Enterprise Configuration

For GitHub Enterprise Server:

  1. Update .vscode/mcp.json with your enterprise URL:

    {
      "servers": {
        "github": {
          "url": "https://your-github-enterprise.com/mcp"
        }
      }
    }
  2. Set your PAT as an environment variable:

    # PowerShell
    $env:GITHUB_PERSONAL_ACCESS_TOKEN = "your_token_here"
    # Bash/Linux/macOS
    export GITHUB_PERSONAL_ACCESS_TOKEN="your_token_here"

Required Token Scopes

If using PAT authentication, your token needs:

  • repo - Full control of private repositories
  • read:org - Read org and team membership
  • user - Read user profile data

Usage

Once configured, the MCP server provides:

  • Repository operations (file management, search)
  • Branch management
  • Issue management
  • Pull request workflows
  • Code search capabilities

Security Notes

  • Never commit tokens to version control
  • Use OAuth when possible for automatic credential management
  • Rotate PATs regularly
  • Use fine-grained tokens with minimal required permissions

Troubleshooting

Server not connecting:

  • Check VS Code version (1.101+ recommended for OAuth)
  • Verify GitHub authentication via Accounts menu
  • For PAT: Verify GITHUB_PERSONAL_ACCESS_TOKEN is set

Permission errors:

  • Ensure token has required scopes
  • Check token hasn't expired
  • Verify repository access permissions

References


🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.