@corsair-dev/mcp 0.1.1 → 0.1.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.
- package/dist/core/stdio.d.ts +3 -0
- package/dist/core/stdio.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/package.json +1 -1
- package/dist/adapters.d.ts +0 -77
- package/dist/adapters.d.ts.map +0 -1
- package/dist/base.d.ts +0 -4
- package/dist/base.d.ts.map +0 -1
- package/dist/claude.d.ts +0 -10
- package/dist/claude.d.ts.map +0 -1
- package/dist/http.d.ts +0 -4
- package/dist/http.d.ts.map +0 -1
- package/dist/openai.d.ts +0 -7
- package/dist/openai.d.ts.map +0 -1
- package/dist/vercel-ai.d.ts +0 -6
- package/dist/vercel-ai.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/core/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { createBaseMcpServer } from './core/base.js';
|
|
2
2
|
export { createMcpRouter } from './core/http.js';
|
|
3
|
+
export { runStdioMcpServer } from './core/stdio.js';
|
|
3
4
|
export type { OpenAIMcpConfig } from './adapters/openai.js';
|
|
4
5
|
export { getOpenAIMcpConfig } from './adapters/openai.js';
|
|
5
6
|
export type { VercelAiMcpClientOptions } from './adapters/vercel-ai.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAA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E,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -145,7 +145,7 @@ function createBaseMcpServer(options) {
|
|
|
145
145
|
const server = new McpServer({
|
|
146
146
|
name: "corsair",
|
|
147
147
|
version: "1.0.0",
|
|
148
|
-
description: "Use this to interact with the Corsair API. Corsair helps you integrate with dozens of tools and services.
|
|
148
|
+
description: "Use this to interact with the Corsair API. Corsair helps you integrate with dozens of tools and services."
|
|
149
149
|
});
|
|
150
150
|
for (const def of buildCorsairToolDefs(options)) {
|
|
151
151
|
server.registerTool(
|
|
@@ -216,6 +216,13 @@ function createMcpRouter(createServer) {
|
|
|
216
216
|
return router;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
// src/core/stdio.ts
|
|
220
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
221
|
+
async function runStdioMcpServer(server) {
|
|
222
|
+
const transport = new StdioServerTransport();
|
|
223
|
+
await server.connect(transport);
|
|
224
|
+
}
|
|
225
|
+
|
|
219
226
|
// src/adapters/openai.ts
|
|
220
227
|
function getOpenAIMcpConfig(baseUrl, headers) {
|
|
221
228
|
return {
|
|
@@ -293,5 +300,6 @@ export {
|
|
|
293
300
|
createBaseMcpServer,
|
|
294
301
|
createMcpRouter,
|
|
295
302
|
createVercelAiMcpClient,
|
|
296
|
-
getOpenAIMcpConfig
|
|
303
|
+
getOpenAIMcpConfig,
|
|
304
|
+
runStdioMcpServer
|
|
297
305
|
};
|
package/package.json
CHANGED
package/dist/adapters.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
export type WorkflowStoreInput = {
|
|
2
|
-
type: 'workflow';
|
|
3
|
-
workflowId: string;
|
|
4
|
-
code: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
cronSchedule?: string;
|
|
7
|
-
webhookTrigger?: {
|
|
8
|
-
plugin: string;
|
|
9
|
-
action: string;
|
|
10
|
-
};
|
|
11
|
-
notifyJid?: string;
|
|
12
|
-
};
|
|
13
|
-
export type WorkflowListItem = {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
description: string | null;
|
|
17
|
-
triggerType: 'manual' | 'cron' | 'webhook';
|
|
18
|
-
triggerConfig: Record<string, unknown>;
|
|
19
|
-
status: string;
|
|
20
|
-
nextRunAt: Date | null;
|
|
21
|
-
lastRunAt: Date | null;
|
|
22
|
-
createdAt: Date;
|
|
23
|
-
};
|
|
24
|
-
export type WorkflowStored = {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
triggerType: 'manual' | 'cron' | 'webhook';
|
|
28
|
-
status: string;
|
|
29
|
-
code?: string;
|
|
30
|
-
triggerConfig?: Record<string, unknown>;
|
|
31
|
-
};
|
|
32
|
-
export type WorkflowUpdateFields = {
|
|
33
|
-
code?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
cronSchedule?: string;
|
|
36
|
-
webhookTrigger?: {
|
|
37
|
-
plugin: string;
|
|
38
|
-
action: string;
|
|
39
|
-
};
|
|
40
|
-
status?: 'active' | 'paused' | 'archived';
|
|
41
|
-
};
|
|
42
|
-
export type WorkflowAdapter = {
|
|
43
|
-
listWorkflows(triggerType?: 'cron' | 'webhook' | 'manual' | 'all'): Promise<WorkflowListItem[]>;
|
|
44
|
-
storeWorkflow(input: WorkflowStoreInput): Promise<WorkflowStored | null>;
|
|
45
|
-
updateWorkflowRecord(nameOrId: string, updates: WorkflowUpdateFields): Promise<WorkflowStored | null>;
|
|
46
|
-
archiveWorkflow(nameOrId: string): Promise<WorkflowStored | null>;
|
|
47
|
-
};
|
|
48
|
-
export type CronAdapter = {
|
|
49
|
-
registerCronWorkflow(dbId: string, name: string, code: string, schedule: string, notifyJid?: string): boolean;
|
|
50
|
-
unregisterCronWorkflow(dbId: string): void;
|
|
51
|
-
};
|
|
52
|
-
export type PermissionAdapter = {
|
|
53
|
-
createPermissionRequest(params: {
|
|
54
|
-
endpoint: string;
|
|
55
|
-
args: Record<string, unknown>;
|
|
56
|
-
description: string;
|
|
57
|
-
jid?: string;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
permissionId: string;
|
|
60
|
-
approvalUrl: string;
|
|
61
|
-
}>;
|
|
62
|
-
};
|
|
63
|
-
export type BaseMcpOptions = {
|
|
64
|
-
corsair: {
|
|
65
|
-
list_operations: (opts?: {
|
|
66
|
-
plugin?: string;
|
|
67
|
-
type?: 'api' | 'webhooks' | 'db';
|
|
68
|
-
}) => unknown;
|
|
69
|
-
get_schema: (path: string) => unknown;
|
|
70
|
-
[key: string]: unknown;
|
|
71
|
-
};
|
|
72
|
-
workflows: WorkflowAdapter;
|
|
73
|
-
cron: CronAdapter;
|
|
74
|
-
permissions?: PermissionAdapter;
|
|
75
|
-
basePermissionUrl?: string;
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=adapters.d.ts.map
|
package/dist/adapters.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,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AAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CA6TtE"}
|
package/dist/claude.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SdkMcpToolDefinition } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
import type { BaseMcpOptions } from './adapters.js';
|
|
3
|
-
export type ClaudeExtensionContext = {
|
|
4
|
-
jid?: string;
|
|
5
|
-
};
|
|
6
|
-
export type CreateClaudeToolsOptions = BaseMcpOptions & {
|
|
7
|
-
context?: ClaudeExtensionContext;
|
|
8
|
-
};
|
|
9
|
-
export declare function createClaudeTools(options: CreateClaudeToolsOptions): Promise<SdkMcpToolDefinition<any>[]>;
|
|
10
|
-
//# sourceMappingURL=claude.d.ts.map
|
package/dist/claude.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../src/claude.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG;IACtD,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,CAmRtC"}
|
package/dist/http.d.ts
DELETED
package/dist/http.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAmBzD,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,SAAS,GAAG,MAAM,CAoDrE"}
|
package/dist/openai.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type OpenAIMcpConfig = {
|
|
2
|
-
serverLabel: string;
|
|
3
|
-
serverUrl: string;
|
|
4
|
-
headers?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
export declare function getOpenAIMcpConfig(baseUrl: string, headers?: Record<string, string>): OpenAIMcpConfig;
|
|
7
|
-
//# sourceMappingURL=openai.d.ts.map
|
package/dist/openai.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../src/openai.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,CAMrG"}
|
package/dist/vercel-ai.d.ts
DELETED
package/dist/vercel-ai.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercel-ai.d.ts","sourceRoot":"","sources":["../src/vercel-ai.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,4CAW9E"}
|