@vinkius-core/mcp-fusion 2.8.1 → 2.9.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/cli/fusion.d.ts +29 -0
- package/dist/cli/fusion.d.ts.map +1 -1
- package/dist/cli/fusion.js +202 -17
- package/dist/cli/fusion.js.map +1 -1
- package/dist/cli/scaffold.d.ts +10 -0
- package/dist/cli/scaffold.d.ts.map +1 -0
- package/dist/cli/scaffold.js +92 -0
- package/dist/cli/scaffold.js.map +1 -0
- package/dist/cli/templates/config.d.ts +14 -0
- package/dist/cli/templates/config.d.ts.map +1 -0
- package/dist/cli/templates/config.js +133 -0
- package/dist/cli/templates/config.js.map +1 -0
- package/dist/cli/templates/constants.d.ts +9 -0
- package/dist/cli/templates/constants.d.ts.map +1 -0
- package/dist/cli/templates/constants.js +9 -0
- package/dist/cli/templates/constants.js.map +1 -0
- package/dist/cli/templates/core.d.ts +14 -0
- package/dist/cli/templates/core.d.ts.map +1 -0
- package/dist/cli/templates/core.js +130 -0
- package/dist/cli/templates/core.js.map +1 -0
- package/dist/cli/templates/cursor.d.ts +8 -0
- package/dist/cli/templates/cursor.d.ts.map +1 -0
- package/dist/cli/templates/cursor.js +13 -0
- package/dist/cli/templates/cursor.js.map +1 -0
- package/dist/cli/templates/index.d.ts +17 -0
- package/dist/cli/templates/index.d.ts.map +1 -0
- package/dist/cli/templates/index.js +27 -0
- package/dist/cli/templates/index.js.map +1 -0
- package/dist/cli/templates/middleware.d.ts +7 -0
- package/dist/cli/templates/middleware.d.ts.map +1 -0
- package/dist/cli/templates/middleware.js +31 -0
- package/dist/cli/templates/middleware.js.map +1 -0
- package/dist/cli/templates/presenter.d.ts +7 -0
- package/dist/cli/templates/presenter.d.ts.map +1 -0
- package/dist/cli/templates/presenter.js +46 -0
- package/dist/cli/templates/presenter.js.map +1 -0
- package/dist/cli/templates/prompt.d.ts +7 -0
- package/dist/cli/templates/prompt.d.ts.map +1 -0
- package/dist/cli/templates/prompt.js +42 -0
- package/dist/cli/templates/prompt.js.map +1 -0
- package/dist/cli/templates/readme.d.ts +8 -0
- package/dist/cli/templates/readme.d.ts.map +1 -0
- package/dist/cli/templates/readme.js +177 -0
- package/dist/cli/templates/readme.js.map +1 -0
- package/dist/cli/templates/testing.d.ts +11 -0
- package/dist/cli/templates/testing.d.ts.map +1 -0
- package/dist/cli/templates/testing.js +100 -0
- package/dist/cli/templates/testing.js.map +1 -0
- package/dist/cli/templates/tools.d.ts +9 -0
- package/dist/cli/templates/tools.d.ts.map +1 -0
- package/dist/cli/templates/tools.js +66 -0
- package/dist/cli/templates/tools.js.map +1 -0
- package/dist/cli/templates/vectors/database.d.ts +9 -0
- package/dist/cli/templates/vectors/database.d.ts.map +1 -0
- package/dist/cli/templates/vectors/database.js +87 -0
- package/dist/cli/templates/vectors/database.js.map +1 -0
- package/dist/cli/templates/vectors/index.d.ts +9 -0
- package/dist/cli/templates/vectors/index.d.ts.map +1 -0
- package/dist/cli/templates/vectors/index.js +9 -0
- package/dist/cli/templates/vectors/index.js.map +1 -0
- package/dist/cli/templates/vectors/oauth.d.ts +10 -0
- package/dist/cli/templates/vectors/oauth.d.ts.map +1 -0
- package/dist/cli/templates/vectors/oauth.js +77 -0
- package/dist/cli/templates/vectors/oauth.js.map +1 -0
- package/dist/cli/templates/vectors/openapi.d.ts +10 -0
- package/dist/cli/templates/vectors/openapi.d.ts.map +1 -0
- package/dist/cli/templates/vectors/openapi.js +106 -0
- package/dist/cli/templates/vectors/openapi.js.map +1 -0
- package/dist/cli/templates/vectors/workflow.d.ts +7 -0
- package/dist/cli/templates/vectors/workflow.d.ts.map +1 -0
- package/dist/cli/templates/vectors/workflow.js +49 -0
- package/dist/cli/templates/vectors/workflow.js.map +1 -0
- package/dist/cli/types.d.ts +29 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +10 -0
- package/dist/cli/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** Generate `openapi.yaml` — Sample OpenAPI spec */
|
|
2
|
+
export function openapiYaml(config) {
|
|
3
|
+
return `# OpenAPI 3.0 Specification — Sample
|
|
4
|
+
#
|
|
5
|
+
# Replace this with your actual API spec, then run:
|
|
6
|
+
# npx mcp-fusion-openapi-gen ./openapi.yaml --outDir ./src/generated
|
|
7
|
+
#
|
|
8
|
+
# The generator creates Presenters, Tools, Registry, and server
|
|
9
|
+
# bootstrap — all configurable via YAML annotations.
|
|
10
|
+
|
|
11
|
+
openapi: '3.0.3'
|
|
12
|
+
info:
|
|
13
|
+
title: '${config.name} API'
|
|
14
|
+
version: '0.1.0'
|
|
15
|
+
description: Sample API for MCP Fusion OpenAPI generation
|
|
16
|
+
|
|
17
|
+
servers:
|
|
18
|
+
- url: http://localhost:3000/api
|
|
19
|
+
|
|
20
|
+
paths:
|
|
21
|
+
/health:
|
|
22
|
+
get:
|
|
23
|
+
operationId: getHealth
|
|
24
|
+
summary: Health check endpoint
|
|
25
|
+
responses:
|
|
26
|
+
'200':
|
|
27
|
+
description: Server health status
|
|
28
|
+
content:
|
|
29
|
+
application/json:
|
|
30
|
+
schema:
|
|
31
|
+
type: object
|
|
32
|
+
properties:
|
|
33
|
+
status:
|
|
34
|
+
type: string
|
|
35
|
+
example: healthy
|
|
36
|
+
uptime:
|
|
37
|
+
type: number
|
|
38
|
+
example: 12345.67
|
|
39
|
+
|
|
40
|
+
/users:
|
|
41
|
+
get:
|
|
42
|
+
operationId: listUsers
|
|
43
|
+
summary: List all users
|
|
44
|
+
parameters:
|
|
45
|
+
- name: limit
|
|
46
|
+
in: query
|
|
47
|
+
schema:
|
|
48
|
+
type: integer
|
|
49
|
+
minimum: 1
|
|
50
|
+
maximum: 100
|
|
51
|
+
default: 10
|
|
52
|
+
responses:
|
|
53
|
+
'200':
|
|
54
|
+
description: List of users
|
|
55
|
+
content:
|
|
56
|
+
application/json:
|
|
57
|
+
schema:
|
|
58
|
+
type: array
|
|
59
|
+
items:
|
|
60
|
+
$ref: '#/components/schemas/User'
|
|
61
|
+
|
|
62
|
+
components:
|
|
63
|
+
schemas:
|
|
64
|
+
User:
|
|
65
|
+
type: object
|
|
66
|
+
properties:
|
|
67
|
+
id:
|
|
68
|
+
type: string
|
|
69
|
+
name:
|
|
70
|
+
type: string
|
|
71
|
+
email:
|
|
72
|
+
type: string
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
/** Generate `SETUP.md` — OpenAPI generation instructions */
|
|
76
|
+
export function openapiSetupMd() {
|
|
77
|
+
return `# OpenAPI Generator Setup
|
|
78
|
+
|
|
79
|
+
This project is configured for the **Legacy API Proxy** ingestion vector.
|
|
80
|
+
|
|
81
|
+
## Steps
|
|
82
|
+
|
|
83
|
+
1. Replace \`openapi.yaml\` with your actual OpenAPI 3.x spec
|
|
84
|
+
|
|
85
|
+
2. Generate the MCP server from the spec:
|
|
86
|
+
\`\`\`bash
|
|
87
|
+
npx mcp-fusion-openapi-gen ./openapi.yaml --outDir ./src/generated
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
3. The generator creates:
|
|
91
|
+
- Presenters with Zod schemas (Egress Firewall)
|
|
92
|
+
- Tool builders with typed handlers
|
|
93
|
+
- Registry setup with all endpoints
|
|
94
|
+
|
|
95
|
+
4. Import and register in \`src/server.ts\`:
|
|
96
|
+
\`\`\`typescript
|
|
97
|
+
import { generatedTools } from './generated/registry.js';
|
|
98
|
+
registry.registerAll(...generatedTools);
|
|
99
|
+
\`\`\`
|
|
100
|
+
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
See: [OpenAPI Generator](https://mcp-fusion.vinkius.com/openapi-gen)
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=openapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../../../src/cli/templates/vectors/openapi.ts"],"names":[],"mappings":"AAMA,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,MAAqB;IAC7C,OAAO;;;;;;;;;;YAUC,MAAM,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DtB,CAAC;AACF,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,cAAc;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BV,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../src/cli/templates/vectors/workflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qDAAqD;AACrD,wBAAgB,cAAc,IAAI,MAAM,CA0CvC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Vector — n8n connector template
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/** Generate `src/n8n.ts` — n8n workflow connector */
|
|
6
|
+
export function n8nConnectorTs() {
|
|
7
|
+
return [
|
|
8
|
+
'/**',
|
|
9
|
+
' * n8n Connector — Workflow Automation Bridge',
|
|
10
|
+
' *',
|
|
11
|
+
' * Auto-discovers webhook workflows from your n8n instance',
|
|
12
|
+
' * and registers them as MCP tools. The connector infers',
|
|
13
|
+
' * tool semantics from workflow Notes and maintains',
|
|
14
|
+
' * live-sync with zero downtime.',
|
|
15
|
+
' *',
|
|
16
|
+
' * Configure N8N_BASE_URL and N8N_API_KEY in your .env file.',
|
|
17
|
+
' */',
|
|
18
|
+
"import { N8nConnector } from 'mcp-fusion-n8n';",
|
|
19
|
+
"import type { ToolRegistry } from '@vinkius-core/mcp-fusion';",
|
|
20
|
+
'',
|
|
21
|
+
'export async function discoverWorkflows<TContext>(',
|
|
22
|
+
' registry: ToolRegistry<TContext>,',
|
|
23
|
+
'): Promise<number> {',
|
|
24
|
+
" const baseUrl = process.env['N8N_BASE_URL'];",
|
|
25
|
+
" const apiKey = process.env['N8N_API_KEY'];",
|
|
26
|
+
'',
|
|
27
|
+
' if (!baseUrl || !apiKey) {',
|
|
28
|
+
" console.error('\u26A0\uFE0F N8N_BASE_URL and N8N_API_KEY are required in .env');",
|
|
29
|
+
' return 0;',
|
|
30
|
+
' }',
|
|
31
|
+
'',
|
|
32
|
+
' const connector = new N8nConnector({',
|
|
33
|
+
' baseUrl,',
|
|
34
|
+
' apiKey,',
|
|
35
|
+
' });',
|
|
36
|
+
'',
|
|
37
|
+
' const tools = await connector.discover();',
|
|
38
|
+
'',
|
|
39
|
+
' for (const tool of tools) {',
|
|
40
|
+
' registry.register(tool);',
|
|
41
|
+
' }',
|
|
42
|
+
'',
|
|
43
|
+
' console.error(`\uD83D\uDD17 Discovered ${tools.length} n8n workflow(s)`);',
|
|
44
|
+
' return tools.length;',
|
|
45
|
+
'}',
|
|
46
|
+
'',
|
|
47
|
+
].join('\n');
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../src/cli/templates/vectors/workflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qDAAqD;AACrD,MAAM,UAAU,cAAc;IAC1B,OAAO;QACH,KAAK;QACL,+CAA+C;QAC/C,IAAI;QACJ,4DAA4D;QAC5D,0DAA0D;QAC1D,qDAAqD;QACrD,kCAAkC;QAClC,IAAI;QACJ,8DAA8D;QAC9D,KAAK;QACL,gDAAgD;QAChD,+DAA+D;QAC/D,EAAE;QACF,oDAAoD;QACpD,uCAAuC;QACvC,sBAAsB;QACtB,kDAAkD;QAClD,gDAAgD;QAChD,EAAE;QACF,gCAAgC;QAChC,2FAA2F;QAC3F,mBAAmB;QACnB,OAAO;QACP,EAAE;QACF,0CAA0C;QAC1C,kBAAkB;QAClB,iBAAiB;QACjB,SAAS;QACT,EAAE;QACF,+CAA+C;QAC/C,EAAE;QACF,iCAAiC;QACjC,kCAAkC;QAClC,OAAO;QACP,EAAE;QACF,+EAA+E;QAC/E,0BAA0B;QAC1B,GAAG;QACH,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Types — Shared Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Configuration types collected from the interactive wizard
|
|
5
|
+
* or CLI flags for the `fusion create` command.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/** Primary ingestion vector for the scaffolded project */
|
|
10
|
+
export type IngestionVector = 'vanilla' | 'prisma' | 'n8n' | 'openapi' | 'oauth';
|
|
11
|
+
/** Transport layer for MCP communication */
|
|
12
|
+
export type TransportLayer = 'stdio' | 'sse';
|
|
13
|
+
/**
|
|
14
|
+
* Project scaffold configuration.
|
|
15
|
+
*
|
|
16
|
+
* Collected from CLI flags or the interactive wizard.
|
|
17
|
+
* Drives template generation and file selection.
|
|
18
|
+
*/
|
|
19
|
+
export interface ProjectConfig {
|
|
20
|
+
/** Project name (directory name + package.json name) */
|
|
21
|
+
readonly name: string;
|
|
22
|
+
/** Transport layer for MCP communication */
|
|
23
|
+
readonly transport: TransportLayer;
|
|
24
|
+
/** Primary ingestion vector */
|
|
25
|
+
readonly vector: IngestionVector;
|
|
26
|
+
/** Include @vinkius-core/mcp-fusion-testing + Vitest */
|
|
27
|
+
readonly testing: boolean;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjF,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IAEnC,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IAEjC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinkius-core/mcp-fusion",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "MVA (Model-View-Agent) framework for the Model Context Protocol. Structured perception packages with Presenters, cognitive guardrails, self-healing errors, action consolidation, and tRPC-style type safety — so AI agents perceive and act on your data deterministically.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|