From 740ed9f5f60ef9da90802ba5801f0f94ae5d4114 Mon Sep 17 00:00:00 2001 From: DeanLuus1994 Date: Sun, 13 Apr 2025 21:27:01 +0200 Subject: [PATCH 1/3] feat: add GitHub MCP Server usage and resource configuration documentation --- MCP-USAGE.md | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++ RESOURCES.md | 58 ++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 MCP-USAGE.md create mode 100644 RESOURCES.md diff --git a/MCP-USAGE.md b/MCP-USAGE.md new file mode 100644 index 000000000..85c25b358 --- /dev/null +++ b/MCP-USAGE.md @@ -0,0 +1,212 @@ +# GitHub MCP Server Usage Guide + +This document provides instructions for using the GitHub MCP Server in the VS Code Docs devcontainer environment. + +## Environment Specifications + +This development environment is optimized for maximum performance with: +- **10 physical cores / 16 threads** (i7-13620H) - fully utilized +- **NVIDIA RTX 3050 6GB GPU** - maximum utilization enabled +- **14GB RAM** limit (preserving system stability) +- **250GB SSD** storage available for development +- Repository: `git@github.com:DeanLuus22021994/vscode-docs.git` (Fork: DeanDev) + +## Overview + +The GitHub MCP (Model Context Protocol) Server provides tools to interact with GitHub from within VS Code and AI integrations like GitHub Copilot. These tools allow for: + +- Repository management (create, fork, search) +- Pull request operations +- Issue management +- Code searches +- File operations +- And more + +## Setup Instructions + +The MCP server has been automatically configured in your devcontainer to utilize maximum system resources while staying within specified limits. It requires a GitHub Personal Access Token to operate. + +### Setting up your GitHub Token + +1. Create a Personal Access Token (PAT) on GitHub: + - Go to GitHub Settings > Developer settings > Personal access tokens + - Create a new token with the following permissions: + - `repo` (Full control of private repositories) + - `workflow` (Update GitHub Action workflows) + - `read:org` (Read organization membership) + +2. Set the token in your environment: + - Option 1: Add to your local environment before starting VS Code: + ```bash + export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here + ``` + - Option 2: Add to VS Code settings (settings.json): + ```json + { + "terminal.integrated.env.linux": { + "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here" + } + } + ``` + +## Performance Optimization + +To take advantage of the system's powerful hardware: + +### For CPU-intensive Tasks +```bash +# For Node.js +NODE_OPTIONS="--max-old-space-size=12288 --max-http-header-size=16384" npm run build + +# For multi-threaded builds +make -j16 build + +# For Go builds with max parallelism +GOMAXPROCS=16 go build ./... +``` + +### For GPU-accelerated Tasks +```bash +# Run GPU-accelerated tests +GPU_ENABLED=1 npm run test-gpu + +# Enable GPU for image processing +CUDA_VISIBLE_DEVICES=0 node scripts/process-images.js +``` + +### For Storage Optimization +```bash +# Use temporary storage for large operations +TMPDIR=/tmp node scripts/generate-docs.js + +# Utilize persistent cache for builds +npm run build -- --cache-dir=/home/vscode/.cache/build-cache +``` + +## Verifying the Server is Running + +The server should start automatically when your devcontainer launches. To verify: + +1. Open a terminal in VS Code and run: + ```bash + if [ -f "/tmp/mcp-server.pid" ] && ps -p "$(cat /tmp/mcp-server.pid)" > /dev/null; then + echo "MCP Server is running"; + else + echo "MCP Server is not running"; + fi + ``` + +2. Check the server logs: + ```bash + cat /tmp/mcp-server.log + ``` + +3. Verify GPU utilization: + ```bash + nvidia-smi + ``` + +## Manually Starting the Server + +If the server is not running, you can start it manually: + +```bash +/workspace/.github/start-mcp-server.sh +``` + +## Tools Available + +The GitHub MCP Server provides the following tools: + +### Repository Management +- Create repository +- Fork repository +- Search repositories +- Get file contents +- Push files + +### Issues +- Create issues +- Search issues +- List issues +- Update issues +- Add issue comments + +### Pull Requests +- Create pull requests +- Review pull requests +- Merge pull requests +- Update pull request branches + +### Search +- Search code +- Search users + +## Using with GitHub Copilot + +When using GitHub Copilot in VS Code, the MCP server is automatically detected, enabling Copilot to use GitHub operations directly. Examples: + +- "Create a pull request for the current branch" +- "Search for issues about CSS in this repository" +- "Create a fork of microsoft/vscode" +- "Update the documentation for the new API" + +### Hardware-accelerated Copilot + +This environment is configured to use hardware acceleration for GitHub Copilot, providing faster responses and more efficient processing. The GPU is utilized for local model inference when available. + +## Fork-specific Information + +This environment is configured for work on the DeanDev fork of the vscode-docs repository. All operations through the MCP server will use: + +- Repository: `git@github.com:DeanLuus22021994/vscode-docs.git` +- Owner: DeanLuus22021994 +- Fork: DeanDev + +## Troubleshooting + +### Server Won't Start + +1. Ensure your GitHub token is set: + ```bash + echo $GITHUB_PERSONAL_ACCESS_TOKEN | wc -c + ``` + (Should return a number greater than 1) + +2. Check for build errors: + ```bash + cd /workspace/.github/cmd/github-mcp-server + go build -v + ``` + +3. Check logs for errors: + ```bash + cat /tmp/mcp-server.log + ``` + +4. Verify GPU availability: + ```bash + nvidia-smi + ``` + +### Server Crashes or Returns Errors + +1. Restart the server: + ```bash + kill $(cat /tmp/mcp-server.pid) + /workspace/.github/start-mcp-server.sh + ``` + +2. Check if your token has the required permissions or has expired + +3. Check system resource usage: + ```bash + free -h # Check memory usage + htop # Check CPU usage + ``` + +## Additional Resources + +- [GitHub MCP Server Repository](https://github.com/github/github-mcp-server) +- [Model Context Protocol Documentation](https://containers.dev) +- [System Resource Details](./.github/RESOURCES.md) \ No newline at end of file diff --git a/RESOURCES.md b/RESOURCES.md new file mode 100644 index 000000000..4d5451d19 --- /dev/null +++ b/RESOURCES.md @@ -0,0 +1,58 @@ +# Hardware Resources & Repository Configuration + +## System Specifications +This development environment is configured to utilize: + +- **CPU**: Full access to 10 physical cores / 16 threads (i7-13620H) +- **GPU**: Maximum NVIDIA RTX 3050 6GB GPU utilization +- **Memory**: Limited to 14GB RAM maximum (to maintain system stability) +- **Storage**: 250GB SSD available for development +- **Current Date**: April 13, 2025 + +## Repository Configuration +- **Repository URL**: `git@github.com:DeanLuus22021994/vscode-docs.git` +- **Fork Name**: DeanDev +- **SSH Access**: Enabled and configured + +## MCP Server Configuration +The GitHub MCP (Model Context Protocol) Server is available locally through Docker with the following setup: + +- Full access to all MCP features +- Pre-configured for maximum resource utilization +- Automatically initializes with the devcontainer + +## Resource Utilization Guidelines + +### For CPU Optimization: +- All compilation tasks use 10 physical cores / 16 threads +- Build tools are configured with parallel job execution (`-j16`) +- Node.js and Go processes utilize worker threads efficiently + +### For GPU Acceleration: +- CUDA 12.2 with cuDNN is available for GPU-accelerated tasks +- Docker is configured with GPU passthrough +- Rendering and compute-intensive tasks are GPU-accelerated + +### For Storage Utilization: +- Build caches are persisted to improve subsequent build times +- Docker layer caching is enabled to speed up container builds +- Temporary files use tmpfs for faster I/O + +## Environment Variables +The following environment variables are available in the devcontainer: + +- `GITHUB_PERSONAL_ACCESS_TOKEN`: For GitHub API access +- `DOCKER_ACCESS_TOKEN`: For Docker registry authentication +- `DOCKER_USERNAME`: For Docker Hub access +- `SSH_DEV_CONTAINER_REPO`: Repository SSH URL +- `OWNER`: Repository owner (DeanLuus22021994) +- `FORK_NAME`: Current fork name (DeanDev) +- `DOCKER_REGISTRY`: Docker registry URL +- `DOCKER_HOST`: Docker daemon socket + +## Development Guidelines +1. **Maximize hardware usage** for builds, tests, and development tasks +2. **Utilize the MCP server** for all GitHub operations and automation +3. **Keep RAM usage under 14GB** to prevent system slowdowns +4. **Leverage GPU acceleration** for compatible workloads +5. **Use cached storage** where possible to improve performance \ No newline at end of file From e51bb31cb782d51a96249ddcf8a45af9414dc524 Mon Sep 17 00:00:00 2001 From: DeanLuus1994 Date: Sun, 13 Apr 2025 21:32:47 +0200 Subject: [PATCH 2/3] chore: format and improve readability of MCP usage and resources documentation --- MCP-USAGE.md | 37 ++++++++++++++++++++++++----- RESOURCES.md | 14 ++++++++--- mcp-git-config.json | 58 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 mcp-git-config.json diff --git a/MCP-USAGE.md b/MCP-USAGE.md index 85c25b358..7745ea935 100644 --- a/MCP-USAGE.md +++ b/MCP-USAGE.md @@ -5,6 +5,7 @@ This document provides instructions for using the GitHub MCP Server in the VS Co ## Environment Specifications This development environment is optimized for maximum performance with: + - **10 physical cores / 16 threads** (i7-13620H) - fully utilized - **NVIDIA RTX 3050 6GB GPU** - maximum utilization enabled - **14GB RAM** limit (preserving system stability) @@ -13,7 +14,8 @@ This development environment is optimized for maximum performance with: ## Overview -The GitHub MCP (Model Context Protocol) Server provides tools to interact with GitHub from within VS Code and AI integrations like GitHub Copilot. These tools allow for: +The GitHub MCP (Model Context Protocol) Server provides tools to interact with GitHub from within VS Code and AI +integrations like GitHub Copilot. These tools allow for: - Repository management (create, fork, search) - Pull request operations @@ -24,7 +26,8 @@ The GitHub MCP (Model Context Protocol) Server provides tools to interact with G ## Setup Instructions -The MCP server has been automatically configured in your devcontainer to utilize maximum system resources while staying within specified limits. It requires a GitHub Personal Access Token to operate. +The MCP server has been automatically configured in your devcontainer to utilize maximum system resources while staying +within specified limits. It requires a GitHub Personal Access Token to operate. ### Setting up your GitHub Token @@ -37,10 +40,13 @@ The MCP server has been automatically configured in your devcontainer to utilize 2. Set the token in your environment: - Option 1: Add to your local environment before starting VS Code: + ```bash export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here ``` + - Option 2: Add to VS Code settings (settings.json): + ```json { "terminal.integrated.env.linux": { @@ -54,6 +60,7 @@ The MCP server has been automatically configured in your devcontainer to utilize To take advantage of the system's powerful hardware: ### For CPU-intensive Tasks + ```bash # For Node.js NODE_OPTIONS="--max-old-space-size=12288 --max-http-header-size=16384" npm run build @@ -66,6 +73,7 @@ GOMAXPROCS=16 go build ./... ``` ### For GPU-accelerated Tasks + ```bash # Run GPU-accelerated tests GPU_ENABLED=1 npm run test-gpu @@ -75,6 +83,7 @@ CUDA_VISIBLE_DEVICES=0 node scripts/process-images.js ``` ### For Storage Optimization + ```bash # Use temporary storage for large operations TMPDIR=/tmp node scripts/generate-docs.js @@ -88,6 +97,7 @@ npm run build -- --cache-dir=/home/vscode/.cache/build-cache The server should start automatically when your devcontainer launches. To verify: 1. Open a terminal in VS Code and run: + ```bash if [ -f "/tmp/mcp-server.pid" ] && ps -p "$(cat /tmp/mcp-server.pid)" > /dev/null; then echo "MCP Server is running"; @@ -97,11 +107,13 @@ The server should start automatically when your devcontainer launches. To verify ``` 2. Check the server logs: + ```bash cat /tmp/mcp-server.log ``` 3. Verify GPU utilization: + ```bash nvidia-smi ``` @@ -119,6 +131,7 @@ If the server is not running, you can start it manually: The GitHub MCP Server provides the following tools: ### Repository Management + - Create repository - Fork repository - Search repositories @@ -126,6 +139,7 @@ The GitHub MCP Server provides the following tools: - Push files ### Issues + - Create issues - Search issues - List issues @@ -133,18 +147,21 @@ The GitHub MCP Server provides the following tools: - Add issue comments ### Pull Requests + - Create pull requests - Review pull requests - Merge pull requests - Update pull request branches ### Search + - Search code - Search users ## Using with GitHub Copilot -When using GitHub Copilot in VS Code, the MCP server is automatically detected, enabling Copilot to use GitHub operations directly. Examples: +When using GitHub Copilot in VS Code, the MCP server is automatically detected, enabling Copilot to use GitHub +operations directly. Examples: - "Create a pull request for the current branch" - "Search for issues about CSS in this repository" @@ -153,11 +170,13 @@ When using GitHub Copilot in VS Code, the MCP server is automatically detected, ### Hardware-accelerated Copilot -This environment is configured to use hardware acceleration for GitHub Copilot, providing faster responses and more efficient processing. The GPU is utilized for local model inference when available. +This environment is configured to use hardware acceleration for GitHub Copilot, providing faster responses and more +efficient processing. The GPU is utilized for local model inference when available. ## Fork-specific Information -This environment is configured for work on the DeanDev fork of the vscode-docs repository. All operations through the MCP server will use: +This environment is configured for work on the DeanDev fork of the vscode-docs repository. All operations through +the MCP server will use: - Repository: `git@github.com:DeanLuus22021994/vscode-docs.git` - Owner: DeanLuus22021994 @@ -168,23 +187,27 @@ This environment is configured for work on the DeanDev fork of the vscode-docs r ### Server Won't Start 1. Ensure your GitHub token is set: + ```bash echo $GITHUB_PERSONAL_ACCESS_TOKEN | wc -c ``` (Should return a number greater than 1) 2. Check for build errors: + ```bash cd /workspace/.github/cmd/github-mcp-server go build -v ``` 3. Check logs for errors: + ```bash cat /tmp/mcp-server.log ``` 4. Verify GPU availability: + ```bash nvidia-smi ``` @@ -192,6 +215,7 @@ This environment is configured for work on the DeanDev fork of the vscode-docs r ### Server Crashes or Returns Errors 1. Restart the server: + ```bash kill $(cat /tmp/mcp-server.pid) /workspace/.github/start-mcp-server.sh @@ -200,6 +224,7 @@ This environment is configured for work on the DeanDev fork of the vscode-docs r 2. Check if your token has the required permissions or has expired 3. Check system resource usage: + ```bash free -h # Check memory usage htop # Check CPU usage @@ -209,4 +234,4 @@ This environment is configured for work on the DeanDev fork of the vscode-docs r - [GitHub MCP Server Repository](https://github.com/github/github-mcp-server) - [Model Context Protocol Documentation](https://containers.dev) -- [System Resource Details](./.github/RESOURCES.md) \ No newline at end of file +- [System Resource Details](./RESOURCES.md) \ No newline at end of file diff --git a/RESOURCES.md b/RESOURCES.md index 4d5451d19..7cfecb65e 100644 --- a/RESOURCES.md +++ b/RESOURCES.md @@ -1,6 +1,7 @@ # Hardware Resources & Repository Configuration ## System Specifications + This development environment is configured to utilize: - **CPU**: Full access to 10 physical cores / 16 threads (i7-13620H) @@ -10,11 +11,13 @@ This development environment is configured to utilize: - **Current Date**: April 13, 2025 ## Repository Configuration + - **Repository URL**: `git@github.com:DeanLuus22021994/vscode-docs.git` - **Fork Name**: DeanDev - **SSH Access**: Enabled and configured ## MCP Server Configuration + The GitHub MCP (Model Context Protocol) Server is available locally through Docker with the following setup: - Full access to all MCP features @@ -23,22 +26,26 @@ The GitHub MCP (Model Context Protocol) Server is available locally through Dock ## Resource Utilization Guidelines -### For CPU Optimization: +### For CPU Optimization + - All compilation tasks use 10 physical cores / 16 threads - Build tools are configured with parallel job execution (`-j16`) - Node.js and Go processes utilize worker threads efficiently -### For GPU Acceleration: +### For GPU Acceleration + - CUDA 12.2 with cuDNN is available for GPU-accelerated tasks - Docker is configured with GPU passthrough - Rendering and compute-intensive tasks are GPU-accelerated -### For Storage Utilization: +### For Storage Utilization + - Build caches are persisted to improve subsequent build times - Docker layer caching is enabled to speed up container builds - Temporary files use tmpfs for faster I/O ## Environment Variables + The following environment variables are available in the devcontainer: - `GITHUB_PERSONAL_ACCESS_TOKEN`: For GitHub API access @@ -51,6 +58,7 @@ The following environment variables are available in the devcontainer: - `DOCKER_HOST`: Docker daemon socket ## Development Guidelines + 1. **Maximize hardware usage** for builds, tests, and development tasks 2. **Utilize the MCP server** for all GitHub operations and automation 3. **Keep RAM usage under 14GB** to prevent system slowdowns diff --git a/mcp-git-config.json b/mcp-git-config.json new file mode 100644 index 000000000..1eecd05c4 --- /dev/null +++ b/mcp-git-config.json @@ -0,0 +1,58 @@ +{ + "gitConfig": { + "repository": { + "owner": "DeanLuus22021994", + "name": "vscode-docs", + "fork": "DeanDev", + "defaultBranch": "DeanDev", + "ssh": "git@github.com:DeanLuus22021994/vscode-docs.git", + "https": "https://github.com/DeanLuus22021994/vscode-docs.git" + }, + "branchSettings": { + "trackRemote": true, + "autoFetch": true, + "fetchInterval": 300, + "defaultCommitter": { + "name": "MCP Server", + "email": "mcp-server@example.com" + } + }, + "pullRequestSettings": { + "defaultBase": "main", + "defaultReviewers": [], + "autoCreateOnPush": false, + "draftByDefault": true + }, + "commitSettings": { + "signCommits": false, + "conventionalCommits": true, + "prefixes": [ + "feat", + "fix", + "docs", + "style", + "refactor", + "perf", + "test", + "build", + "ci", + "chore" + ] + }, + "hooks": { + "preCommit": "", + "postCommit": "", + "prePush": "", + "postPush": "" + } + }, + "systemResources": { + "cpuCores": 10, + "threadCount": 16, + "maxRamGB": 14, + "gpuEnabled": true, + "gpuModel": "NVIDIA RTX 3050 6GB", + "storageGB": 250 + }, + "lastUpdated": "2025-04-13T21:31:16.662Z" +} \ No newline at end of file From 8aad5c2cfd4145ee1dd57ebd307a5839b412a062 Mon Sep 17 00:00:00 2001 From: DeanLuus1994 Date: Sun, 13 Apr 2025 21:35:29 +0200 Subject: [PATCH 3/3] chore: improve formatting and readability of MCP server usage instructions --- MCP-USAGE.md | 90 ++++++++++++++++++++-------------------------------- RESOURCES.md | 2 +- 2 files changed, 36 insertions(+), 56 deletions(-) diff --git a/MCP-USAGE.md b/MCP-USAGE.md index 7745ea935..124758dcd 100644 --- a/MCP-USAGE.md +++ b/MCP-USAGE.md @@ -96,27 +96,21 @@ npm run build -- --cache-dir=/home/vscode/.cache/build-cache The server should start automatically when your devcontainer launches. To verify: -1. Open a terminal in VS Code and run: - - ```bash - if [ -f "/tmp/mcp-server.pid" ] && ps -p "$(cat /tmp/mcp-server.pid)" > /dev/null; then - echo "MCP Server is running"; - else - echo "MCP Server is not running"; - fi - ``` - -2. Check the server logs: - - ```bash - cat /tmp/mcp-server.log - ``` +```bash +if [ -f "/tmp/mcp-server.pid" ] && ps -p "$(cat /tmp/mcp-server.pid)" > /dev/null; then + echo "MCP Server is running"; +else + echo "MCP Server is not running"; +fi +``` -3. Verify GPU utilization: +```bash +cat /tmp/mcp-server.log +``` - ```bash - nvidia-smi - ``` +```bash +nvidia-smi +``` ## Manually Starting the Server @@ -186,49 +180,35 @@ the MCP server will use: ### Server Won't Start -1. Ensure your GitHub token is set: - - ```bash - echo $GITHUB_PERSONAL_ACCESS_TOKEN | wc -c - ``` - (Should return a number greater than 1) - -2. Check for build errors: - - ```bash - cd /workspace/.github/cmd/github-mcp-server - go build -v - ``` - -3. Check logs for errors: +```bash +echo $GITHUB_PERSONAL_ACCESS_TOKEN | wc -c +``` +(Should return a number greater than 1) - ```bash - cat /tmp/mcp-server.log - ``` +```bash +cd /workspace/.github/cmd/github-mcp-server +go build -v +``` -4. Verify GPU availability: +```bash +cat /tmp/mcp-server.log +``` - ```bash - nvidia-smi - ``` +```bash +nvidia-smi +``` ### Server Crashes or Returns Errors -1. Restart the server: - - ```bash - kill $(cat /tmp/mcp-server.pid) - /workspace/.github/start-mcp-server.sh - ``` - -2. Check if your token has the required permissions or has expired - -3. Check system resource usage: +```bash +kill $(cat /tmp/mcp-server.pid) +/workspace/.github/start-mcp-server.sh +``` - ```bash - free -h # Check memory usage - htop # Check CPU usage - ``` +```bash +free -h # Check memory usage +htop # Check CPU usage +``` ## Additional Resources diff --git a/RESOURCES.md b/RESOURCES.md index 7cfecb65e..73d02ef09 100644 --- a/RESOURCES.md +++ b/RESOURCES.md @@ -63,4 +63,4 @@ The following environment variables are available in the devcontainer: 2. **Utilize the MCP server** for all GitHub operations and automation 3. **Keep RAM usage under 14GB** to prevent system slowdowns 4. **Leverage GPU acceleration** for compatible workloads -5. **Use cached storage** where possible to improve performance \ No newline at end of file +5. **Use cached storage** where possible to improve performance