@runpod/mcp-server 3.4.0 → 4.1.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/dist/tools.d.cts DELETED
@@ -1,95 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
-
3
- interface RequestInitLike {
4
- method: string;
5
- headers: Record<string, string>;
6
- body?: string;
7
- signal: AbortSignal;
8
- }
9
- type FetchLike = (url: string, init: RequestInitLike) => Promise<HttpResponseLike>;
10
- interface HttpResponseLike {
11
- ok: boolean;
12
- status: number;
13
- text(): Promise<string>;
14
- json(): Promise<unknown>;
15
- headers: {
16
- get(name: string): string | null;
17
- };
18
- }
19
- interface RequestOptions {
20
- timeoutMs?: number;
21
- }
22
- type TimeoutCeiling = number | (() => number);
23
- interface HttpClient {
24
- (url: string, method?: string, body?: Record<string, unknown>, options?: RequestOptions): Promise<unknown>;
25
- }
26
- declare function createHttpClient(deps: {
27
- apiKey: string;
28
- fetch: FetchLike;
29
- tracking: () => Record<string, string>;
30
- errorPrefix: string;
31
- defaultTimeoutMs?: number;
32
- maxTimeoutMs?: TimeoutCeiling;
33
- }): HttpClient;
34
-
35
- interface SseResponse {
36
- ok: boolean;
37
- status: number;
38
- headers: {
39
- get(name: string): string | null;
40
- };
41
- text(): Promise<string>;
42
- body: AsyncIterable<Buffer> | null;
43
- }
44
- type SseFetch = (url: string, init: {
45
- method: string;
46
- headers: Record<string, string>;
47
- signal: AbortSignal;
48
- }) => Promise<SseResponse>;
49
-
50
- /**
51
- * Context passed to every tool handler. Contains the API key used to
52
- * authenticate against the Runpod REST and Serverless APIs, the transport the
53
- * server is running under, and (for stateless HTTP) the inbound client
54
- * User-Agent — all used for outbound caller-tracking headers.
55
- */
56
- interface ToolContext {
57
- apiKey: string;
58
- transport: 'stdio' | 'http';
59
- clientUserAgent?: string;
60
- serverVersion?: string;
61
- onUnauthorized?: () => void;
62
- }
63
- type HttpFetch = Parameters<typeof createHttpClient>[0]['fetch'];
64
- interface ToolDeps {
65
- fetch?: HttpFetch;
66
- v2Available?: boolean;
67
- streamSse?: StreamSse;
68
- sseFetch?: SseFetch;
69
- defaultTimeoutMs?: number;
70
- maxTimeoutMs?: TimeoutCeiling;
71
- }
72
- interface StreamSseResult {
73
- raw: string;
74
- truncated: boolean;
75
- }
76
- type StreamSse = (url: string, opts: {
77
- maxWaitMs: number;
78
- maxBytes: number;
79
- }) => Promise<StreamSseResult>;
80
-
81
- /**
82
- * Register all Runpod tools on the given MCP server instance.
83
- *
84
- * The tool surface is split by resource under `src/tools/<resource>.ts`; this
85
- * function builds the shared runtime (caller-tracking, authenticated REST/
86
- * Serverless/GraphQL clients, the v1/v2 backend resolver) once and threads it
87
- * into each per-resource registrar.
88
- *
89
- * @param ctx supplies the API key the request helpers authenticate with.
90
- * @param deps optional test seam (inject a fake fetch / the resolved v2-probe
91
- * verdict). Production passes nothing.
92
- */
93
- declare function registerTools(server: McpServer, ctx: ToolContext, deps?: ToolDeps): void;
94
-
95
- export { type ToolContext, registerTools };
package/dist/tools.d.ts DELETED
@@ -1,95 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
-
3
- interface RequestInitLike {
4
- method: string;
5
- headers: Record<string, string>;
6
- body?: string;
7
- signal: AbortSignal;
8
- }
9
- type FetchLike = (url: string, init: RequestInitLike) => Promise<HttpResponseLike>;
10
- interface HttpResponseLike {
11
- ok: boolean;
12
- status: number;
13
- text(): Promise<string>;
14
- json(): Promise<unknown>;
15
- headers: {
16
- get(name: string): string | null;
17
- };
18
- }
19
- interface RequestOptions {
20
- timeoutMs?: number;
21
- }
22
- type TimeoutCeiling = number | (() => number);
23
- interface HttpClient {
24
- (url: string, method?: string, body?: Record<string, unknown>, options?: RequestOptions): Promise<unknown>;
25
- }
26
- declare function createHttpClient(deps: {
27
- apiKey: string;
28
- fetch: FetchLike;
29
- tracking: () => Record<string, string>;
30
- errorPrefix: string;
31
- defaultTimeoutMs?: number;
32
- maxTimeoutMs?: TimeoutCeiling;
33
- }): HttpClient;
34
-
35
- interface SseResponse {
36
- ok: boolean;
37
- status: number;
38
- headers: {
39
- get(name: string): string | null;
40
- };
41
- text(): Promise<string>;
42
- body: AsyncIterable<Buffer> | null;
43
- }
44
- type SseFetch = (url: string, init: {
45
- method: string;
46
- headers: Record<string, string>;
47
- signal: AbortSignal;
48
- }) => Promise<SseResponse>;
49
-
50
- /**
51
- * Context passed to every tool handler. Contains the API key used to
52
- * authenticate against the Runpod REST and Serverless APIs, the transport the
53
- * server is running under, and (for stateless HTTP) the inbound client
54
- * User-Agent — all used for outbound caller-tracking headers.
55
- */
56
- interface ToolContext {
57
- apiKey: string;
58
- transport: 'stdio' | 'http';
59
- clientUserAgent?: string;
60
- serverVersion?: string;
61
- onUnauthorized?: () => void;
62
- }
63
- type HttpFetch = Parameters<typeof createHttpClient>[0]['fetch'];
64
- interface ToolDeps {
65
- fetch?: HttpFetch;
66
- v2Available?: boolean;
67
- streamSse?: StreamSse;
68
- sseFetch?: SseFetch;
69
- defaultTimeoutMs?: number;
70
- maxTimeoutMs?: TimeoutCeiling;
71
- }
72
- interface StreamSseResult {
73
- raw: string;
74
- truncated: boolean;
75
- }
76
- type StreamSse = (url: string, opts: {
77
- maxWaitMs: number;
78
- maxBytes: number;
79
- }) => Promise<StreamSseResult>;
80
-
81
- /**
82
- * Register all Runpod tools on the given MCP server instance.
83
- *
84
- * The tool surface is split by resource under `src/tools/<resource>.ts`; this
85
- * function builds the shared runtime (caller-tracking, authenticated REST/
86
- * Serverless/GraphQL clients, the v1/v2 backend resolver) once and threads it
87
- * into each per-resource registrar.
88
- *
89
- * @param ctx supplies the API key the request helpers authenticate with.
90
- * @param deps optional test seam (inject a fake fetch / the resolved v2-probe
91
- * verdict). Production passes nothing.
92
- */
93
- declare function registerTools(server: McpServer, ctx: ToolContext, deps?: ToolDeps): void;
94
-
95
- export { type ToolContext, registerTools };
package/dist/tools.mjs DELETED
@@ -1,7 +0,0 @@
1
- import {
2
- registerTools
3
- } from "./chunk-G4URDODF.mjs";
4
- export {
5
- registerTools
6
- };
7
- //# sourceMappingURL=tools.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}