octocode-mcp 7.0.12-alpha.2 → 7.0.12-alpha.3
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/dist/index.js +3 -3
- package/dist/src/index.d.ts +1 -1
- package/dist/src/prompts/kudos.d.ts +2 -1
- package/dist/src/prompts/prompts.d.ts +2 -1
- package/dist/src/prompts/research.d.ts +2 -1
- package/dist/src/prompts/use.d.ts +2 -1
- package/dist/src/tools/toolMetadata.d.ts +28 -14
- package/dist/src/types.d.ts +0 -7
- package/dist/src/utils/exec.d.ts +0 -5
- package/dist/src/utils/fetchWithRetries.d.ts +47 -0
- package/dist/tests/utils/fetchWithRetries.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
export declare function registerAllTools(server: McpServer): Promise<void>;
|
|
2
|
+
export declare function registerAllTools(server: McpServer, _content: import('./tools/toolMetadata.js').CompleteMetadata): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { CompleteMetadata } from '../tools/toolMetadata.js';
|
|
2
3
|
export declare const PROMPT_NAME = "kudos";
|
|
3
|
-
export declare function registerKudosPrompt(server: McpServer): void;
|
|
4
|
+
export declare function registerKudosPrompt(server: McpServer, content: CompleteMetadata): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { CompleteMetadata } from '../tools/toolMetadata.js';
|
|
2
3
|
/**
|
|
3
4
|
* Register all prompts with the MCP server
|
|
4
5
|
* Each prompt is defined in its own file under the prompts directory
|
|
5
6
|
*/
|
|
6
|
-
export declare function registerPrompts(server: McpServer): void;
|
|
7
|
+
export declare function registerPrompts(server: McpServer, content: CompleteMetadata): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { CompleteMetadata } from '../tools/toolMetadata.js';
|
|
2
3
|
export declare const PROMPT_NAME = "research";
|
|
3
|
-
export declare function registerResearchPrompt(server: McpServer): void;
|
|
4
|
+
export declare function registerResearchPrompt(server: McpServer, content: CompleteMetadata): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { CompleteMetadata } from '../tools/toolMetadata.js';
|
|
2
3
|
export declare const PROMPT_NAME = "use";
|
|
3
|
-
export declare function registerUsePrompt(server: McpServer): void;
|
|
4
|
+
export declare function registerUsePrompt(server: McpServer, content: CompleteMetadata): void;
|
|
@@ -9,6 +9,28 @@ export interface ToolMetadata {
|
|
|
9
9
|
}
|
|
10
10
|
export interface CompleteMetadata {
|
|
11
11
|
instructions: string;
|
|
12
|
+
prompts: {
|
|
13
|
+
research: {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
kudos: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
content: string;
|
|
22
|
+
};
|
|
23
|
+
use: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
content: string;
|
|
27
|
+
};
|
|
28
|
+
[key: string]: {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
content: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
12
34
|
toolNames: {
|
|
13
35
|
GITHUB_FETCH_CONTENT: 'githubGetFileContent';
|
|
14
36
|
GITHUB_SEARCH_CODE: 'githubSearchCode';
|
|
@@ -29,21 +51,13 @@ export interface CompleteMetadata {
|
|
|
29
51
|
};
|
|
30
52
|
genericErrorHints: readonly string[];
|
|
31
53
|
}
|
|
32
|
-
export declare
|
|
33
|
-
export declare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
GITHUB_SEARCH_REPOSITORIES: "githubSearchRepositories";
|
|
38
|
-
GITHUB_VIEW_REPO_STRUCTURE: "githubViewRepoStructure";
|
|
39
|
-
};
|
|
54
|
+
export declare function initializeToolMetadata(): Promise<void>;
|
|
55
|
+
export declare function loadToolContent(): Promise<CompleteMetadata>;
|
|
56
|
+
export declare function getInstructionsSync(): string;
|
|
57
|
+
export declare function getPromptsSync(): CompleteMetadata['prompts'];
|
|
58
|
+
export declare const TOOL_NAMES: CompleteMetadata["toolNames"];
|
|
40
59
|
export type ToolName = (typeof TOOL_NAMES)[keyof typeof TOOL_NAMES];
|
|
41
|
-
export declare const BASE_SCHEMA:
|
|
42
|
-
mainResearchGoal: string;
|
|
43
|
-
researchGoal: string;
|
|
44
|
-
reasoning: string;
|
|
45
|
-
bulkQuery: (toolName: string) => string;
|
|
46
|
-
};
|
|
60
|
+
export declare const BASE_SCHEMA: CompleteMetadata["baseSchema"];
|
|
47
61
|
export declare const GENERIC_ERROR_HINTS: readonly string[];
|
|
48
62
|
export declare function getCompleteMetadata(): Promise<CompleteMetadata>;
|
|
49
63
|
export declare function getToolsMetadata(): Promise<Record<string, ToolMetadata>>;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -358,13 +358,6 @@ export interface CacheStats {
|
|
|
358
358
|
totalKeys: number;
|
|
359
359
|
lastReset: Date;
|
|
360
360
|
}
|
|
361
|
-
/** Options for command execution */
|
|
362
|
-
export type ExecOptions = {
|
|
363
|
-
timeout?: number;
|
|
364
|
-
cwd?: string;
|
|
365
|
-
env?: Record<string, string>;
|
|
366
|
-
cache?: boolean;
|
|
367
|
-
};
|
|
368
361
|
/** Result of a promise with error isolation */
|
|
369
362
|
export interface PromiseResult<T> {
|
|
370
363
|
success: boolean;
|
package/dist/src/utils/exec.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types';
|
|
2
|
-
import type { ExecOptions } from '../types.js';
|
|
3
|
-
declare const ALLOWED_NPM_COMMANDS: readonly ["view", "search", "ping", "config", "whoami"];
|
|
4
|
-
export type NpmCommand = (typeof ALLOWED_NPM_COMMANDS)[number];
|
|
5
2
|
export declare function parseExecResult(stdout: string, stderr: string, error?: Error | null, exitCode?: number): CallToolResult;
|
|
6
|
-
export declare function executeNpmCommand(command: NpmCommand, args: string[], options?: ExecOptions): Promise<CallToolResult>;
|
|
7
3
|
export declare function getGithubCLIToken(): Promise<string | null>;
|
|
8
|
-
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch with retry mechanism and exponential backoff
|
|
3
|
+
*/
|
|
4
|
+
export interface FetchWithRetriesOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Maximum number of retry attempts (excluding the initial request)
|
|
7
|
+
* @default 3
|
|
8
|
+
*/
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Initial delay in milliseconds for exponential backoff
|
|
12
|
+
* @default 1000 (1 second)
|
|
13
|
+
*/
|
|
14
|
+
initialDelayMs?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Custom headers to include in the request
|
|
17
|
+
*/
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
/**
|
|
20
|
+
* HTTP method
|
|
21
|
+
* @default 'GET'
|
|
22
|
+
*/
|
|
23
|
+
method?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fetches a URL with automatic retries and exponential backoff.
|
|
27
|
+
*
|
|
28
|
+
* Retry behavior:
|
|
29
|
+
* - Retries on network errors, server errors (5xx), and rate limits (429)
|
|
30
|
+
* - Respects 'Retry-After' header for 429 responses
|
|
31
|
+
* - Does NOT retry on client errors (4xx) except rate limits
|
|
32
|
+
* - Uses exponential backoff: 1s, 2s, 4s (default) if no Retry-After header
|
|
33
|
+
*
|
|
34
|
+
* @param url - The URL to fetch
|
|
35
|
+
* @param options - Configuration options for retries and request
|
|
36
|
+
* @returns The JSON response (or null for 204 No Content)
|
|
37
|
+
* @throws Error if all retry attempts fail
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const data = await fetchWithRetries('https://api.example.com/data', {
|
|
42
|
+
* maxRetries: 3,
|
|
43
|
+
* headers: { 'User-Agent': 'MyApp/1.0' }
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function fetchWithRetries(url: string, options?: FetchWithRetriesOptions): Promise<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "octocode-mcp",
|
|
3
|
-
"version": "7.0.12-alpha.
|
|
3
|
+
"version": "7.0.12-alpha.3",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for advanced GitHub repository analysis and code discovery. Provides AI assistants with powerful tools to search, analyze, and understand codebases across GitHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|