Create Tutorials/Github Copilot VSCode MCP authored by David Benjamin Goll's avatar David Benjamin Goll
# How to connect Github Copilot agent with MCP server in VSCode
This page is intended as a short Quickstart guide. For more detailed info, follow the docs of VS Code:
- [About agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode)
- [About MCP](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server)
## 0) Prerequisites
- VSCode
- Github Copilot enabled on your account. For info on how to set it up, click [here](https://code.visualstudio.com/docs/copilot/setup).
There is a free version and the Pro-version is also free for students, otherwise 10€/month). More info on individual plans [here](https://docs.github.com/en/copilot/concepts/billing/individual-plans).
## 1) Browse MCP server that you want to use
| | Link | |
| ------ | ------ | ------ |
| Curated official list by VSCode | https://code.visualstudio.com/mcp | recommended and trustworthy |
| MCP Marketplace | https://mcpmarket.com| list with categories |
| Modelcontextprotocol github page | https://github.com/modelcontextprotocol/servers | exhaustive list |
| List of MCP server | https://mcp.so | much less curated catalogue than mcp marketplace |
**IMPORTANT:**
- Always verify security / trustworthiness of any MCP server before connecting it to your AI setup, especially if it handles sensitive data.
- Check what permissions / scope the server requires. Sometimes a MCP server might have wide access, which could be risky.
- If using paid MCP servers, check licensing / cost!
For example, I chose these 4 server:
1. Arxiv: https://mcpmarket.com/server/arxiv-1
2. SequentialThinking: https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking
3. MarkItDown: https://github.com/microsoft/markitdown/tree/main/packages/markitdown-mcp
4. Context7: https://mcpmarket.com/server/context7-1
The MCP servers provide detailed information on how to install them in their respective README pages.
## 2) Add MCP server
**Easy way:** Install an MCP server from the [curated list of MCP servers](https://code.visualstudio.com/mcp) (only possible for a limited number of MCP server officially supported by VSCode).
**Manually:**
Follow the guide in the VSCode docs: https://code.visualstudio.com/docs/copilot/customization/mcp-servers
![image](uploads/a21b667f6abc3a95d028e297a102658f/image.png)
To recreate the setup I am using, follow these steps:
1. To configure an MCP server for a specific workspace, you can create a .vscode/mcp.json file in your workspace folder. To configure an MCP server for all your workspaces, you can add the server configuration to your user configuration. You can choose between the options using the command palette. Here I am using my user configuration:
![image](uploads/a0b7c7745cd2dbc62bec39a06281b8ce/image.png)
2. Copy-Paste this json (**and specify the path for the arxiv storage!**):
```json
{
"servers": {
"markitdown": {
"command": "uvx",
"args": [
"markitdown-mcp"
],
"type": "stdio"
},
"sequentialthinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
],
"type": "stdio"
},
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
},
"arxiv-mcp-server": {
"command": "uv",
"args": [
"tool",
"run",
"arxiv-mcp-server",
"--storage-path",
"/PATH-TO-YOUR-DIRECTORY/paper-storage"
]
}
},
"inputs": []
}
```
## 3) Test if the MCP server show up
You should see the MCP server listed in the extension view on the left in VSCode.
![image](uploads/8dfb53386a071c85d212f253b9f46a00/image.png)
When you click on the tool icon in the agent chat:
![image](uploads/3e81c2bf6f1c7184c840acbd61e1a16d/image.png)
you should see a list of the mcp server and their tools:
![image](uploads/35d5239617b77f4e3bfb6bf87b7fdd2e/image.png)
## 4) Play around with them
For example, I used MCP servers for literature research:
- **arxiv-mcp-server**
Provides access to arXiv papers by ID or query.
*Example:* I used it to make literature research and download papers automatically. E.g. "Download all papers of <Researcher-name> of the past X years".
- **markitdown**
Converts documents between formats (e.g., PDF → Markdown). Useful to give agents the capabilities to read documents (Reading PDFs often fails).
*Example:* Convert each downloaded Arxiv paper to markdown and write a one-page summary of the paper.
--> Follow-up instruction: Write a markdown in which you provide an overview how the research of <Researcher-name> evolved over the past X years.
- **sequentialthinking**
Helps structure reasoning or workflows step by step.
*Example:* Break down a coding task into ordered subtasks before implementation.
# Further thoughts about MCPs
### 5. Quick Comparison: Copilot vs. Gemini
- Speed: Copilot often snappier; Gemini better for long-form, big-context reasoning.
- Cost: Copilot 10€/month, Gemini free
- VSCode integration: GitHub Copilot + , Gemini -
Personal Preference: I prefer GitHub Copilot integrated in VSCode and using it for small incremental coding tasks instead of Gemini CLI or Claude Code CLI. Giving too much control to an agent still feels scary, especially with the errors I encountered with Gemini (Hallucinations!).
### 6. Core Workflows
- RAG: PDF → Markdown → select → summarize / code.
- Research: arXiv search → download → summarize → markdown.
- Refactor: fetch upgrade guide → plan (sequential tool) → apply edits.
### 7. Best Practices
- Restrict where writes can occur to prevent accidental damage.
- Keep the number of MCPs low! Only 4-5 MCPs per agent otherwise the agent gets overwhelmed and slows down.
- Start with one tool; Don’t wire up many MCP tools at once; pick the one that gives the biggest lift (e.g., PDF→Markdown).
- Either give small incremental prompts, or write a structured prompt doc (e.g. ask ChatGPT to optimise and structure your instructions for the agent) which you can save and modify.
- Provide outline/TOC tool before full content loads. Tell the agent to ask if it understood the instructions correctly and ask permission before each subtask.
- CHECK THE RESULTS IN DETAIL!
### 8. Common Pitfalls
- “God” tool doing everything (hard to evolve/control).
- Unbounded output → token exhaustion (Can be very expensive depending on the MCP server)!