diff --git a/MCP-USAGE.md b/MCP-USAGE.md new file mode 100644 index 000000000..124758dcd --- /dev/null +++ b/MCP-USAGE.md @@ -0,0 +1,217 @@ +# 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: + +```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 +``` + +```bash +cat /tmp/mcp-server.log +``` + +```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 + +```bash +echo $GITHUB_PERSONAL_ACCESS_TOKEN | wc -c +``` +(Should return a number greater than 1) + +```bash +cd /workspace/.github/cmd/github-mcp-server +go build -v +``` + +```bash +cat /tmp/mcp-server.log +``` + +```bash +nvidia-smi +``` + +### Server Crashes or Returns Errors + +```bash +kill $(cat /tmp/mcp-server.pid) +/workspace/.github/start-mcp-server.sh +``` + +```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](./RESOURCES.md) \ No newline at end of file diff --git a/RESOURCES.md b/RESOURCES.md new file mode 100644 index 000000000..73d02ef09 --- /dev/null +++ b/RESOURCES.md @@ -0,0 +1,66 @@ +# 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 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