octocode-mcp 2.3.1 → 2.3.4
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 +53 -20
- package/build/index.js +594 -425
- package/package.json +27 -27
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<div>
|
|
6
6
|
<img src="./assets/logo.png">
|
|
7
7
|
|
|
8
|
-
[](./package.json)
|
|
9
9
|
[](./package.json)
|
|
10
10
|
[](https://modelcontextprotocol.io/)
|
|
11
11
|
</div>
|
|
@@ -55,7 +55,7 @@ It's the tool you reach for when you need to understand *"how does this work?"*
|
|
|
55
55
|
|
|
56
56
|
### 1. Install Prerequisites
|
|
57
57
|
```bash
|
|
58
|
-
# Install Node.js
|
|
58
|
+
# Install Node.js 18.12+
|
|
59
59
|
brew install node # macOS
|
|
60
60
|
# or download from https://nodejs.org/
|
|
61
61
|
|
|
@@ -93,35 +93,44 @@ npm login
|
|
|
93
93
|
|
|
94
94
|
**That's it!** No personal access tokens, no config files, no complex setup. Octocode leverages [GitHub CLI](https://cli.github.com/) authentication behind the scenes and **automatically works with your organization's private repositories**.
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+

|
|
97
97
|
|
|
98
|
-
**Learning & Research:**
|
|
99
|
-
- *"How do popular libraries implement rate limiting?"*
|
|
100
|
-
- *"Show me Server Actions patterns in Next.js applications"*
|
|
101
|
-
- *"What are the differences between Vue and React rendering?"*
|
|
102
98
|
|
|
103
|
-
|
|
104
|
-
- *"How is authentication handled in enterprise applications?"*
|
|
105
|
-
- *"Show me microservices communication patterns"*
|
|
106
|
-
- *"Find examples of event-driven architecture implementations"*
|
|
99
|
+
## How Octocode Works 🔄
|
|
107
100
|
|
|
108
|
-
**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
**Smart Discovery Flow:**
|
|
102
|
+
1. **🔍 Query Analysis** → AI determines the best search strategy based on your question
|
|
103
|
+
2. **⚡ Multi-Tool Orchestration** → Combines GitHub + NPM searches intelligently
|
|
104
|
+
3. **🔄 Smart Fallbacks** → Automatically retries with different approaches if initial search fails
|
|
105
|
+
4. **🔗 Cross-Reference Discovery** → Links packages to repositories, finds related implementations
|
|
106
|
+
5. **🎯 Context Synthesis** → Provides comprehensive understanding across multiple sources
|
|
112
107
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
## Example Flows
|
|
109
|
+
|
|
110
|
+
### Example 1: LangGraph Node.js Implementation Tutorial
|
|
111
|
+
**Query:** "Show implementations of langgraph in node js. Make a tutorial for how to implement a simple agent using OpenAI API."
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
### Example 2: Zustand React State Management
|
|
116
|
+
**Query:** "Show me how to add zustand to react application. Show examples and best practices"
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
### Example 3: React vs Vue.js Rendering Comparison
|
|
121
|
+
**Query:** "How did React implement their concurrent rendering flows? How is it different from Vue.js rendering mechanism? Which is better?"
|
|
122
|
+
|
|
123
|
+

|
|
117
124
|
|
|
118
125
|
## Core Features 🛠️
|
|
119
126
|
|
|
120
127
|
### 🧠 AI-Powered Advanced Search
|
|
121
128
|
- **Heuristic Pattern Recognition** - Finds relevant code even with vague or incomplete queries
|
|
122
|
-
- **Smart Fallback Strategies** - Automatically tries alternative approaches when searches fail
|
|
129
|
+
- **Smart Fallback Strategies** - Automatically tries alternative approaches when searches fail with actionable suggestions
|
|
130
|
+
- **Boolean Search Intelligence** - Automatic query optimization with smart boolean operators (3-5x performance improvement)
|
|
123
131
|
- **Context-Aware Discovery** - Understands code relationships and suggests related implementations
|
|
124
132
|
- **Multi-Strategy Search** - Combines semantic, syntactic, and dependency-based search methods
|
|
133
|
+
- **Graceful Error Recovery** - Comprehensive error handling with intelligent retry mechanisms
|
|
125
134
|
|
|
126
135
|
### 🔗 Connection Intelligence
|
|
127
136
|
- **Repository-Package Mapping** - Automatically links NPM packages to their GitHub repositories
|
|
@@ -148,6 +157,24 @@ npm login
|
|
|
148
157
|
- **🔑 No Token Management** - Uses [GitHub CLI](https://cli.github.com/) authentication, no personal access tokens needed
|
|
149
158
|
- **🛡️ Privacy by Design** - All API calls use your existing `gh` CLI permissions directly
|
|
150
159
|
|
|
160
|
+
### Command Execution Security 🔒
|
|
161
|
+
|
|
162
|
+
**Robust protection against prompt injections and malicious command execution:**
|
|
163
|
+
|
|
164
|
+
- **⚪ Allowlisted Commands Only** - Only pre-approved, safe NPM and GitHub CLI commands are executable
|
|
165
|
+
- NPM: `view`, `search`, `ping`, `config`, `whoami`
|
|
166
|
+
- GitHub CLI: `search`, `api`, `auth`, `org`
|
|
167
|
+
- **🛡️ Argument Sanitization** - All command arguments are properly escaped to prevent shell injection attacks
|
|
168
|
+
- **✅ Pre-execution Validation** - Every command is validated against allowed lists before execution
|
|
169
|
+
- **🔧 Controlled Environment** - Commands run in a secure, cross-platform shell environment with controlled variables
|
|
170
|
+
- **Cross-platform shells**: Uses `/bin/sh` on Unix/macOS, `cmd.exe` or `powershell.exe` on Windows - minimal, standard shells
|
|
171
|
+
- **PowerShell support**: Modern Windows environments can optionally use PowerShell with enhanced security
|
|
172
|
+
- **Why minimal shells are safe**: Avoids user's potentially customized shells with aliases, functions, plugins, or advanced features
|
|
173
|
+
- **Controlled variables**: Only essential environment variables (`PATH`, `SHELL`) are passed, preventing environment-based attacks
|
|
174
|
+
- **Platform-specific escaping**: Uses appropriate argument escaping for each platform (single quotes on Unix, double quotes for CMD, single quotes for PowerShell)
|
|
175
|
+
- **🚫 No Arbitrary Execution** - System cannot execute arbitrary shell commands or scripts
|
|
176
|
+
- **⏱️ Timeout Protection** - All commands have execution timeouts to prevent resource exhaustion
|
|
177
|
+
|
|
151
178
|
## Best Practices 💡
|
|
152
179
|
|
|
153
180
|
**AI-Powered Search Tips:**
|
|
@@ -193,6 +220,12 @@ npm whoami
|
|
|
193
220
|
- **No additional setup** - If you have access to private repos through your organization, they work immediately
|
|
194
221
|
- **Verify access** - Run `gh auth status` to see your organization memberships
|
|
195
222
|
|
|
223
|
+
**💻 Windows PowerShell Support:**
|
|
224
|
+
- **Modern shell support** - Optionally use PowerShell instead of cmd.exe on Windows
|
|
225
|
+
- **Enhanced security** - PowerShell provides better argument escaping and modern features
|
|
226
|
+
- **Automatic detection** - The system automatically detects Windows and applies appropriate shell configurations
|
|
227
|
+
- **Zero configuration** - Works seamlessly with existing setups, no additional configuration needed
|
|
228
|
+
|
|
196
229
|
**Why GitHub CLI Authentication?**
|
|
197
230
|
- ✅ **No token creation** - GitHub CLI handles OAuth flow automatically
|
|
198
231
|
- ✅ **Enterprise compatible** - Works with SSO, SAML, and 2FA out of the box
|