octocode-mcp 2.3.2 → 2.3.5
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 +50 -20
- package/build/index.js +2169 -1210
- package/package.json +1 -1
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,41 @@ 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
|
+
## How Octocode Works 🔄
|
|
97
97
|
|
|
98
|
-
**
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
|
|
98
|
+
**Smart Discovery Flow:**
|
|
99
|
+
1. **🔍 Query Analysis** → AI determines the best search strategy based on your question
|
|
100
|
+
2. **⚡ Multi-Tool Orchestration** → Combines GitHub + NPM searches intelligently
|
|
101
|
+
3. **🔄 Smart Fallbacks** → Automatically retries with different approaches if initial search fails
|
|
102
|
+
4. **🔗 Cross-Reference Discovery** → Links packages to repositories, finds related implementations
|
|
103
|
+
5. **🎯 Context Synthesis** → Provides comprehensive understanding across multiple sources
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
- *"How is authentication handled in enterprise applications?"*
|
|
105
|
-
- *"Show me microservices communication patterns"*
|
|
106
|
-
- *"Find examples of event-driven architecture implementations"*
|
|
105
|
+
## Example Flows
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- *"Find internal libraries and how they're implemented in our org"*
|
|
111
|
-
- *"Analyze our company's coding standards and patterns"*
|
|
107
|
+
### Example 1: LangGraph Node.js Implementation Tutorial
|
|
108
|
+
**Query:** "Show implementations of langgraph in node js. Make a tutorial for how to implement a simple agent using OpenAI API."
|
|
112
109
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
[](https://youtu.be/E5HUlRckpvg?si=XXLle59C92esDscS)
|
|
111
|
+
|
|
112
|
+
### Example 2: Zustand React State Management
|
|
113
|
+
**Query:** "Show me how to add zustand to react application. Show examples and best practices"
|
|
114
|
+
|
|
115
|
+
[](https://youtu.be/EgYbsuWmqsI?si=CN_KwCPgwprImynU)
|
|
116
|
+
|
|
117
|
+
### Example 3: React vs Vue.js Rendering Comparison
|
|
118
|
+
**Query:** "How did React implement their concurrent rendering flows? How is it different from Vue.js rendering mechanism? Which is better?"
|
|
119
|
+
|
|
120
|
+
[](https://youtu.be/-_pbCbLXKDc?si=KiPeGCzmwWtb6G3r)
|
|
117
121
|
|
|
118
122
|
## Core Features 🛠️
|
|
119
123
|
|
|
120
124
|
### 🧠 AI-Powered Advanced Search
|
|
121
125
|
- **Heuristic Pattern Recognition** - Finds relevant code even with vague or incomplete queries
|
|
122
|
-
- **Smart Fallback Strategies** - Automatically tries alternative approaches when searches fail
|
|
126
|
+
- **Smart Fallback Strategies** - Automatically tries alternative approaches when searches fail with actionable suggestions
|
|
127
|
+
- **Boolean Search Intelligence** - Automatic query optimization with smart boolean operators (3-5x performance improvement)
|
|
123
128
|
- **Context-Aware Discovery** - Understands code relationships and suggests related implementations
|
|
124
129
|
- **Multi-Strategy Search** - Combines semantic, syntactic, and dependency-based search methods
|
|
130
|
+
- **Graceful Error Recovery** - Comprehensive error handling with intelligent retry mechanisms
|
|
125
131
|
|
|
126
132
|
### 🔗 Connection Intelligence
|
|
127
133
|
- **Repository-Package Mapping** - Automatically links NPM packages to their GitHub repositories
|
|
@@ -148,6 +154,24 @@ npm login
|
|
|
148
154
|
- **🔑 No Token Management** - Uses [GitHub CLI](https://cli.github.com/) authentication, no personal access tokens needed
|
|
149
155
|
- **🛡️ Privacy by Design** - All API calls use your existing `gh` CLI permissions directly
|
|
150
156
|
|
|
157
|
+
### Command Execution Security 🔒
|
|
158
|
+
|
|
159
|
+
**Robust protection against prompt injections and malicious command execution:**
|
|
160
|
+
|
|
161
|
+
- **⚪ Allowlisted Commands Only** - Only pre-approved, safe NPM and GitHub CLI commands are executable
|
|
162
|
+
- NPM: `view`, `search`, `ping`, `config`, `whoami`
|
|
163
|
+
- GitHub CLI: `search`, `api`, `auth`, `org`
|
|
164
|
+
- **🛡️ Argument Sanitization** - All command arguments are properly escaped to prevent shell injection attacks
|
|
165
|
+
- **✅ Pre-execution Validation** - Every command is validated against allowed lists before execution
|
|
166
|
+
- **🔧 Controlled Environment** - Commands run in a secure, cross-platform shell environment with controlled variables
|
|
167
|
+
- **Cross-platform shells**: Uses `/bin/sh` on Unix/macOS, `cmd.exe` or `powershell.exe` on Windows - minimal, standard shells
|
|
168
|
+
- **PowerShell support**: Modern Windows environments can optionally use PowerShell with enhanced security
|
|
169
|
+
- **Why minimal shells are safe**: Avoids user's potentially customized shells with aliases, functions, plugins, or advanced features
|
|
170
|
+
- **Controlled variables**: Only essential environment variables (`PATH`, `SHELL`) are passed, preventing environment-based attacks
|
|
171
|
+
- **Platform-specific escaping**: Uses appropriate argument escaping for each platform (single quotes on Unix, double quotes for CMD, single quotes for PowerShell)
|
|
172
|
+
- **🚫 No Arbitrary Execution** - System cannot execute arbitrary shell commands or scripts
|
|
173
|
+
- **⏱️ Timeout Protection** - All commands have execution timeouts to prevent resource exhaustion
|
|
174
|
+
|
|
151
175
|
## Best Practices 💡
|
|
152
176
|
|
|
153
177
|
**AI-Powered Search Tips:**
|
|
@@ -193,6 +217,12 @@ npm whoami
|
|
|
193
217
|
- **No additional setup** - If you have access to private repos through your organization, they work immediately
|
|
194
218
|
- **Verify access** - Run `gh auth status` to see your organization memberships
|
|
195
219
|
|
|
220
|
+
**💻 Windows PowerShell Support:**
|
|
221
|
+
- **Modern shell support** - Optionally use PowerShell instead of cmd.exe on Windows
|
|
222
|
+
- **Enhanced security** - PowerShell provides better argument escaping and modern features
|
|
223
|
+
- **Automatic detection** - The system automatically detects Windows and applies appropriate shell configurations
|
|
224
|
+
- **Zero configuration** - Works seamlessly with existing setups, no additional configuration needed
|
|
225
|
+
|
|
196
226
|
**Why GitHub CLI Authentication?**
|
|
197
227
|
- ✅ **No token creation** - GitHub CLI handles OAuth flow automatically
|
|
198
228
|
- ✅ **Enterprise compatible** - Works with SSO, SAML, and 2FA out of the box
|