---
title: How to connect GitHub MCP to VS Code
description: Add https://api.githubcopilot.com/mcp/ as an HTTP server in VS Code’s Copilot chat and sign in with GitHub. How to go read-only, pick toolsets and share it.
canonical: https://mcp1.com/blog/github-mcp-vscode
last-updated: 2026-11-16
---

# How to connect GitHub MCP to VS Code

Add https://api.githubcopilot.com/mcp/ as an HTTP server in VS Code’s Copilot chat and sign in with GitHub. How to go read-only, pick toolsets and share it.

![](https://avatars.githubusercontent.com/u/1297371?s=96&v=4)Eldad FuxFounder and CEO, Appwrite

 \~/.copilot/mcp-config.json

"github": { "url": "https://api.githubcopilot.com/mcp/" }

githubConnected

 \~/.copilot/mcp-config.json

"github": { "url": "https://api.githubcopilot.com/mcp/" }

githubConnected

To connect GitHub to VS Code, add GitHub’s hosted MCP server, `https://api.githubcopilot.com/mcp/`, as an HTTP server in Copilot chat and sign in with GitHub when VS Code asks. There is nothing to install and no token to paste: the server uses OAuth, and Copilot can then read code, issues and pull requests as you.

## How do I add the GitHub MCP server to VS Code?

Use the guided flow in Copilot chat:

1. 1Run `Chat: Open Customizations` from the Command Palette and select MCP Servers.
2. 2Select Add Server (`+`) in the User group, choose HTTP, and enter `https://api.githubcopilot.com/mcp/`.
3. 3Name it `github`, then pick Global and Copilot Global so it works in every workspace.
4. 4Accept the server trust prompt, then sign in with GitHub when the authentication request appears.

Copilot Global writes to `~/.copilot/mcp-config.json`, which you can also edit by hand. This is the whole entry:

\~/.copilot/mcp-config.json

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "tools": ["*"]
    }
  }
}
```

Check it with a call that changes nothing: “Use the GitHub tools to list my open pull requests in this repository. Don’t change anything.” Expand the tool call in the chat and confirm it went to `github`. A plausible answer without a tool call doesn’t prove the connection.

Old guides use .vscode/mcp.json

Most setup guides, including the snippets in GitHub’s own README, show a `servers` object in `.vscode/mcp.json`. VS Code’s docs now call that format deprecated: Copilot now reads a top-level `mcpServers` object from `~/.copilot/mcp-config.json` or a `.mcp.json` at the workspace root. Existing `.vscode/mcp.json` entries can still be forwarded, but write new ones in the portable format.

## Which GitHub tools does Copilot get?

The base URL loads GitHub’s default toolsets: `context`, `repos`, `issues`, `pull_requests` and `users`. These are the tools you’ll see most, split by whether they change anything:

ToolWhat it does

`get_file_contents`

Reads a file or directory from any repository you can access. Read.

`search_code`

Searches code across GitHub with the usual qualifiers, like repo: and org:. Read.

`list_issues`

Lists and filters issues; issue\_read fetches one with its comments. Read.

`pull_request_read`

Fetches a pull request, its diff, files, reviews or checks. Read.

`issue_write`

Creates or updates an issue. Write.

`create_pull_request`

Opens a pull request from a branch. Write.

`push_files`

Commits files to a branch in one call. Write.

`merge_pull_request`

Merges a pull request. Write, and the one to keep an eye on.

Other toolsets, like `actions`, `code_security` and `dependabot`, are off until you ask for them. `https://api.githubcopilot.com/mcp/x/all` loads every toolset, at the cost of a much longer tool list in every request.

## How do I make GitHub MCP read-only in VS Code?

Add `/readonly` to the URL. The server then drops every write tool, so Copilot can search and summarize but has nothing to merge or push with:

\~/.copilot/mcp-config.json

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/readonly",
      "tools": ["*"]
    }
  }
}
```

To choose toolsets and read-only together, use headers instead. `X-MCP-Toolsets` takes a comma-separated list, and `X-MCP-Readonly` removes write tools even from toolsets that have them:

\~/.copilot/mcp-config.json

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "X-MCP-Toolsets": "repos,issues,pull_requests,actions",
        "X-MCP-Readonly": "true"
      },
      "tools": ["*"]
    }
  }
}
```

