octocode-mcp 2.3.13 → 2.3.15

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
@@ -8,11 +8,14 @@
8
8
  [![Version](https://img.shields.io/badge/version-2.3.2-blue.svg)](./package.json)
9
9
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](./package.json)
10
10
  [![MCP](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io/)
11
- [![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-☕-orange.svg)](https://buymeacoffee.com/bgauryy)
12
11
  </div>
13
12
 
13
+
14
+
14
15
  ## What is Octocode? 🐙
15
16
 
17
+ **For more details, visit [octocode.ai](https://octocode.ai)**
18
+
16
19
  **The perfect code assistant that can help understand anything.** Octocode provides AI-powered advanced search with heuristic discovery and smart fallbacks to understand connections between repositories and NPM packages across any privilege level you have.
17
20
 
18
21
  Instead of manually browsing repositories, ask questions like:
@@ -73,6 +76,61 @@ npm login
73
76
 
74
77
  **That's it!** Octocode automatically works with your organization's private repositories.
75
78
 
79
+ ## DXT Extension 📦
80
+
81
+ This project is available as a **Desktop Extension (DXT)** for easy installation in AI applications like Claude Desktop.
82
+
83
+ ### For Developers
84
+
85
+ **Building the DXT Package:**
86
+
87
+ ```bash
88
+ # Install dependencies
89
+ yarn install
90
+
91
+ # Build the DXT package
92
+ yarn dxt:pack
93
+
94
+ # Validate the manifest
95
+ yarn dxt:validate
96
+
97
+ # View package information
98
+ yarn dxt:info
99
+
100
+ # Sign the package (optional)
101
+ yarn dxt:sign
102
+ ```
103
+
104
+ **DXT Scripts:**
105
+ - `yarn dxt:validate` - Validate the manifest.json file
106
+ - `yarn dxt:pack` - Build and package the extension as a .dxt file
107
+ - `yarn dxt:info` - Show information about the packaged extension
108
+ - `yarn dxt:sign` - Sign the package with a self-signed certificate
109
+ - `yarn dxt:verify` - Verify the signature of a signed package
110
+
111
+ **The DXT package includes:**
112
+ - Compiled MCP server (`dist/index.js`)
113
+ - Extension manifest (`manifest.json`)
114
+ - Package metadata (`package.json`)
115
+ - Logo and assets (`assets/logo.png`)
116
+ - Documentation (`README.md`)
117
+
118
+ **Building DXT from Source:**
119
+ To build the DXT package locally from this repository:
120
+ ```bash
121
+ # Clone the repository
122
+ git clone https://github.com/bgauryy/octocode-mcp.git
123
+ cd octocode-mcp
124
+
125
+ # Install dependencies and build
126
+ yarn install
127
+ yarn build
128
+ yarn dxt:pack
129
+ ```
130
+
131
+ The generated `octocode-mcp.dxt` file can then be installed in Claude Desktop (just click on it and it will open claude desktop with the extension)
132
+
133
+
76
134
  ## How It Works 🔄
77
135
 
78
136
  **Smart Discovery Flow:**
@@ -189,4 +247,4 @@ The goal: **make code exploration as intelligent as having a senior developer gu
189
247
 
190
248
  MIT License - See [LICENSE](./LICENSE.md) for details.
191
249
 
192
- ---
250
+ ---
Binary file
Binary file
Binary file
Binary file
@@ -112297,14 +112297,19 @@ async function suggestCodeSearchFallback(owner, filePath) {
112297
112297
  const GITHUB_SEARCH_REPOSITORIES_TOOL_NAME = 'githubSearchRepositories';
112298
112298
  const DESCRIPTION$6 = `Search GitHub repositories using gh search repos CLI.
112299
112299
 
112300
+ THREE SEARCH APPROACHES:
112301
+ - exactQuery: Single exact phrase/word search
112302
+ - queryTerms: Multiple search terms (broader coverage)
112303
+ - topic: Find repositories by technology/subject
112304
+
112300
112305
  BEST PRACTICES:
112301
- - Use topic for discovering repositories by technology/purpose
112302
- - Use query for searching by repository name
112303
- - Use owner to explore specific organizations
112304
- - Use language to filter by programming language
112305
- - Use quality filters (stars, forks) for refinement
112306
+ - Use exactQuery for specific repository names
112307
+ - Use queryTerms with minimal words for broader results
112308
+ - Use topic for technology/subject discovery
112309
+ - Use owner for organization exploration
112310
+ - Use filters (language, stars, forks) for refinement
112306
112311
 
112307
- Separate searches for different topics and use minimal filters to get the most relevant results`;
112312
+ Multiple focused searches work better than complex single queries.`;
112308
112313
  /**
112309
112314
  * Extract owner/repo information from various query formats
112310
112315
  */
@@ -112339,10 +112344,14 @@ function registerSearchGitHubReposTool(server) {
112339
112344
  server.registerTool(GITHUB_SEARCH_REPOSITORIES_TOOL_NAME, {
112340
112345
  description: DESCRIPTION$6,
112341
112346
  inputSchema: {
112342
- query: z
112347
+ exactQuery: z
112343
112348
  .string()
112344
112349
  .optional()
112345
- .describe('Search by repository name. Use minimal words for repository names or specific projects. For topic discovery, use topic parameter instead.'),
112350
+ .describe('Single exact phrase/word search'),
112351
+ queryTerms: z
112352
+ .array(z.string())
112353
+ .optional()
112354
+ .describe('Multiple search terms for broader coverage'),
112346
112355
  // CORE FILTERS (GitHub CLI flags)
112347
112356
  owner: z
112348
112357
  .union([z.string(), z.array(z.string())])
@@ -112364,7 +112373,7 @@ function registerSearchGitHubReposTool(server) {
112364
112373
  topic: z
112365
112374
  .union([z.string(), z.array(z.string())])
112366
112375
  .optional()
112367
- .describe('Discover repositories by topic. Use for exploring unknown domains and finding projects by technology or purpose.'),
112376
+ .describe('Find repositories by technology/subject'),
112368
112377
  forks: z
112369
112378
  .union([
112370
112379
  z.number().int().min(0),
@@ -112487,15 +112496,29 @@ function registerSearchGitHubReposTool(server) {
112487
112496
  openWorldHint: true,
112488
112497
  },
112489
112498
  }, async (args) => {
112499
+ // Validate that exactly one search parameter is provided (not both)
112500
+ const hasExactQuery = !!args.exactQuery;
112501
+ const hasQueryTerms = args.queryTerms && args.queryTerms.length > 0;
112502
+ if (hasExactQuery && hasQueryTerms) {
112503
+ return createResult({
112504
+ error: 'Use either exactQuery OR queryTerms, not both. Choose one search approach.',
112505
+ });
112506
+ }
112490
112507
  try {
112491
112508
  // Extract owner/repo from query if present
112492
- const queryInfo = args.query
112493
- ? extractOwnerRepoFromQuery(args.query)
112494
- : {
112495
- cleanedQuery: '',
112496
- extractedOwner: undefined,
112497
- extractedRepo: undefined,
112498
- };
112509
+ const queryInfo = args.exactQuery
112510
+ ? extractOwnerRepoFromQuery(args.exactQuery)
112511
+ : args.queryTerms
112512
+ ? {
112513
+ cleanedQuery: args.queryTerms.join(' '),
112514
+ extractedOwner: undefined,
112515
+ extractedRepo: undefined,
112516
+ }
112517
+ : {
112518
+ cleanedQuery: '',
112519
+ extractedOwner: undefined,
112520
+ extractedRepo: undefined,
112521
+ };
112499
112522
  // Merge extracted owner with explicit owner parameter
112500
112523
  let finalOwner = args.owner;
112501
112524
  if (queryInfo.extractedOwner && !finalOwner) {
@@ -112504,11 +112527,13 @@ function registerSearchGitHubReposTool(server) {
112504
112527
  // Update parameters with extracted information
112505
112528
  const enhancedArgs = {
112506
112529
  ...args,
112507
- query: queryInfo.cleanedQuery || args.query,
112530
+ exactQuery: args.exactQuery ? queryInfo.cleanedQuery : undefined,
112531
+ queryTerms: args.queryTerms,
112508
112532
  owner: finalOwner,
112509
112533
  };
112510
112534
  // Enhanced validation logic for primary filters
112511
- const hasPrimaryFilter = enhancedArgs.query?.trim() ||
112535
+ const hasPrimaryFilter = enhancedArgs.exactQuery?.trim() ||
112536
+ (enhancedArgs.queryTerms && enhancedArgs.queryTerms.length > 0) ||
112512
112537
  enhancedArgs.owner ||
112513
112538
  enhancedArgs.language ||
112514
112539
  enhancedArgs.topic ||
@@ -112516,11 +112541,14 @@ function registerSearchGitHubReposTool(server) {
112516
112541
  enhancedArgs.forks;
112517
112542
  if (!hasPrimaryFilter) {
112518
112543
  return createResult({
112519
- error: `Repository search requires at least one filter. Try these patterns:
112520
- • Topic exploration: { topic: ["react", "typescript"] }
112521
- Organization search: { owner: "microsoft", visibility: "public" }
112522
- Language + quality: { language: "go", "good-first-issues": ">=10" }
112523
- Simple query: { query: "cli shell" }`,
112544
+ error: `Repository search requires at least one filter. Try:
112545
+ • Topic search: { topic: "react" }
112546
+ Exact search: { exactQuery: "cli shell" }
112547
+ Multiple terms: { queryTerms: ["react", "hooks"] }
112548
+ Organization: { owner: "microsoft" }
112549
+ • Language filter: { language: "go" }
112550
+
112551
+ Alternative: Use npm search for package discovery.`,
112524
112552
  });
112525
112553
  }
112526
112554
  // First attempt: Search with current parameters
@@ -112530,19 +112558,21 @@ function registerSearchGitHubReposTool(server) {
112530
112558
  // Smart fallbacks based on error type
112531
112559
  if (errorMsg.includes('rate limit')) {
112532
112560
  return createResult({
112533
- error: `GitHub API rate limit. Smart alternatives:
112534
- Try npm package search for package discovery
112535
- Use broader filters (remove stars/forks constraints)
112536
- • Search fewer organizations at once
112561
+ error: `GitHub API rate limit exceeded. Alternatives:
112562
+ Use npm search for package discovery
112563
+ Remove quality filters (stars/forks)
112564
+ • Search fewer organizations
112537
112565
  • Wait 5-10 minutes and retry`,
112538
112566
  });
112539
112567
  }
112540
112568
  if (errorMsg.includes('authentication')) {
112541
112569
  return createResult({
112542
- error: `Authentication required. Quick fix:
112543
- 1. Run: gh auth login
112544
- 2. For private repos: use api_status_check to verify access
112545
- 3. Public repos should work without auth - check query`,
112570
+ error: `Authentication required:
112571
+ Run: gh auth login
112572
+ For private repos: use api_status_check tool
112573
+ Public repos work without auth
112574
+
112575
+ Alternative: Use npm search for packages.`,
112546
112576
  });
112547
112577
  }
112548
112578
  return result; // Return original error for other cases
@@ -112552,31 +112582,26 @@ function registerSearchGitHubReposTool(server) {
112552
112582
  const hasResults = resultData.total_count > 0;
112553
112583
  // Smart fallback strategies for no results
112554
112584
  if (!hasResults) {
112555
- const fallbackSuggestions = [];
112556
- if (enhancedArgs.query) {
112557
- fallbackSuggestions.push('• Try broader search terms or remove query filter');
112585
+ const suggestions = [];
112586
+ if (enhancedArgs.exactQuery) {
112587
+ suggestions.push('• Try broader search terms');
112558
112588
  }
112559
112589
  if (enhancedArgs.language) {
112560
- fallbackSuggestions.push('• Remove language filter for broader discovery');
112590
+ suggestions.push('• Remove language filter');
112561
112591
  }
112562
112592
  if (enhancedArgs.stars || enhancedArgs.forks) {
112563
- fallbackSuggestions.push('• Lower quality thresholds (stars/forks)');
112593
+ suggestions.push('• Lower quality thresholds');
112564
112594
  }
112565
112595
  if (!enhancedArgs.topic) {
112566
- fallbackSuggestions.push('• 🎯 Try topic exploration: { topic: ["web", "api"] }');
112596
+ suggestions.push('• Try topic search: { topic: "react" }');
112567
112597
  }
112568
112598
  if (enhancedArgs.owner) {
112569
- fallbackSuggestions.push('• Search without owner filter for global discovery');
112570
- fallbackSuggestions.push('• Use npm package search if looking for packages');
112599
+ suggestions.push('• Remove owner filter for global search');
112571
112600
  }
112601
+ suggestions.push('• Use npm search for package discovery');
112572
112602
  return createResult({
112573
- error: `No repositories found. Try these alternatives:
112574
- ${fallbackSuggestions.join('\n')}
112575
-
112576
- Quick discovery patterns:
112577
- • 🎯 Topic exploration: { topic: ["react"] }
112578
- • Organization search: { owner: "microsoft" }
112579
- • Quality filter: { stars: ">100", language: "python" }`,
112603
+ error: `No repositories found. Try:
112604
+ ${suggestions.join('\n')}`,
112580
112605
  });
112581
112606
  }
112582
112607
  // Fallback for private repositories: If no results and owner is specified, try with private visibility
@@ -112706,13 +112731,19 @@ async function searchGitHubRepos(params) {
112706
112731
  });
112707
112732
  }
112708
112733
  function buildGitHubReposSearchCommand(params) {
112709
- const query = params.query?.trim() || '';
112710
112734
  const args = ['repos'];
112711
- const hasEmbeddedQualifiers = query &&
112712
- /\b(stars|language|org|repo|topic|user|created|updated|size|license|archived|fork|good-first-issues|help-wanted-issues):/i.test(query);
112713
- if (query) {
112714
- args.push(query);
112735
+ let queryForQualifierCheck = '';
112736
+ if (params.exactQuery) {
112737
+ args.push(params.exactQuery.trim());
112738
+ queryForQualifierCheck = params.exactQuery.trim();
112739
+ }
112740
+ else if (params.queryTerms && params.queryTerms.length > 0) {
112741
+ // Add each term as separate argument for AND logic
112742
+ params.queryTerms.forEach(term => args.push(term.trim()));
112743
+ queryForQualifierCheck = params.queryTerms.join(' ');
112715
112744
  }
112745
+ const hasEmbeddedQualifiers = queryForQualifierCheck &&
112746
+ /\b(stars|language|org|repo|topic|user|created|updated|size|license|archived|fork|good-first-issues|help-wanted-issues):/i.test(queryForQualifierCheck);
112716
112747
  args.push('--json=name,fullName,description,language,stargazersCount,forksCount,updatedAt,createdAt,url,owner,isPrivate,license,hasIssues,openIssuesCount,isArchived,isFork,visibility');
112717
112748
  const addArg = (paramName, cliFlag, condition = true, formatter) => {
112718
112749
  const value = params[paramName];
package/manifest.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "dxt_version": "0.1",
3
+ "name": "octocode-mcp",
4
+ "display_name": "Octocode MCP Extension",
5
+ "version": "1.0.0",
6
+ "description": "GitHub code search and npm package exploration MCP server",
7
+ "long_description": "A comprehensive MCP server that provides GitHub code search, repository exploration, commit history, pull requests, issues, and npm package search capabilities. This extension enables AI assistants to efficiently search and analyze code across GitHub repositories and npm packages with advanced filtering and content retrieval features.",
8
+ "author": {
9
+ "name": "Octocode Team",
10
+ "email": "support@octocode.dev",
11
+ "url": "https://github.com/octocode-dev"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/guybary/octocode-mcp"
16
+ },
17
+ "homepage": "https://github.com/guybary/octocode-mcp",
18
+ "documentation": "https://github.com/guybary/octocode-mcp#readme",
19
+ "support": "https://github.com/guybary/octocode-mcp/issues",
20
+ "icon": "assets/logo.png",
21
+ "server": {
22
+ "type": "node",
23
+ "entry_point": "dist/index.js",
24
+ "mcp_config": {
25
+ "command": "node",
26
+ "args": ["${__dirname}/dist/index.js"],
27
+ "env": {
28
+ "NODE_ENV": "production"
29
+ }
30
+ }
31
+ },
32
+ "tools": [
33
+ {
34
+ "name": "mcp_octocode_apiStatusCheck",
35
+ "description": "Check GitHub and npm login status"
36
+ },
37
+ {
38
+ "name": "mcp_octocode_githubSearchCode",
39
+ "description": "Search code across GitHub repositories"
40
+ },
41
+ {
42
+ "name": "mcp_octocode_githubGetFileContent",
43
+ "description": "Fetch file content from GitHub repositories"
44
+ },
45
+ {
46
+ "name": "mcp_octocode_githubSearchRepositories",
47
+ "description": "Search GitHub repositories"
48
+ },
49
+ {
50
+ "name": "mcp_octocode_githubSearchCommits",
51
+ "description": "Search commit history across GitHub repositories"
52
+ },
53
+ {
54
+ "name": "mcp_octocode_githubSearchPullRequests",
55
+ "description": "Search GitHub pull requests"
56
+ },
57
+ {
58
+ "name": "mcp_octocode_githubSearchIssues",
59
+ "description": "Search GitHub issues"
60
+ },
61
+ {
62
+ "name": "mcp_octocode_githubViewRepoStructure",
63
+ "description": "View GitHub repository structure"
64
+ },
65
+ {
66
+ "name": "mcp_octocode_npmPackageSearch",
67
+ "description": "Search npm packages"
68
+ },
69
+ {
70
+ "name": "mcp_octocode_npmViewPackage",
71
+ "description": "View npm package information"
72
+ }
73
+ ],
74
+ "keywords": [
75
+ "github",
76
+ "npm",
77
+ "code-search",
78
+ "repository",
79
+ "package-manager",
80
+ "development",
81
+ "api",
82
+ "search",
83
+ "mcp",
84
+ "octocode"
85
+ ],
86
+ "license": "MIT",
87
+ "compatibility": {
88
+ "claude_desktop": ">=0.10.0",
89
+ "platforms": ["darwin", "win32", "linux"],
90
+ "runtimes": {
91
+ "node": ">=18.0.0"
92
+ }
93
+ },
94
+ "user_config": {
95
+ "github_token": {
96
+ "type": "string",
97
+ "title": "GitHub Token",
98
+ "description": "Personal access token for GitHub API (optional, increases rate limits)",
99
+ "sensitive": true,
100
+ "required": false
101
+ },
102
+ "npm_registry": {
103
+ "type": "string",
104
+ "title": "NPM Registry",
105
+ "description": "NPM registry URL",
106
+ "default": "https://registry.npmjs.org",
107
+ "required": false
108
+ }
109
+ }
110
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octocode-mcp",
3
- "version": "2.3.13",
3
+ "version": "2.3.15",
4
4
  "description": "Model Context Protocol (MCP) server for advanced GitHub repository analysis, code discovery, and npm package exploration. Provides AI assistants with powerful tools to search, analyze, and understand codebases across GitHub and npm ecosystems.",
5
5
  "author": "Guy Bary <guybary@gmail.com>",
6
6
  "homepage": "https://octocode.ai",
@@ -14,10 +14,10 @@
14
14
  "engines": {
15
15
  "node": ">=18.12.0"
16
16
  },
17
- "main": "build/index.js",
17
+ "main": "dist/index.js",
18
18
  "license": "MIT",
19
19
  "type": "module",
20
- "bin": "./build/index.js",
20
+ "bin": "./dist/index.js",
21
21
  "scripts": {
22
22
  "build": "yarn lint && rollup -c",
23
23
  "build:watch": "rollup -c --watch",
@@ -26,14 +26,23 @@
26
26
  "test:watch": "vitest --watch",
27
27
  "test:coverage": "vitest run --coverage",
28
28
  "test:ui": "vitest --ui",
29
- "debug": "npx @modelcontextprotocol/inspector node build/index.js",
29
+ "debug": "npx @modelcontextprotocol/inspector node dist/index.js",
30
30
  "lint": "eslint src/**/*.ts tests/**/*.ts",
31
31
  "lint:fix": "eslint src/**/*.ts tests/**/*.ts --fix",
32
32
  "format": "prettier --write \"src/**/*.{ts,js,json}\"",
33
- "format:check": "prettier --check \"src/**/*.{ts,js,json}\""
33
+ "format:check": "prettier --check \"src/**/*.{ts,js,json}\"",
34
+ "dxt:validate": "dxt validate manifest.json",
35
+ "dxt:pack": "yarn build && dxt pack . octocode-mcp.dxt",
36
+ "dxt:pack:dev": "yarn build && dxt pack . octocode-mcp-dev.dxt",
37
+ "dxt:info": "dxt info octocode-mcp.dxt",
38
+ "dxt:sign": "dxt sign octocode-mcp.dxt --self-signed",
39
+ "dxt:verify": "dxt verify octocode-mcp.dxt",
40
+ "release:dxt": "yarn build && dxt pack . octocode-mcp.dxt && dxt sign octocode-mcp.dxt --self-signed"
34
41
  },
35
42
  "files": [
36
- "build"
43
+ "dist",
44
+ "manifest.json",
45
+ "assets"
37
46
  ],
38
47
  "dependencies": {
39
48
  "@babel/core": "^7.28.0",
@@ -47,6 +56,7 @@
47
56
  "zod": "^3.25.26"
48
57
  },
49
58
  "devDependencies": {
59
+ "@anthropic-ai/dxt": "^0.2.1",
50
60
  "@rollup/plugin-commonjs": "^28.0.3",
51
61
  "@rollup/plugin-json": "^6.1.0",
52
62
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -87,6 +97,8 @@
87
97
  "semantic-search",
88
98
  "typescript",
89
99
  "nodejs",
90
- "cli-tool"
100
+ "cli-tool",
101
+ "dxt",
102
+ "desktop-extension"
91
103
  ]
92
104
  }