MCPizy
BrowseGuidesDocsFor publishersSubmit
Back to Blog
Tutorial
7 min read
· By Hugo Berton, MCPizy

VSCode Copilot MCP Setup: First Tool Call

Set up vscode copilot mcp: add the GitHub server, give it a scoped token, run your first tool call, and fix a server that stays inactive.

mcpvs-codegithub-copilotgithubsetuptroubleshooting

Add one server, give it a token, then ask Copilot to call a tool. That is the whole loop. For vscode copilot mcp, start with GitHub's server because it needs one command and one scoped token. Once it works, every other server follows the same pattern. This guide covers the setup, a first read-only call, the limits you will hit, and the usual reasons a server never starts.

How do I set up vscode copilot mcp in three steps?

The setup has three moves. First, register a server in VS Code so Copilot can see it. Second, let the server start, which usually means supplying a credential. Third, ask Copilot something that can only be answered by calling one of the server's tools. If all three work for one server, you understand the mechanism and can repeat it for any other.

Pick a server whose first call is harmless. The official GitHub MCP server fits: it exposes nine tools, and several of them, such as get_repository, list_issues and list_pull_requests, only read data. You can see the full list on the GitHub server page.

The rest of this guide follows that order. If you only want the file format for the configuration, the article on the VS Code mcp.json schema goes deeper, and How to Add an MCP Server to VS Code covers the general flow.

What do I need before adding a server?

You need VS Code with GitHub Copilot signed in, plus whatever runtime the server uses. The GitHub server's published run command is npx -y @modelcontextprotocol/server-github, so Node.js with npx must be on your PATH. If you open VS Code from a launcher that does not inherit your shell environment, npx may not be found, which is a common cause of a silent failure later.

You also need a credential. The GitHub server authenticates with a personal access token. The server's listing recommends a fine-grained token with the smallest scope that works: read-only access to repositories and issues is enough for a first test. Upgrade to write access only when a human approves each action.

One detail trips people up. A fine-grained token set to all repositories does not automatically include private repositories. If a call such as list_pull_requests returns nothing for a private repo, regenerate the token with that repo explicitly selected.

How do I add my first server to VS Code?

There are two routes. The CLI route is shortest: run mcpizy install github, which the MCPizy installer documents as the recommended install path. The manual route is to add an entry to your VS Code MCP configuration that launches npx -y @modelcontextprotocol/server-github and passes your token as an environment variable. Keep the token in an input prompt or an environment variable rather than typing it into a file you commit.

After saving, VS Code should list the server and show whether it is running. Start it from that list if it is stopped. The first start downloads the package, so give it a moment before assuming it failed.

  1. Create a fine-grained token with read-only repository and issue access.
  2. Register the server using the installer command or a manual entry.
  3. Start the server and confirm VS Code shows it as running.

For a second opinion on which servers to add after this one, see Copilot MCPs: Servers to Add First.

How do I make the first tool call?

Open Copilot Chat in agent mode, where the model is allowed to use tools, and ask for something specific that needs live data. For example: list the open pull requests in a repository you own, and give the owner and repo name explicitly. The GitHub tools take owner and repo as required inputs, so naming them removes guesswork and keeps the call cheap.

Copilot should show that it intends to call a tool and usually asks you to confirm before it runs. Read that prompt. It tells you which tool and which arguments, and approving a read-only call like list_pull_requests is low risk. If the answer comes back with real pull request titles, your vscode copilot mcp setup works end to end.

Stay read-only at first. The same server can write files and open pull requests, and the listing warns that create_or_update_file commits through the API, so there is no GPG signing, no pre-commit hooks, and CI may not run. For anything beyond small docs fixes, ask for a branch and a pull request instead. The guide How to Use GitHub MCP with Claude Code shows more prompts that carry over.

What does Copilot MCP not do?

MCP gives Copilot tools; it does not make those tools smarter than the server behind them. The GitHub server's search_code relies on GitHub's code search index, which the listing describes as eventually consistent and lossy. Recently pushed code may not appear yet, and some file types, such as lock files and vendored dependencies, are not indexed. For a question like finding every caller of a function, a local clone and grep is more reliable when search returns only a few hits.

Token cost is another limit. Read tools for issues and pull requests return short results, but get_file_contents on a large file is heavier: the listing estimates one 1k-line file at about 4k tokens. Ask for specific paths instead of whole directories.

Permissions also stay your job. A server can only do what its token allows, so scope matters more than prompt wording. The article MCP Server Permissions and Scopes Explained covers how to think about that, and What Is Copilot MCP Support and What Changes? explains the client side.

Why does my server stay inactive?

Work from the cheapest check to the most expensive. Start with the server's output log in VS Code, because it usually names the failure: a missing command, a bad path, or an authentication error. Then confirm the command works in a plain terminal. If npx -y @modelcontextprotocol/server-github fails there, VS Code is not the problem.

  • Command not found: VS Code cannot see Node.js on its PATH; launch it from a shell where npx works.
  • Authentication error: the token is missing, expired, or lacks the repository you asked about.
  • Empty results: the token does not include that private repository.

If the log is clean but tools never appear, restart the server from the VS Code list and reopen the chat so it picks up the tool list again. The full walkthrough is in Debug an MCP Server in VSCode, and VS Code MCP Client Extension: Built-In vs Add-On helps if you wonder whether an extension is needed at all.

Which server should I browse next?

Once GitHub works, add servers that cover a different job. Context7 serves live documentation for libraries and frameworks, and the CheckMCP audit of upstash/context7 gives it 100/100 (grade A) with an MIT licence. It runs with npx -y @upstash/context7-mcp, so the setup is nearly identical to what you just did.

Playwright adds browser automation. The CheckMCP audit of microsoft/playwright-mcp scores it 100/100 (grade A) under the Apache-2.0 licence, and it starts with npx -y @playwright/mcp. It exposes tools such as browser_navigate and browser_snapshot, which let Copilot open a page and read its accessibility snapshot.

Add one at a time and make a first call after each, so a failure always points to the newest change. Before installing anything unfamiliar, read How to Audit an MCP Server Before Install. If you later want automation built on GitHub, the recipe Issue → Branch → PR Pipeline shows one worked pattern.

Found this useful? Share it.

MCP Servers Mentioned

Related Workflow Recipes