octocode-mcp 4.0.1-alpha.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  <div align="center">
17
17
 
18
- [![Version](https://img.shields.io/badge/version-4.0.1-blue.svg)](./package.json)
18
+ [![Version](https://img.shields.io/badge/version-4.0.2-blue.svg)](./package.json)
19
19
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](./package.json)
20
20
  [![X/Twitter](https://img.shields.io/badge/X-Follow%20@guy__bary-1DA1F2.svg?logo=x&logoColor=white)](https://x.com/guy_bary)
21
21
 
@@ -64,10 +64,11 @@ Built on the **Model Context Protocol (MCP)**, Octocode provides AI assistants w
64
64
  - **AI Assistant** (Claude Desktop, or any MCP-compatible assistant)
65
65
 
66
66
  ### Authentication Options
67
- Octocode supports flexible GitHub authentication:
67
+ Octocode supports flexible GitHub authentication with smart fallback:
68
68
 
69
69
  1. **[GitHub CLI](https://cli.github.com/)** (Recommended for local development) - Run `gh auth login` for seamless authentication
70
70
  2. **[Personal Access Token](https://github.com/settings/tokens)** (Recommended for Windows & hosted environments) - Set `GITHUB_TOKEN` or `GH_TOKEN` environment variable
71
+ 3. **Authorization Header** (For API integrations) - Set `Authorization` environment variable with `Bearer {{token}}` format
71
72
 
72
73
  ### Performance Optimizations
73
74
  - **NPM Integration**: Automatically enhances package research when NPM is available
@@ -131,7 +132,34 @@ Octocode supports flexible GitHub authentication:
131
132
  }
132
133
  }
133
134
  }
135
+ ```
136
+
137
+ ---
138
+
139
+ #### **Option 3: Authorization Header Format**
140
+ *Best for API integrations and templated configurations*
141
+
142
+ ```json
143
+ {
144
+ "octocode": {
145
+ "command": "npx",
146
+ "args": ["octocode-mcp"],
147
+ "env": {
148
+ "Authorization": "Bearer your_github_token_here"
149
+ }
150
+ }
151
+ }
134
152
  ```
153
+ > 💡 **Note:** Supports template formats like `Bearer {{GH_TOKEN}}` for dynamic token injection.
154
+
155
+ ### Authentication Fallback Chain
156
+
157
+ Octocode uses an intelligent authentication system that tries multiple methods in priority order:
158
+
159
+ 1. **`GITHUB_TOKEN`** - Primary GitHub token environment variable
160
+ 2. **`GH_TOKEN`** - Alternative GitHub token environment variable
161
+ 3. **GitHub CLI Token** - Automatically extracted from `gh auth login` session
162
+ 4. **`Authorization` Header** - Extracts token from Bearer format (`Bearer {{token}}`), supporting template variables
135
163
 
136
164
 
137
165