Skip to content

Commit 76bd66f

Browse files
committed
Use GH CLI auth for GitHub MCP
- Fixes error where the GitHub MCP fails to authenticate
1 parent 4e2258a commit 76bd66f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ setopt HIST_VERIFY # don't immediately execute recalled commands
105105
# DEVCONTAINER ZSH HISTORY END
106106
EOF
107107
108+
# Export GitHub token from gh CLI for MCP server auth
109+
RUN echo '' >> /home/vscode/.zshrc && \
110+
echo '# GitHub MCP token from gh CLI' >> /home/vscode/.zshrc && \
111+
echo 'export GITHUB_PERSONAL_ACCESS_TOKEN=$(gh auth token 2>/dev/null)' >> /home/vscode/.zshrc
112+
108113
# Switch back to vscode user
109114
USER vscode
110115

0 commit comments

Comments
 (0)