- Published on
- • 3 min read
How to use MCP Servers
- Authors
- Name
- Priyanshu Agrawal
- @priyanshu1312
In the previous post, we discussed what MCP (Model Context Protocol) is and how it enables Large Language Models (LLMs) to interact with external tools and data sources. In this post, we will explore how to use MCP servers to automate your workflows.
There are many MCP servers available which you can integrate with applications like VS Code, Claude Desktop etc. If you go to mcp.so1 or MCP Servers on GitHub2, you can search for the one that best fits your needs.
Before we integrate an MCP server, one thing to note is that while it's possible to have remote MCP servers, most of the tools available today run locally on your system with tools like npx, docker etc.
CAUTION
Be careful when running MCP servers locally. Only use official MCP servers from trusted sources. Running unverified servers can lead to security vulnerabilities.
Integrating GitHub MCP server in VS Code
GitHub MCP server3 runs on docker. To integrate it with VS Code, follow these steps:
Note: The steps might differ for other clients like Claude Desktop.
- Ensure docker is running on your system.
- Generate a Personal Access Token (PAT) from GitHub which will be used to communicate with GitHub on your behalf.
- Open VS Code and open settings JSON.
- Paste the following in
settings.json
:{ "mcp": { "inputs": [ { "type": "promptString", "id": "github_token", "description": "GitHub Personal Access Token", "password": true } ], "servers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}" } } } } }
- You will see a Start button above
github
in your config file. Click on it and VS Code will prompt you to enter your PAT. - Once added, you will see something like this in VS Code which indicates that the MCP server is up and running:
- You can also verify it in docker desktop:
- Now, open GitHub Copilot and ask something like "Show me the top 10 latest commits in
dotnet/aspire
repository." or "What are the open issues in this repository?". You will notice that it will use the GitHub MCP server to fetch the information. Below is the output at the time of writing this post:
Note: You will need to use Agent mode in GitHub Copilot to use the MCP server.
Couple of things to note in the above JSON:
- It is using an
input
to get person access token. This ensures that the PAT is interactively asked from user and stored securely. - The server name is
github
and it is running usingdocker
command.
Conclusion
In this post, we explored how to use MCP servers, specifically the GitHub MCP server, to enhance your development experience in VS Code. By integrating MCP servers, you can automate workflows and access external data sources seamlessly.
In future posts, I will explore how to integrate MCP in your AI applications using libraries like Semantic Kernel.
Previous post in the series: What is MCP?