Set Up an MCP Server

Step-by-step guide to configuring an MCP server in VS Code for use with Copilot agents.

AuthorNeexoCore
Updated
mcpsetupbeginner

Overview

MCP (Model Context Protocol) servers give Copilot agents access to external tools and data sources. This recipe walks you through setting one up.

Steps

1. Choose an MCP server

Popular options:

  • @github/github-mcp-server — GitHub API access
  • @playwright/mcp — Browser automation
  • @anthropic/mcp-server-filesystem — Local file access

2. Add to VS Code settings

Open .vscode/mcp.json or your user settings:

{
  "mcp": {
    "servers": {
      "github": {
        "command": "npx",
        "args": ["-y", "@github/github-mcp-server"],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": ""
        }
      }
    }
  }
}

3. Verify the connection

  1. Open Copilot Chat
  2. Type @agent and check if the MCP tools are listed
  3. Try a command like "list my open PRs"

Tips

  • Use workspace-level .vscode/mcp.json for project-specific servers
  • Use user settings for servers you want everywhere
  • Never commit tokens — use environment variables

Raw content

Copy this into your project — e.g. .instructions.md, .agent.md, or SKILL.md

## Overview

MCP (Model Context Protocol) servers give Copilot agents access to external tools and data sources. This recipe walks you through setting one up.

## Steps

### 1. Choose an MCP server

Popular options:
- `@github/github-mcp-server` — GitHub API access
- `@playwright/mcp` — Browser automation
- `@anthropic/mcp-server-filesystem` — Local file access

### 2. Add to VS Code settings

Open `.vscode/mcp.json` or your user settings:

```json
{
  "mcp": {
    "servers": {
      "github": {
        "command": "npx",
        "args": ["-y", "@github/github-mcp-server"],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": ""
        }
      }
    }
  }
}
```

### 3. Verify the connection

1. Open Copilot Chat
2. Type `@agent` and check if the MCP tools are listed
3. Try a command like "list my open PRs"

## Tips

- Use workspace-level `.vscode/mcp.json` for project-specific servers
- Use user settings for servers you want everywhere
- Never commit tokens — use environment variables