octocode-mcp 1.0.0

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Guy Bary (bgauryy@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,259 @@
1
+ # Octocode MCP
2
+
3
+ **Octocode MCP** is a robust Model Context Protocol (MCP) server designed for comprehensive code discovery and analysis across various platforms. It offers advanced search functionalities, enabling efficient exploration of both internal/public codebases and the expansive GitHub ecosystem using NPM capabilities for more insights.
4
+
5
+ <div >
6
+ <img src="./assets/logo.png" width="500" height="700">
7
+
8
+ [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](./package.json)
9
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](./package.json)
10
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io/)
11
+ </div>
12
+
13
+ ## Features
14
+
15
+ ### For Developers
16
+ - **Code Discovery**: Find implementations, patterns, and examples across repositories
17
+ - **Cross-Repository Investigation**: Trace code patterns, dependencies, and implementations across multiple repositories
18
+ - **Dependency Analysis**: Understand package relationships and find alternative libraries
19
+ - **Deep Dependency Insights**: Map transitive dependencies, version conflicts, and security vulnerabilities
20
+ - **Bug Investigation**: Track issues, commits, and pull requests related to specific problems
21
+ - **Advanced Bug Hunting**: Correlate bugs across repositories, find recurring patterns, and trace root causes
22
+ - **Learning & Reference**: Access community discussions, documentation, and best practices
23
+ - **Architecture Understanding**: Explore repository structures and analyze codebases
24
+ - **Historical Code Analysis**: Understand code evolution through commit history and PR reviews
25
+
26
+ ### For Engineering Managers
27
+ - **Repository Status Evaluation**: Assess the current status and health of repositories
28
+ - **Technology Assessment**: Evaluate libraries, frameworks, and tools adoption
29
+ - **Cross-Team Collaboration Analysis**: Track contributions, knowledge sharing, and code reuse patterns
30
+ - **Knowledge Management**: Discover internal resources, documentation, and established patterns
31
+ - **Competitive Analysis**: Research similar projects and industry trends
32
+ - **Risk & Compliance Management**: Identify security vulnerabilities, licensing issues, and maintenance gaps
33
+ - **Strategic Planning**: Analyze technology trends, migration patterns, and adoption metrics
34
+
35
+ ## What it Does
36
+
37
+ ### 🔍 **Comprehensive Code Discovery & Analysis**
38
+ - **GitHub Code Search**: Find specific implementations, functions, and patterns across repositories
39
+ - **Repository Exploration**: Navigate project structures, fetch complete source files, and understand architectures
40
+ - **Cross-Repository Investigation**: Trace code patterns, dependencies, and implementations across multiple repositories
41
+ - **Branch Intelligence**: Automatic branch detection (main/master/develop/trunk) with fallback mechanisms
42
+
43
+ ### 📦 **NPM & Package Ecosystem**
44
+ - **NPM Package Analysis**: Get detailed package information, dependencies, and metadata
45
+ - **NPM Registry Search**: Discover packages by functionality and keywords
46
+ - **Package-to-Repository Mapping**: Automatic linking from NPM packages to their GitHub repositories
47
+ - **Dependency Graph Analysis**: Understand package relationships and find alternatives
48
+
49
+ ### 🔎 **GitHub Ecosystem Search**
50
+ - **Repository Discovery**: Find relevant projects by keywords, language, topics, stars, and activity
51
+ - **Development History**: Track code evolution through commits, pull requests, and releases
52
+ - **Issue & Bug Tracking**: Discover bugs, feature requests, and community-driven solutions
53
+ - **Pull Request Analysis**: Review implementation approaches, code quality, and merge patterns
54
+
55
+ ### 👥 **Community & Collaboration**
56
+ - **GitHub Discussions**: Access Q&A, tutorials, and community wisdom
57
+ - **User & Organization Discovery**: Find experts, contributors, and active developers
58
+ - **Team Collaboration Analysis**: Track contributions, knowledge sharing, and code reuse patterns
59
+ - **Organization Intelligence**: Automatic detection and access to private repositories
60
+
61
+ ### 🏷️ **Technology & Topic Exploration**
62
+ - **Topic Discovery**: Explore trending technologies and ecosystems with community validation
63
+ - **Technology Assessment**: Evaluate libraries, frameworks, and tools adoption
64
+ - **Featured Content**: Access GitHub-curated and community-maintained topics
65
+
66
+ ### 🔐 **Security & Access Management**
67
+ - **Secure Authentication**: Integrated GitHub CLI and NPM authentication
68
+ - **Private Repository Access**: Organization-aware access control for enterprise environments
69
+ - **Local Execution**: All operations run locally using your existing permissions
70
+ - **No Data Sharing**: Ensures privacy and security of your code and credentials
71
+
72
+ ### ⚡ **Performance & Intelligence**
73
+ - **Built-in Caching**: Intelligent result caching with configurable timeouts
74
+ - **Rate Limiting**: Prevents API quota exhaustion with smart request management
75
+ - **Progressive Search**: Adaptive search strategies from broad to specific
76
+ - **Configurable Results**: Optimized result limits for different use cases
77
+
78
+ ### 🐞 **Advanced Bug Analysis**
79
+ - **Multi-Repository Bug Understanding**: Correlate issues across related repositories
80
+ - **Historical Bug Analysis**: Track bug patterns and resolution strategies
81
+ - **Security Vulnerability Tracking**: Identify and analyze security-related issues
82
+ - **Root Cause Analysis**: Trace bugs through commit history and discussions
83
+
84
+ ### 🌐 **Remote Code Analysis**
85
+ - **Cross-Platform Analysis**: Analyze code from any accessible repository
86
+ - **Architecture Understanding**: Explore and document system architectures
87
+ - **Code Quality Assessment**: Evaluate code patterns and implementation quality
88
+ - **Documentation Generation**: Create comprehensive documentation from any source
89
+
90
+ ### 📊 **Enterprise & Management Features**
91
+ - **Repository Health Assessment**: Evaluate maintenance status and activity levels
92
+ - **Compliance & Licensing**: Audit licenses and compliance across repositories
93
+ - **Developer Productivity Insights**: Analyze contribution patterns and team efficiency
94
+ - **Strategic Technology Planning**: Research adoption trends and migration patterns
95
+
96
+ ## How It Works
97
+
98
+ This tool utilizes the `gh` CLI along with the `yarn` CLI and strong prompts to collect information based on the user's permissions. All operations are executed locally, ensuring that no data is shared externally with the tool. This method takes advantage of the user's existing access rights and configurations to deliver insights and analysis without compromising security or privacy.
99
+
100
+ ## Table of Contents
101
+
102
+ - [Installation & Setup](#installation--setup)
103
+ - [Authentication](#authentication)
104
+ - [Features](#features)
105
+ - [Available Tools](#available-tools)
106
+ - [Usage Examples](#usage-examples)
107
+ - [Advanced Configuration](#advanced-configuration)
108
+ - [Best Practices](#best-practices)
109
+ - [Troubleshooting](#troubleshooting)
110
+ - [Contributing](#contributing)
111
+ - [License](#license)
112
+
113
+ ## Installation & Setup
114
+
115
+ ### Prerequisites
116
+
117
+ #### Required Software
118
+ - **Node.js**: Version 21 or higher
119
+ - **GitHub CLI**: For GitHub authentication and API access
120
+ - **NPM**: For package management and analysis
121
+
122
+
123
+ #### Install GitHub CLI & Login
124
+
125
+ ```bash
126
+ # macOS
127
+ brew install gh
128
+ gh auth login
129
+
130
+ # Other platforms: https://github.com/cli/cli#installation
131
+ # Open authentication in web browser and complete login flow
132
+ ```
133
+
134
+ #### Verify setup
135
+ ```bash
136
+ # Check versions
137
+ node --version # Should be 21+
138
+ gh --version
139
+ gh auth status # Should show authenticated
140
+ ```
141
+
142
+ #### Configure MCP Client:
143
+
144
+ ```json
145
+ {
146
+ "name": "octocode-mcp",
147
+ "command": "npx",
148
+ "args": ["octocode-mcp"]
149
+ }
150
+ ```
151
+
152
+ ### NPM Configuration
153
+ Ensure your `.npmrc` files are properly configured
154
+ ```bash
155
+ # Check NPM configuration
156
+ npm config list
157
+ npm whoami # Verify authentication for private registries
158
+ ```
159
+
160
+ ## Available Tools
161
+
162
+ ### Code & Repository Search
163
+ - **Search GitHub Code**: Find specific implementations, functions, and patterns
164
+ - **Repository Discovery**: Locate relevant projects and libraries by keywords
165
+ - **File Content Analysis**: Fetch complete source files with dependency tracking
166
+ - **Repository Structure**: Explore project organization and architecture
167
+
168
+ ### Package & Dependency Management
169
+ - **NPM Package Analysis**: Get detailed package information and metadata
170
+ - **NPM Registry Search**: Discover packages by functionality and keywords
171
+ - **Dependency Mapping**: Understand package relationships and alternatives
172
+
173
+ ### Development History & Collaboration
174
+ - **Commit History**: Track code evolution and find specific changes
175
+ - **Pull Request Analysis**: Review implementation approaches and code quality
176
+ - **Issue Tracking**: Find bugs, feature requests, and community discussions
177
+ - **User & Organization Discovery**: Identify experts and active contributors
178
+
179
+ ### Community & Knowledge
180
+ - **GitHub Discussions**: Access Q&A, tutorials, and community wisdom
181
+ - **Topic Exploration**: Discover trending technologies and ecosystems
182
+ - **Documentation Access**: Find READMEs, guides, and best practices
183
+
184
+ ## Advanced Configuration
185
+
186
+ ### Rate Limiting & Performance
187
+ - Built-in rate limiting prevents API quota exhaustion
188
+ - Configurable result limits for optimal performance
189
+ - Intelligent caching reduces redundant requests
190
+
191
+ ### Authentication Management
192
+ - Seamless GitHub CLI integration
193
+ - NPM registry authentication support
194
+ - Organization-aware access control
195
+
196
+ ## Best Practices
197
+
198
+ ### Search Strategy
199
+ - **Start Broad**: Begin with general terms, then narrow down
200
+ - **Use Progressive Discovery**: Combine multiple tools for comprehensive understanding
201
+ - **Leverage Organizations**: Use your team's GitHub org for internal discovery
202
+ - **Cross-Reference Sources**: Combine code, issues, and discussions for complete context
203
+
204
+ ### Performance Optimization
205
+ - Use specific repository filters when possible
206
+ - Combine related searches in single sessions
207
+ - Cache frequently accessed information
208
+ - Monitor API rate limits
209
+
210
+ ## Troubleshooting
211
+
212
+ ### Common Issues
213
+ - **Authentication Errors**: Verify `gh auth status` and NPM login
214
+ - **No Results**: Try broader search terms or different organizations
215
+ - **Rate Limiting**: Reduce search frequency or use more specific filters
216
+ - **Private Repository Access**: Ensure proper organization membership
217
+ - **NPX cache**: To reset the npx cache, you can manually delete the cache directory. The location of the npx cache can vary based on your operating system. Typically, it is located in the `.npm/_npx` directory within your home folder. You can remove this directory using a command like `rm -rf ~/.npm/_npx` on Unix-based systems or by deleting it through File Explorer on Windows.
218
+ ### Misconfigured .npmrc File
219
+
220
+ A misconfigured `.npmrc` file can lead to various issues, such as authentication errors, incorrect registry settings, or unexpected behavior during package installations. Here's how you can check and troubleshoot your `.npmrc` file:
221
+
222
+ 1. **Locate the .npmrc File**:
223
+ - The `.npmrc` file can exist in multiple locations, affecting different scopes:
224
+ - **Project-level**: Located in the root of your project directory.
225
+ - **User-level**: Located in your home directory (`~/.npmrc`).
226
+ - **Global-level**: Located in the global npm configuration directory.
227
+
228
+ 2. **Check for Common Issues**:
229
+ - **Registry URL**: Ensure the registry URL is correct. For example, it should be `https://registry.yarnpkg.com/` if using Yarn.
230
+ - **Authentication Tokens**: Verify that authentication tokens are correctly set and not expired.
231
+ - **Proxy Settings**: If you're behind a proxy, ensure proxy settings are correctly configured.
232
+ - **Syntax Errors**: Check for any syntax errors or invalid entries.
233
+
234
+ 3. **View Current Configuration**:
235
+ - Use the following command to view the current npm configuration, including settings from all `.npmrc` files:
236
+ ```bash
237
+ npm config list
238
+ ```
239
+
240
+ 4. **Edit the .npmrc File**:
241
+ - Open the `.npmrc` file in a text editor to make necessary corrections. Ensure that sensitive information, like tokens, is not exposed in version control.
242
+
243
+ 5. **Test Configuration**:
244
+ - After making changes, test the configuration by running a simple npm command, such as:
245
+ ```bash
246
+ yarn install
247
+ ```
248
+ - Ensure that the command executes without errors.
249
+
250
+ By following these steps, you can identify and resolve issues related to a misconfigured `.npmrc` file, ensuring smooth package management operations.
251
+
252
+ ### Prefered models
253
+
254
+ ## License
255
+
256
+ MIT License - See [LICENSE](./LICENSE) for details.
257
+
258
+
259
+