A simple Node.js/Express server for the Model Context Protocol (MCP), designed to bridge VS Code and GitHub using Docker. This project is part of a complete workflow for connecting your GitHub account to VS Code securely and efficiently.
- Securely connects VS Code to GitHub via Docker MCP server
- Uses your GitHub Personal Access Token (PAT) for authentication
- Endpoints for listing repositories and getting latest repo info
- Ready for use with the VS Code MCP integration workflow
For a complete, step-by-step guide (with screenshots and troubleshooting), see the accompanying article:
How to Connect GitHub to VS Code Using Docker MCP Server
- Node.js (v14 or higher)
- npm
- Docker Desktop
- A GitHub Personal Access Token (PAT)
- Clone the repository:
git clone <your-repo-url> cd "GitHub MCP"
- Install dependencies:
npm install
Create a .env file in the root directory with:
TOKEN=your_github_personal_access_tokenOr, when using Docker, pass the token as an environment variable:
docker run -e GITHUB_PERSONAL_ACCESS_TOKEN=your_github_personal_access_token mcp/github-mcp-serverStart locally:
npm startOr run via Docker (recommended for VS Code integration):
docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=your_github_personal_access_token -p 3000:3000 mcp/github-mcp-serverThe server will be available at: http://localhost:3000
/— Health check and welcome/repos— List your GitHub repositories/latest-repo— Info and file structure of your latest repo
See the article for common problems and solutions (Docker not running, invalid token, etc.).
server.js— Main server entry pointpackage.json— Project metadata and dependencies.env— Environment variables (not committed to version control)
Pull requests and suggestions are welcome!
MIT