octocode-mcp 2.3.0 → 2.3.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.
Files changed (3) hide show
  1. package/README.md +133 -515
  2. package/build/index.js +434 -385
  3. package/package.json +27 -27
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Octocode MCP
2
2
 
3
- **AI-Powered GitHub Research Assistant for Code Discovery**
3
+ **The Perfect AI Code Assistant - Advanced Search & Discovery Across GitHub & NPM**
4
4
 
5
5
  <div>
6
6
  <img src="./assets/logo.png">
@@ -10,590 +10,208 @@
10
10
  [![MCP](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io/)
11
11
  </div>
12
12
 
13
- ## 📋 Table of Contents
14
-
15
- - [✨ Overview](#-overview)
16
- - [A New Take on Code Discovery MCP](#a-new-take-on-code-discovery-mcp)
17
- - [🧠 AI-First Architecture](#-ai-first-architecture)
18
- - [🔄 Intelligent Tool Chaining](#-intelligent-tool-chaining)
19
- - [🎯 Smart Discovery Features](#-smart-discovery-features)
20
- - [💡 Background & Motivation](#-background--motivation)
21
- - [🔄 A Tool That Built Itself](#-a-tool-that-built-itself)
22
- - [🎯 Innovation: NPM-Driven Repository Discovery](#-innovation-npm-driven-repository-discovery)
23
- - [🌟 Example Use Cases](#-example-use-cases)
24
- - [🎯 Features](#-features)
25
- - [For Developers](#for-developers)
26
- - [For Engineering Managers](#for-engineering-managers)
27
- - [🛠 Available Tools](#-available-tools)
28
- - [🔍 GitHub Code & Repository Search](#-github-code--repository-search)
29
- - [📦 NPM & Package Ecosystem](#-npm--package-ecosystem)
30
- - [📋 Development History & Collaboration](#-development-history--collaboration)
31
- - [👥 User & Organization Management](#-user--organization-management)
32
- - [🎯 Smart Features](#-smart-features)
33
- - [📚 Usage Examples](#-usage-examples)
34
- - [Basic Code Discovery](#basic-code-discovery)
35
- - [Advanced Research](#advanced-research)
36
- - [Learning & Documentation](#learning--documentation)
37
- - [Historical Analysis](#historical-analysis)
38
- - [Code Review & Improvement](#code-review--improvement)
39
- - [💡 Tips for Effective Usage](#-tips-for-effective-usage)
40
- - [🎯 Search Strategy Tips](#-search-strategy-tips)
41
- - [📚 Documentation & Knowledge Management](#-documentation--knowledge-management)
42
- - [⚡ Performance & Limitations](#-performance--limitations)
43
- - [🔗 Cross-Repository Analysis](#-cross-repository-analysis)
44
- - [🎨 Advanced Use Cases](#-advanced-use-cases)
45
- - [🚀 Pro Tips](#-pro-tips)
46
- - [🛠 Installation & Setup](#-installation--setup)
47
- - [🚀 Works Out Of The Box (OOTB) - Any Environment!](#-works-out-of-the-box-ootb---any-environment)
48
- - [Step 1: Install Prerequisites](#step-1-install-prerequisites)
49
- - [Step 2: Authentication Setup](#step-2-authentication-setup)
50
- - [Step 3: MCP Configuration](#step-3-mcp-configuration)
51
- - [🎉 That's It! Ready To Use](#-thats-it-ready-to-use)
52
- - [🌟 Alternative Installation Options](#-alternative-installation-options)
53
- - [🔒 Privacy & Local Operation](#-privacy--local-operation)
54
- - [🔒 Why Different Than Static PAT](#-why-different-than-static-pat)
55
- - [License](#license)
56
- - [⚙️ Advanced Configuration](#️-advanced-configuration)
57
- - [Rate Limiting & Performance](#rate-limiting--performance)
58
- - [Authentication Management](#authentication-management)
59
- - [NPM Configuration](#npm-configuration)
60
- - [🎯 Best Practices](#-best-practices)
61
- - [Search Strategy](#search-strategy)
62
- - [Performance Optimization](#performance-optimization)
63
- - [Tool Chaining Best Practices](#tool-chaining-best-practices)
64
- - [🐛 Troubleshooting](#-troubleshooting)
65
- - [Authentication Issues](#authentication-issues)
66
- - [Common Issues](#common-issues)
67
- - [NPM Configuration Issues](#npm-configuration-issues)
68
- - [Misconfigured .npmrc File](#misconfigured-npmrc-file)
69
- - [Development Setup](#development-setup)
70
- - [Disclaimer](#disclaimer)
71
-
72
- ## ✨ Overview
73
-
74
- ### A New Take on Code Discovery MCP
75
-
76
- **Differences Between Traditional GitHub MCPs and Octocode MCP:**
77
- - **Octocode MCP** = AI-Powered Research Assistant for Code Discovery
78
- - **Traditional GitHub MCPs** = Traditional API Wrapper for CRUD Operations
79
-
80
- ### 🧠 **AI-First Architecture**
81
- - **Chain-of-Thought Reasoning Framework**: 6-step reasoning methodology built into prompts
82
- - **Teaching Methodology Integration**: AI education built into tool descriptions
83
- - **Context-aware Search Optimization**: Quality validation pipelines for code discovery
84
- - **Automatic Query Optimization**: Single-word prioritization strategy ("RAG" -> "Ranking" not "RAG Ranking")
85
-
86
- ### 🔄 **Intelligent Tool Chaining**
87
- - **Automatic Organization Detection**: Smart tool chaining based on context
88
- - **Package-to-Repository Mapping**: NPM mentions trigger automatic repository discovery
89
- - **Cross-validation Workflows**: Multi-step research flows with tool interconnection
90
- - **Progressive Search Refinement**: Phase-based search refinement (Broad -> Pattern -> Precise)
91
-
92
- ### 🎯 **Smart Discovery Features**
93
- - **Semantic Landscape Mapping**: `search_github_topics` for ecosystem understanding
94
- - **Community Knowledge Discovery**: `search_github_discussions` for Q&A and tutorials
95
- - **Evolution Tracking**: `search_github_commits` for code history analysis
96
- - **Private Repository Discovery**: `get_user_organizations` for enterprise access
97
- - **Package Ecosystem Discovery**: `npm_search` and `npm_view` integration
98
-
99
- ## 💡 Background & Motivation
100
-
101
-
102
- This project was born from a personal need while working at **Wix** - navigating and understanding large-scale repositories and codebases became increasingly challenging as projects grew in complexity. Traditional GitHub search and documentation often fell short when trying to:
103
-
104
- - **Understand architectural decisions** across multiple repositories
105
- - **Find real implementation examples** rather than just documentation
106
- - **Track the evolution** of complex features and systems
107
- - **Discover internal patterns** and best practices across teams
108
-
109
- Beyond repository navigation, this tool has become essential for **keeping pace with the vast landscape of technology changes**. In today's rapidly evolving development ecosystem, staying current with new frameworks, libraries, and patterns is crucial for maintaining high development velocity.
110
-
111
- What started as a side project to solve my own daily challenges evolved into a comprehensive AI-powered research assistant. The goal was simple: **make repository exploration and code discovery as intelligent and intuitive as having a senior developer guide you through any codebase.**
112
-
113
- ### 🔄 A Tool That Built Itself
114
-
115
- In a fascinating turn of meta-development, **Octocode MCP actually helped create itself**. During development, I used the tool to:
116
-
117
- - **Understand MCP APIs correctly** by analyzing existing MCP implementations and documentation
118
- - **Compare features with other MCPs** to identify gaps and opportunities
119
- - **Research best practices** from successful GitHub integrations
120
- - **Study code patterns** from high-quality open source projects
121
-
122
- This self-referential development process validated the tool's core value proposition: **enabling developers to learn from and build upon the collective intelligence of the entire GitHub ecosystem.**
123
-
124
- ### 🎯 Innovation: NPM-Driven Repository Discovery
125
-
126
- One approach that emerged from my own search challenges: **using the NPM registry as a quality filter for repository discovery**. When searching through the vast GitHub landscape, finding high-quality, production-ready code was challenging.
127
-
128
- The approach:
129
- - **NPM as Quality Signal**: Published packages indicate battle-tested, production-ready code
130
- - **Package-to-Repository Mapping**: Automatically link NPM packages to their GitHub repositories
131
- - **Quality Amplification**: Focus on repositories that maintain published packages, ensuring real-world usage
132
- - **Ecosystem Context**: Understand dependencies and relationships through package management
133
-
134
- This methodology improved search result quality by leveraging the NPM ecosystem's inherent curation - if someone published it as a package, it's likely production-ready and well-maintained.
135
-
136
- *Note: This is a personal side project and not an official Wix product.*
137
-
138
- ## 🌟 Example Use Cases
139
-
140
- **AI agents can now ask questions like:**
141
-
142
- - *"Show the langchain code examples from my organization"*
143
- - *"From code and PRs, how did React implement concurrent rendering?"*
144
- - *"Show examples of usage of this API: `import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';` Look at my code and suggest how I can improve it"*
145
- - *"Best ways from code examples to use routing in Next.js"*
146
- - *"Make docs of lodash"*
147
- - *"Show progress of React project in the recent 5 years"*
148
- - *"How is Vue rendering architecture different than React? Check from code"*
149
- - *"Create development docs and guides about how wix ai gateway works"*
150
- - *"How does SOME_REPOSITORY work?"*
151
- - *"Summarise the main PRs on project X"*
152
- - *"How do Vue and React render components? Which approach is more optimized?"*
153
-
154
- ## 🎯 Features
155
-
156
- ### For Developers
157
- - **🔍 Intelligent Code Discovery**: Find implementations, patterns, and examples with AI-guided search
158
- - **🔗 Cross-Repository Investigation**: Trace code patterns, dependencies, and implementations across multiple repositories
159
- - **🏢 Cross-Organization Dependencies**: Understand dependencies and relationships across different organizations and teams
160
- - **📚 Library & API Understanding**: Deep dive into libraries and APIs with examples from both internal and external repositories
161
- - **🔎 Specific Code Usage Search**: Find exact code patterns, function implementations, and usage examples
162
- - **🏷️ Topic Understanding**: Explore and understand technology topics, trends, and ecosystems
163
- - **🏗️ Big Project Analysis**: Comprehensive analysis of large-scale projects and their architecture
164
- - *"Create development docs and guides about how wix ai gateway works"*
165
- - *"How does SOME_REPOSITORY work?"*
166
- - **📈 Project Progress Analysis**: Track and summarize project evolution and key changes
167
- - *"Summarise the main PRs on project X"*
168
- - **🔬 Cross-Repository Analysis**: Compare approaches and implementations across different projects
169
- - *"How do Vue and React render components? Which approach is more optimized?"*
170
- - **📦 Smart Dependency Analysis**: Understand package relationships and find alternative libraries with automatic NPM integration
171
- - **🐛 Advanced Bug Investigation**: Track issues, commits, and pull requests with multi-repository correlation
172
- - **📚 Learning & Reference**: Access community discussions, documentation, and best practices with context-aware recommendations
173
- - **🏗️ Architecture Understanding**: Explore repository structures and analyze codebases with intelligent navigation
174
- - **📈 Historical Code Analysis**: Understand code evolution through commit history and PR reviews
175
- - **💡 Code Insights**: Extract insights from code patterns, repository structures, and development practices
176
-
177
- ### For Engineering Managers
178
- - **📊 Repository Health Assessment**: Assess the current status and health of repositories with comprehensive metrics
179
- - **⚖️ Technology Assessment**: Evaluate libraries, frameworks, and tools adoption with trend analysis
180
- - **🤝 Cross-Team Collaboration Analysis**: Track contributions, knowledge sharing, and code reuse patterns
181
- - **💡 Knowledge Management**: Discover internal resources, documentation, and established patterns
182
- - **📈 Competitive Analysis**: Research similar projects and industry trends with automated discovery
183
- - **🛡️ Risk & Compliance Management**: Identify security vulnerabilities, licensing issues, and maintenance gaps
184
- - **📋 Strategic Planning**: Analyze technology trends, migration patterns, and adoption metrics
185
-
186
- ## 🛠 Available Tools
187
-
188
- ### 🔍 **GitHub Code & Repository Search**
189
- - **`search_github_code`**: Find specific implementations, functions, and patterns with semantic search
190
- - **`search_github_repos`**: Progressive repository discovery with intelligent filtering
191
- - **`fetch_github_file_content`**: Extract complete working code with full context
192
- - **`view_repository_structure`**: Strategic repository exploration for code analysis
193
- - **`view_repository`**: Discover default branch information (mandatory first step)
194
-
195
- ### 📦 **NPM & Package Ecosystem**
196
- - **`npm_view`**: Transform package names into GitHub repositories for code analysis
197
- - **`npm_search`**: Search NPM registry for packages by keywords with intelligent optimization
198
- - **Package-to-Repository Mapping**: Automatic linking from NPM packages to their GitHub repositories
199
-
200
- ### 📋 **Development History & Collaboration**
201
- - **`search_github_commits`**: Advanced GitHub commits search for development history analysis
202
- - **`search_github_pull_requests`**: Code review and feature analysis with quality focus
203
- - **`search_github_issues`**: Problem discovery and solution research with pattern analysis
204
- - **`search_github_discussions`**: Community knowledge discovery for Q&A and tutorials
205
-
206
- ### 👥 **User & Organization Management**
207
- - **`search_github_users`**: Advanced developer and organization discovery
208
- - **`get_user_organizations`**: Automatic private repository discovery for enterprise environments
209
- - **`search_github_topics`**: Vital foundation tool for effective GitHub discovery
210
-
211
- ### 🎯 **Smart Features**
212
- - **Automatic Query Optimization**: Built-in search strategy optimization
213
- - **Chain-of-Thought Reasoning**: 6-step reasoning methodology for complex queries
214
- - **Teaching Methodology Integration**: AI education built into tool descriptions
215
- - **Progressive Search Refinement**: Phase-based search from broad to precise
216
- - **Cross-validation Workflows**: Multi-step research flows with tool interconnection
217
-
218
- ## 📚 Usage Examples
219
-
220
- ### Basic Code Discovery
221
- ```bash
222
- # Find React hooks implementations
223
- "Show me examples of custom React hooks for data fetching"
224
-
225
- # Explore API patterns
226
- "How do popular libraries implement rate limiting? Show code examples"
227
- ```
228
-
229
- ### Advanced Research
230
- ```bash
231
- # Deep architectural analysis
232
- "From code and PRs, how did React implement concurrent rendering?"
233
-
234
- # Cross-repository investigation
235
- "Show the langchain code examples from my organization"
236
- ```
237
-
238
- ### Learning & Documentation
239
- ```bash
240
- # Best practices discovery
241
- "Best ways from code examples to use routing in Next.js"
242
-
243
- # Documentation generation
244
- "Make docs of lodash based on actual implementation"
245
- ```
246
-
247
- ### Historical Analysis
248
- ```bash
249
- # Project evolution tracking
250
- "Show progress of React project in the recent 5 years"
251
-
252
- # Comparative analysis
253
- "How is Vue rendering architecture different than React? Check from code"
254
- ```
255
-
256
- ### Code Review & Improvement
257
- ```bash
258
- # Code analysis and suggestions
259
- "Show examples of usage of this API: import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; Look at my code and suggest how I can improve it"
260
- ```
261
-
262
- ## 💡 Tips for Effective Usage
13
+ ## What is Octocode? 🐙
263
14
 
264
- ### 🎯 **Search Strategy Tips**
265
- - **🔍 Be Specific**: Use specific library names, repository URLs, or exact function names for better results
266
- - Good: *"Show me how the `useEffect` hook works in React"*
267
- - Better: *"Show me `useEffect` cleanup patterns in facebook/react repository"*
15
+ **The perfect code assistant that can help understand anything.** Octocode was built to understand connections between repositories and NPM packages under any privilege level you have. With **AI-powered advanced search**, heuristic discovery, and smart fallbacks, it makes GitHub's vast repository of knowledge truly searchable and analyzable.
268
16
 
269
- - **🎭 Deep Analysis Requires Multiple Prompts**: Most comprehensive analysis will require more than one prompt
270
- - Start broad, then drill down into specific areas of interest
271
- - Use follow-up questions to explore different aspects
17
+ Instead of manually browsing repositories, you can ask questions like:
272
18
 
273
- ### 📚 **Documentation & Knowledge Management**
274
- - **📝 Create Documentation**: Create documentation of topics important to you and reference it from Cursor or chat sessions
275
- - *"Create a comprehensive guide about Next.js routing based on real examples"*
276
- - Then use that documentation as reference for future development
19
+ - *"How did React implement concurrent rendering?"*
20
+ - *"Show me authentication patterns in Next.js applications"*
21
+ - *"Find examples of how to use this specific API"*
22
+ - *"What's the architecture of this library?"*
23
+ - *"How do I use this MCP tool effectively?"*
277
24
 
278
- - **🔄 Iterative Learning**: Use the tool to build knowledge progressively
279
- - Session 1: "What is server-side rendering?"
280
- - Session 2: "Show me SSR implementations in Next.js"
281
- - Session 3: "Compare SSR vs SSG in production applications"
25
+ ## Recommended Use Cases
282
26
 
283
- ### **Performance & Limitations**
284
- - **🚦 Rate Limiting Awareness**: GitHub has API rate limits for file fetching
285
- - This tool has optimizations to manage rate limits efficiently
286
- - **Not designed for bulk operations** like *"show all files in my org using XYZ"*
287
- - Focus on targeted analysis rather than exhaustive scans
27
+ **Use Octocode when you need to:**
288
28
 
289
- - **🎯 Quality Over Quantity**: Better to get precise, high-quality results than overwhelming amounts of data
290
- - Use filters and specific queries to narrow down results
291
- - Combine multiple focused searches rather than one broad search
29
+ - **🔍 Understand implementations** - See how features work across different repositories
30
+ - **📚 Find real code examples** - Discover patterns and best practices from production code
31
+ - **🏗️ Analyze architecture** - Explore how systems are designed and structured
32
+ - **🔬 Research approaches** - Compare different implementation strategies
33
+ - **💡 Learn from code** - Deep-dive into technical details and understand "how does this work?"
292
34
 
293
- ### 🔗 **Cross-Repository Analysis**
294
- - **🏢 Organization Context**: Mention your organization or company for internal repository access
295
- - *"Show authentication patterns used in our team's repositories"*
296
- - The tool will automatically detect and use your organization access
35
+ ## Unique Value Proposition
297
36
 
298
- - **📦 Package-Based Discovery**: Mention specific packages to trigger automatic repository discovery
299
- - *"How does the lodash library implement debouncing?"* -> Automatically finds and analyzes lodash repository
37
+ **The most advanced AI-powered code assistant for understanding connections across the entire GitHub & NPM ecosystem.** While other GitHub MCPs focus on project management or basic operations, Octocode provides unparalleled depth for code discovery and technical research.
300
38
 
301
- ### 🎨 **Advanced Use Cases**
302
- - **🔬 Comparative Analysis**: Compare different approaches across repositories
303
- - *"How do GraphQL implementations differ between Apollo and Relay?"*
39
+ **🚀 Out-of-the-Box Advanced Search (Powered by AI):**
40
+ - **🧠 Heuristic Search** - Intelligent pattern recognition that finds relevant code even with vague queries
41
+ - **🔄 Smart Fallbacks** - Automatic retry with alternative search strategies when initial searches fail
42
+ - **🎯 Smart Discovery** - AI-guided exploration that uncovers hidden connections and patterns
43
+ - **🔗 Connection Intelligence** - Understands relationships between repositories, packages, and dependencies
44
+ - **📊 Multi-dimensional Analysis** - Combines code, commits, issues, discussions, and package data
304
45
 
305
- - **📈 Evolution Tracking**: Understand how projects evolved over time
306
- - *"Show the major architectural changes in React over the past 2 years"*
46
+ **Key Differentiators:**
47
+ - **🧠 Advanced AI Search** - Heuristic algorithms that understand code context and connections
48
+ - **🔐 Secure & Simple** - No personal access tokens needed, uses [GitHub CLI](https://cli.github.com/) authentication
49
+ - **🔗 Connected Discovery** - Maps NPM packages to repositories, traces dependencies, finds related code
50
+ - **🌐 Cross-Ecosystem Understanding** - Works across any privilege level you have (public, private, organization)
307
51
 
308
- - **🛠️ Implementation Patterns**: Find real-world usage patterns
309
- - *"Show me production examples of microservices communication patterns"*
52
+ It's the tool you reach for when you need to understand *"how does this work?"* rather than *"how do I manage this project?"*
310
53
 
311
- ### 🚀 **Pro Tips**
312
- - **🔧 Combine Tools**: Use multiple MCP tools together for comprehensive analysis
313
- - **📊 Context Building**: Build context over multiple interactions for deeper insights
314
- - **🎯 Focus Areas**: Target specific areas of interest rather than general exploration
315
- - **📱 Real Examples**: Always ask for real code examples rather than theoretical explanations
54
+ ## Quick Start 🚀
316
55
 
317
- ## 🛠 Installation & Setup
318
-
319
- ### 🚀 **Works Out Of The Box (OOTB) - Any Environment!**
320
-
321
- **Octocode MCP works instantly on any environment** - no complex setup, no configuration files, no environment variables. Just install prerequisites and configure MCP client. **That's it!**
322
-
323
- ### Step 1: Install Prerequisites
324
-
325
- #### Install Node.js (21+)
56
+ ### 1. Install Prerequisites
326
57
  ```bash
327
- # macOS with Homebrew
328
- brew install node
329
-
330
- # Or download from https://nodejs.org/
331
- # Verify installation
332
- node --version # Should be 21+
333
- ```
334
-
335
- #### Install GitHub CLI
336
- ```bash
337
- # macOS
338
- brew install gh
339
-
340
- # Windows (with Chocolatey)
341
- choco install gh
58
+ # Install Node.js 21+
59
+ brew install node # macOS
60
+ # or download from https://nodejs.org/
342
61
 
343
- # Windows (with Scoop)
344
- scoop install gh
345
-
346
- # Linux (Debian/Ubuntu)
347
- sudo apt update && sudo apt install gh
348
-
349
- # Other platforms: https://github.com/cli/cli#installation
62
+ # Install GitHub CLI
63
+ brew install gh # macOS
64
+ # or see: https://github.com/cli/cli#installation
350
65
  ```
351
66
 
352
- #### Install NPM (usually comes with Node.js)
67
+ ### 2. Authenticate
353
68
  ```bash
354
- # Verify NPM installation
355
- npm --version
356
- ```
357
-
358
- ### Step 2: Authentication Setup
359
-
360
- #### GitHub CLI Authentication
361
- ```bash
362
- # Login to GitHub (opens web browser)
69
+ # Login to GitHub (opens browser)
363
70
  gh auth login
364
71
 
365
- # Select options:
366
- # 1. GitHub.com (for public repos) or GitHub Enterprise Server
367
- # 2. HTTPS (recommended)
368
- # 3. Login with a web browser (easier and more secure)
369
-
370
- # Verify authentication
371
- gh auth status
372
- # Should show: ✓ Logged in to github.com as [your-username]
373
- ```
374
-
375
- #### NPM Authentication (for private packages)
376
- ```bash
377
- # For npm registry
72
+ # Login to NPM (for package research)
378
73
  npm login
379
-
380
- # For private registries, check your .npmrc
381
- npm config list
382
- npm whoami # Verify authentication
383
74
  ```
384
75
 
385
- ### Step 3: MCP Configuration
76
+ **🔐 GitHub Authentication via CLI:**
77
+ - ✅ **No personal access tokens needed** - Uses [GitHub CLI](https://cli.github.com/) behind the scenes
78
+ - ✅ **Secure OAuth flow** - Browser-based authentication, no tokens to store
79
+ - ✅ **Enterprise ready** - Works with SSO, 2FA, and organization access
80
+ - ✅ **Private repository access** - Automatically detects your organizations and accesses private repos
81
+ - ✅ **Zero configuration** - Uses your existing `gh` CLI permissions
386
82
 
387
- **This is the only configuration you need!** Add this to your MCP client configuration:
388
83
 
84
+ ### 3. Add to MCP Configuration
389
85
  ```json
390
86
  {
391
87
  "octocode-mcp": {
392
88
  "command": "npx",
393
- "args": [
394
- "octocode-mcp"
395
- ]
89
+ "args": ["octocode-mcp"]
396
90
  }
397
91
  }
398
92
  ```
399
93
 
400
- ### 🎉 **That's It! Ready To Use**
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**.
401
95
 
402
- **No installation needed** - `npx` will automatically download and run the latest version
403
- **No environment variables** - Uses your existing GitHub CLI authentication
404
- **No configuration files** - Works with your current permissions
405
- **No tokens to manage** - Secure authentication handled automatically
406
- **Works everywhere** - Any OS, any environment, any setup
96
+ ## Example Questions 💬
407
97
 
408
- ## 🔒 Privacy & Local Operation
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?"*
409
102
 
410
- **🏠 100% Local Execution** - Octocode MCP runs entirely on your machine. No remote servers, no cloud processing, no data transmission to third parties.
103
+ **Architecture & Patterns:**
104
+ - *"How is authentication handled in enterprise applications?"*
105
+ - *"Show me microservices communication patterns"*
106
+ - *"Find examples of event-driven architecture implementations"*
411
107
 
412
- **🚫 Zero Data Collection** - We don't collect, store, or transmit any of your data, search queries, or repository information. Everything stays on your machine.
108
+ **Organization & Private Repositories:**
109
+ - *"Show me authentication patterns used in our team's repositories"*
110
+ - *"Find internal libraries and how they're implemented in our org"*
111
+ - *"Analyze our company's coding standards and patterns"*
413
112
 
414
- **🔑 Your Credentials, Your Control** - All API calls use your existing CLI configurations:
415
- - **GitHub**: Uses your `gh` CLI authentication and permissions
416
- - **NPM**: Uses your local `.npmrc` and `npm` CLI configuration
417
- - **No Token Sharing**: Your authentication tokens never leave your machine
113
+ **Specific Code Analysis:**
114
+ - *"How does lodash implement debouncing?"*
115
+ - *"Show usage examples of this API: `createContext`"*
116
+ - *"Find React hooks patterns for data fetching"*
418
117
 
419
- **🛡️ Privacy by Design** - The tool operates as a local proxy using your own credentials, ensuring you maintain full control over what repositories and data you can access based on your existing permissions.
118
+ ## Core Features 🛠️
420
119
 
421
- ### Optional: Verify Setup
422
- ```bash
423
- # Check all components
424
- node --version # Should be 21+
425
- gh --version # Should show version
426
- gh auth status # Should show authenticated
427
- npm --version # Should show version
428
-
429
- # Test NPX execution (optional)
430
- npx octocode-mcp --help
431
- ```
120
+ ### 🧠 AI-Powered Advanced Search
121
+ - **Heuristic Pattern Recognition** - Finds relevant code even with vague or incomplete queries
122
+ - **Smart Fallback Strategies** - Automatically tries alternative approaches when searches fail
123
+ - **Context-Aware Discovery** - Understands code relationships and suggests related implementations
124
+ - **Multi-Strategy Search** - Combines semantic, syntactic, and dependency-based search methods
432
125
 
433
- ### 🌟 **Alternative Installation Options**
126
+ ### 🔗 Connection Intelligence
127
+ - **Repository-Package Mapping** - Automatically links NPM packages to their GitHub repositories
128
+ - **Dependency Tracing** - Follows dependency chains across the entire ecosystem
129
+ - **Cross-Reference Analysis** - Finds how different projects implement similar patterns
130
+ - **Ecosystem Understanding** - Maps relationships between libraries, frameworks, and tools
434
131
 
435
- #### Option A: Global Installation (if you prefer)
436
- ```bash
437
- # Install globally
438
- yarn global add octocode-mcp
439
- # or
440
- npm install -g octocode-mcp
132
+ ### 🌐 Universal Access & Discovery
133
+ - **Cross-Privilege Search** - Works with any access level you have (public, private, organization)
134
+ - **Organization-Aware** - Automatically detects and uses your GitHub organization memberships
135
+ - **Smart Repository Discovery** - Finds relevant repositories even when you don't know they exist
136
+ - **Progressive Refinement** - AI-guided search that gets more precise with each iteration
441
137
 
442
- # Then use this MCP configuration:
443
- {
444
- "octocode-mcp": {
445
- "command": "octocode-mcp"
446
- }
447
- }
448
- ```
138
+ ### 📊 Multi-Dimensional Analysis
139
+ - **Code + Context** - Combines source code with commits, issues, discussions, and documentation
140
+ - **Historical Understanding** - Tracks how implementations evolved over time
141
+ - **Community Insights** - Discovers patterns from real-world usage and discussions
142
+ - **Quality Signals** - Uses NPM publication and GitHub activity as quality indicators
449
143
 
450
- #### Option B: NPX (Recommended - Always Latest)
451
- ```bash
452
- # No installation needed - NPX handles everything
453
- # Just use the MCP configuration above! ⬆️
454
- ```
144
+ ## Privacy & Security 🛡️
455
145
 
456
- ## 🔒 Why Different Than Static PAT
146
+ - **🏠 100% Local** - Runs entirely on your machine
147
+ - **🚫 Zero Data Collection** - No telemetry, logging, or data transmission
148
+ - **🔑 No Token Management** - Uses [GitHub CLI](https://cli.github.com/) authentication, no personal access tokens needed
149
+ - **🛡️ Privacy by Design** - All API calls use your existing `gh` CLI permissions directly
457
150
 
458
- ### Traditional GitHub MCPs Challenges:
459
- ❌ **Manual PAT Management**: Create, store, rotate personal access tokens manually
460
- ❌ **Security Risks**: Tokens in config files, potential exposure
461
- ❌ **Limited Scope**: Fixed permissions, hard to manage different access levels
462
- ❌ **Expiration Issues**: Tokens expire, breaking workflows
463
- ❌ **No SSO Integration**: Doesn't work with enterprise SSO/SAML
151
+ ## Best Practices 💡
464
152
 
465
- ### Octocode MCP Approach:
466
- **Zero Configuration**: Uses existing GitHub CLI authentication
467
- **Automatic Security**: Leverages GitHub's secure OAuth flow
468
- **Dynamic Permissions**: Uses your actual GitHub permissions
469
- **SSO Compatible**: Works seamlessly with enterprise authentication
470
- **No Token Management**: GitHub CLI handles all authentication automatically
471
- ✅ **Better Security**: No tokens stored in files or transmitted
153
+ **AI-Powered Search Tips:**
154
+ - **Let AI guide you** - Start with natural language questions, the heuristic search will find relevant code
155
+ - **Trust the smart fallbacks** - If initial search doesn't work, AI automatically tries alternative strategies
156
+ - **Explore connections** - Ask about relationships between packages, libraries, and implementations
157
+ - **Use any privilege level** - Works seamlessly across public repos, private repos, and organization repositories
158
+ - **Keep research along the MCP** - Build upon previous searches and maintain context across multiple queries for deeper exploration
472
159
 
473
- ## License
474
-
475
- MIT License - See [LICENSE](./LICENSE.md) for details.
160
+ **Effective Questions:**
161
+ - **Vague is OK** - "How does authentication work?" → AI finds relevant patterns across repositories
162
+ - **Ask for connections** - "What libraries use this pattern?" → Discovers related implementations
163
+ - **Cross-ecosystem queries** - "NPM packages that implement X" → Links packages to their repositories
164
+ - **Evolution questions** - "How has this approach changed?" → Traces implementation history
476
165
 
477
- ## ⚙️ Advanced Configuration
166
+ **Advanced Search Features:**
167
+ - **Automatic fallbacks** - No need to retry failed searches, AI handles it automatically
168
+ - **Smart discovery** - Finds repositories and packages you didn't know existed
169
+ - **Connection mapping** - Understands relationships between different codebases
170
+ - **Context preservation** - Maintains search context across multiple queries
478
171
 
479
- ### Rate Limiting & Performance
480
- - **Built-in Rate Limiting**: Prevents API quota exhaustion with smart request management
481
- - **Intelligent Caching**: Result caching with configurable timeouts
482
- - **Progressive Search**: Adaptive search strategies from broad to specific
483
- - **Configurable Results**: Optimized result limits for different use cases
172
+ ## Troubleshooting 🔧
484
173
 
485
- ### Authentication Management
486
- - **Seamless GitHub CLI Integration**: Zero-configuration authentication
487
- - **NPM Registry Support**: Private package access with existing credentials
488
- - **Organization-aware Access**: Automatic detection and private repository access
489
- - **Local Execution**: All operations run locally using your existing permissions
490
-
491
- ### NPM Configuration
492
- ```bash
493
- # Check your NPM configuration
494
- npm config list
495
- npm whoami # Verify authentication for private registries
496
-
497
- # Configure for private registries if needed
498
- echo "@your-org:registry=https://npm.your-company.com/" >> ~/.npmrc
499
- ```
500
-
501
- ## 🎯 Best Practices
502
-
503
- ### Search Strategy
504
- - **Start Broad**: Begin with general terms, then narrow down based on findings
505
- - **Use Progressive Discovery**: Combine multiple tools for comprehensive understanding
506
- - **Leverage Organizations**: Use your team's GitHub org for internal discovery
507
- - **Cross-Reference Sources**: Combine code, issues, and discussions for complete context
508
-
509
- ### Performance Optimization
510
- - **Use Specific Repository Filters**: When you know the target repository
511
- - **Combine Related Searches**: In single sessions for efficiency
512
- - **Monitor API Rate Limits**: Built-in management prevents quota exhaustion
513
- - **Cache Frequently Accessed Information**: Automatic intelligent caching
514
-
515
- ### Tool Chaining Best Practices
516
- - **Start with Topics**: Use `search_github_topics` for proper terminology discovery
517
- - **Repository Discovery**: Use discovered topic names in `search_github_repos`
518
- - **Organization Context**: Let automatic detection handle private repository access
519
- - **Package Research**: Mention packages to trigger automatic NPM-to-repository mapping
520
-
521
- ## 🐛 Troubleshooting
522
-
523
- ### Authentication Issues
174
+ **Authentication Issues:**
524
175
  ```bash
525
176
  # Check GitHub CLI status
526
177
  gh auth status
527
- # Should show: ✓ Logged in to github.com as [username]
528
178
 
529
179
  # Re-authenticate if needed
530
- gh auth logout
531
- gh auth login
180
+ gh auth logout && gh auth login
532
181
 
533
- # Check NPM authentication
182
+ # Check NPM access
534
183
  npm whoami
535
184
  ```
536
185
 
537
- ### Common Issues
538
- - **No Results Found**: Try broader search terms or check organization filters
539
- - **Rate Limiting**: Built-in management should prevent this, but reduce frequency if needed
540
- - **Private Repository Access**: Ensure proper organization membership via `gh auth status`
541
- - **NPX Cache Issues**: Clear cache with `rm -rf ~/.npm/_npx` (Unix) or delete via File Explorer (Windows)
542
-
543
- ### NPM Configuration Issues
544
- ```bash
545
- # View current configuration
546
- npm config list
547
-
548
- # Check for common issues:
549
- # - Registry URL correctness
550
- # - Authentication tokens validity
551
- # - Proxy settings (if behind firewall)
552
- # - Syntax errors in .npmrc
553
-
554
- # Reset NPM configuration if needed
555
- rm ~/.npmrc
556
- npm login
557
- ```
558
-
559
- ### Misconfigured .npmrc File
560
- 1. **Locate .npmrc files**: Project-level (./), User-level (~/.npmrc), Global-level
561
- 2. **Check for common issues**: Registry URL, auth tokens, proxy settings, syntax errors
562
- 3. **View configuration**: `npm config list`
563
- 4. **Test after changes**: `yarn install` or `npm install`
186
+ **Common Solutions:**
187
+ - No results? Try broader search terms
188
+ - Private repos not found? Check organization membership with `gh auth status`
189
+ - NPX issues? Clear cache: `rm -rf ~/.npm/_npx`
564
190
 
565
- ### Development Setup
566
- ```bash
567
- # Clone repository
568
- git clone https://github.com/your-org/octocode-mcp.git
569
- cd octocode-mcp
191
+ **🏢 Organization & Private Repository Access:**
192
+ - **Automatic detection** - Octocode automatically discovers your GitHub organizations
193
+ - **No additional setup** - If you have access to private repos through your organization, they work immediately
194
+ - **Verify access** - Run `gh auth status` to see your organization memberships
570
195
 
571
- # Install dependencies
572
- yarn install
196
+ **Why GitHub CLI Authentication?**
197
+ - ✅ **No token creation** - GitHub CLI handles OAuth flow automatically
198
+ - ✅ **Enterprise compatible** - Works with SSO, SAML, and 2FA out of the box
199
+ - ✅ **Organization auto-detection** - Automatically discovers your GitHub organizations and private repo access
200
+ - ✅ **Works out of the box** - If you work for an organization, private repositories are immediately accessible
201
+ - ❌ **vs Personal Access Tokens** - No manual creation, rotation, or security risks
573
202
 
574
- # Run development server
575
- yarn build
203
+ ## Background 💭
576
204
 
577
- // Configuration local MCP
578
- // "octocode-mcp-local": {
579
- // "command": "node",
580
- // "args": [
581
- // "PATH_TO_OCTOCODE_MCP/octocode-mcp/dist/index.js"
582
- // ]
583
- // }
205
+ This project started as a personal tool while working at Wix, born from the challenge of navigating large codebases and keeping up with rapidly evolving technology landscapes. What began as a side project to solve daily development challenges evolved into **the perfect code assistant that can help understand anything**.
584
206
 
585
- ```
207
+ The goal was simple: **make code exploration as intelligent as having a senior developer guide you through any codebase.** Built specifically to understand connections between many repositories and NPM packages under any privilege the user has, with AI-powered heuristic search, smart fallbacks, and intelligent discovery.
586
208
 
587
- ## Disclaimer
588
209
 
589
- **This is a personal side project** developed to solve real-world code discovery challenges. While functional and useful, please keep in mind:
210
+ ## License 📄
590
211
 
591
- - **🚧 Work in Progress**: Some improvements and optimizations are still needed
592
- - **🎯 Intentionally Lean**: Designed to be simple and lightweight - no unnecessary overhead or complexity
593
- - **🔬 Experimental**: As with any side project, expect occasional rough edges and areas for improvement
212
+ MIT License - See [LICENSE](./LICENSE.md) for details.
594
213
 
595
214
  ---
596
215
 
597
216
 
598
217
 
599
-