`X-MCP-Tools` narrows further, to single tools like `get_file_contents,pull_request_read`. GitHub ignores unknown toolset names, but a misspelled tool name in `X-MCP-Tools` stops the server from starting. The token still carries your full GitHub permissions, so for a hard boundary see [how to make an MCP server read-only](https://mcp1.com/blog/read-only-mcp-server).

## How do I share the GitHub server with my team?

Put the same entry in a `.mcp.json` at the repository root and commit it. It holds a URL and nothing secret, because each teammate signs in to GitHub with their own account, and their calls carry their own repository access. VS Code offers `.mcp.json` in the guided flow when the experimental `chat.mcp.workspaceRootConfig.enabled` setting is on, and reads an existing file either way.

In organizations on Copilot Business or Enterprise, an admin also has to allow it. The “MCP servers in Copilot” policy, under the organization’s or enterprise’s Copilot policies, blocks GitHub’s MCP server in VS Code entirely when it is off, whatever the config says.

## Can I use a personal access token instead of OAuth?

Yes. Send a fine-grained token as a bearer header, read from an environment variable so the file never holds it. Use the braced `${NAME}` form, which VS Code’s portable format expands in header values:

\~/.copilot/mcp-config.json

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_PAT}"
      },
      "tools": ["*"]
    }
  }
}
```

Set `GITHUB_PAT` in the environment VS Code starts from. GitHub’s README shows `${input:github_mcp_pat}` with an `inputs` prompt instead; that only works in the deprecated `.vscode/mcp.json` format, and VS Code won’t forward entries that use it to Copilot. Never commit a populated token, and for teams see [how to share an MCP server without sharing the API key](https://mcp1.com/blog/share-mcp-server-without-api-key).

## What if GitHub doesn’t connect?

- The server doesn’t start for anyone in your organization. The “MCP servers in Copilot” policy is off. Ask an organization owner to enable it.
- Tools return nothing for your company’s repositories. The organization enforces SAML SSO or restricts OAuth apps. Authorize the token or app for that organization in your GitHub settings.
- You’re on GitHub Enterprise Server. The hosted server only reaches github.com and GitHub Enterprise Cloud. Run the local `github-mcp-server` with a token instead.
- A tool you expect is missing. Its toolset isn’t loaded, or read-only mode removed it. Add the toolset to `X-MCP-Toolsets` or drop `/readonly`.
- The server runs but Copilot never calls it. Check the server’s output in MCP Servers, then name the server in the prompt to rule out tool selection.

## GitHub for the whole team, in every client

Everything above is per person and per client. Each teammate signs in again in Cursor, Claude Code and ChatGPT, read-only mode is a URL anyone can edit, and nobody can see what an agent merged except through GitHub’s own logs. MCP1 is a gateway that does it once. An admin installs [GitHub](https://mcp1.com/servers/github) in the workspace with a fine-grained token, and can add a second, read-only token that people on read-only access call with, so GitHub itself refuses their writes. Rules by name, like `github__merge_*`, hold risky tools to admins or ask before they run.

VS Code installs the gateway in one click from the Connect page in the MCP1 dashboard. GitHub’s tools then appear as `github__<tool>` next to Linear, Sentry and the rest, and every call is checked against the person’s groups and recorded in the audit log. The [docs](https://mcp1.com/docs) cover gateways and groups, and the Individual plan is free to [start with](https://mcp1.com/signup).

## Common questions

### Do I need a Copilot subscription to use GitHub MCP in VS Code?

You need Copilot chat in VS Code to call MCP tools. In organizations on Copilot Business or Enterprise, the MCP servers in Copilot policy must also be enabled.

### Does GitHub MCP work with GitHub Enterprise Server?

Not the hosted server, which reaches github.com and GitHub Enterprise Cloud only. Run the local github-mcp-server with a personal access token instead.

### Can I limit GitHub MCP to one toolset?

Yes. Use https://api.githubcopilot.com/mcp/x/<toolset>, like /x/issues, or list several in the X-MCP-Toolsets header. Add /readonly to drop write tools.

### Should I still use .vscode/mcp.json?

Not for new servers. VS Code’s docs mark that servers format as deprecated; use \~/.copilot/mcp-config.json or a workspace-root .mcp.json with an mcpServers object.

Give your team one URL

Create a workspace, install your servers and share a gateway with a group. Free for individuals.

[Start with MCP1](https://mcp1.com/signup)[Read the docs](https://mcp1.com/docs)

## More from the blog

[ Terminal$ claude mcp add --transport http github api.githubcopilot.com/mcp/githubConnectedHow to connect GitHub MCP to Claude CodeRun claude mcp add with https://api.githubcopilot.com/mcp/ and a fine-grained token. Read-only mode, toolsets, permission rules and team setup.![](https://avatars.githubusercontent.com/u/1297371?s=96&v=4)Eldad FuxFounder and CEO, Appwrite](https://mcp1.com/blog/github-mcp-claude-code)[ SupportIntercomRead-onlyLinearRead-onlyNotionRead-onlyStripeRead-onlyMCP servers for support teams: what to connect firstStart with your helpdesk, Linear, Notion and Stripe, read-only first. What they answer together, which writes to hold back and a shared setup.![](https://avatars.githubusercontent.com/u/1297371?s=96&v=4)Eldad FuxFounder and CEO, Appwrite](https://mcp1.com/blog/mcp-servers-for-support-teams)

---

This is the markdown copy of https://mcp1.com/blog/github-mcp-vscode. Site index for agents: https://mcp1.com/llms.txt
