feat: Add "secret" GitHub authentication with wrapper scripts #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Following on from the discussion at #6, this PR enhances the GitHub MCP Extension for Zed by implementing automatic token authentication through wrapper scripts, addressing the limitation of Zed's WASM sandbox which cannot access host environment variables.
Problem Solved
Previously, users had to manually obtain and configure GitHub personal access tokens. This enhancement allows the extension to automatically use existing GitHub authentication from:
gh auth status
)GITHUB_TOKEN
).github_token
)Key Features
🔄 Automatic Authentication
📁 Improved Project Structure
wrappers/
directory🛠 Enhanced User Experience
"use_wrapper_script": true
in settingsNOTE: This should support Windows, but I don't have a machine lying around to test it.
Technical Implementation
Wrapper Script Auto-Detection
The extension automatically searches for wrapper scripts in the following order:
github-mcp-wrapper.js
(Node.js)github-mcp-wrapper.sh
(Bash)github-mcp-wrapper.ps1
(PowerShell)Authentication Flow
Configuration
Simple Setup
Manual Fallback (Unchanged)
Files Added/Modified
New Files
wrappers/github-mcp-wrapper.js
- Node.js authentication wrapperwrappers/github-mcp-wrapper.sh
- Bash authentication wrapperwrappers/github-mcp-wrapper.ps1
- PowerShell authentication wrapperwrappers/README.md
- Wrapper script documentationdocs/configuration.md
- Comprehensive configuration guidedocs/troubleshooting.md
- Common issues and solutionsCHANGELOG.md
- Version historyModified Files
src/mcp_server_github.rs
- Core extension logic with wrapper supportREADME.md
- Updated with new features and simplified setupconfiguration/default_settings.jsonc
- Added wrapper script optionRemoved Files
configuration/installation_instructions.md
- Consolidated into docs/Testing
The enhancement has been tested with:
gh auth login
)GITHUB_TOKEN
).github_token
)Backwards Compatibility