@nahisaho/musubix-mcp-server 1.0.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/bin/musubix-mcp.js +73 -0
- package/dist/__tests__/index.test.d.ts +2 -0
- package/dist/__tests__/index.test.d.ts.map +1 -0
- package/dist/__tests__/index.test.js +44 -0
- package/dist/__tests__/index.test.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/platform/adapter.d.ts +136 -0
- package/dist/platform/adapter.d.ts.map +1 -0
- package/dist/platform/adapter.js +370 -0
- package/dist/platform/adapter.js.map +1 -0
- package/dist/platform/index.d.ts +8 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +8 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/prompts/index.d.ts +8 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +8 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/sdd-prompts.d.ts +45 -0
- package/dist/prompts/sdd-prompts.d.ts.map +1 -0
- package/dist/prompts/sdd-prompts.js +445 -0
- package/dist/prompts/sdd-prompts.js.map +1 -0
- package/dist/resources/index.d.ts +8 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +8 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/sdd-resources.d.ts +57 -0
- package/dist/resources/sdd-resources.d.ts.map +1 -0
- package/dist/resources/sdd-resources.js +629 -0
- package/dist/resources/sdd-resources.js.map +1 -0
- package/dist/server.d.ts +201 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +435 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/sdd-tools.d.ts +57 -0
- package/dist/tools/sdd-tools.d.ts.map +1 -0
- package/dist/tools/sdd-tools.js +450 -0
- package/dist/tools/sdd-tools.js.map +1 -0
- package/dist/types.d.ts +207 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/types.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MUSUBIX MCP Server Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Starts the MCP server for AI platform integration.
|
|
6
|
+
*
|
|
7
|
+
* @see REQ-INT-102 - MCP Server
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx @musubix/mcp-server
|
|
11
|
+
* musubix-mcp --transport stdio
|
|
12
|
+
* musubix-mcp --transport sse --port 8080
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { startServer, VERSION } from '../dist/index.js';
|
|
16
|
+
import { parseArgs } from 'node:util';
|
|
17
|
+
|
|
18
|
+
const options = {
|
|
19
|
+
transport: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
short: 't',
|
|
22
|
+
default: 'stdio'
|
|
23
|
+
},
|
|
24
|
+
port: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
short: 'p',
|
|
27
|
+
default: '3000'
|
|
28
|
+
},
|
|
29
|
+
help: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
short: 'h',
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
version: {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
short: 'v',
|
|
37
|
+
default: false
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const { values } = parseArgs({ options, allowPositionals: true });
|
|
42
|
+
|
|
43
|
+
if (values.help) {
|
|
44
|
+
console.log(`
|
|
45
|
+
MUSUBIX MCP Server - Model Context Protocol Server for AI Platforms
|
|
46
|
+
|
|
47
|
+
Usage:
|
|
48
|
+
musubix-mcp [options]
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
-t, --transport <type> Transport type: stdio | sse (default: stdio)
|
|
52
|
+
-p, --port <port> Port for SSE transport (default: 3000)
|
|
53
|
+
-h, --help Show this help message
|
|
54
|
+
-v, --version Show version
|
|
55
|
+
|
|
56
|
+
Examples:
|
|
57
|
+
musubix-mcp # Start with stdio transport
|
|
58
|
+
musubix-mcp -t sse -p 8080 # Start SSE server on port 8080
|
|
59
|
+
npx @musubix/mcp-server # Run via npx
|
|
60
|
+
`);
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (values.version) {
|
|
65
|
+
console.log(`@musubix/mcp-server v${VERSION}`);
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Start the MCP server
|
|
70
|
+
startServer({
|
|
71
|
+
transport: values.transport,
|
|
72
|
+
port: parseInt(values.port, 10)
|
|
73
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @musubix/mcp-server - Basic Tests
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
describe('@musubix/mcp-server', () => {
|
|
6
|
+
describe('Package Export', () => {
|
|
7
|
+
it('should export MCPServer', async () => {
|
|
8
|
+
const { MCPServer } = await import('../index.js');
|
|
9
|
+
expect(MCPServer).toBeDefined();
|
|
10
|
+
});
|
|
11
|
+
it('should export sddTools', async () => {
|
|
12
|
+
const { sddTools } = await import('../index.js');
|
|
13
|
+
expect(sddTools).toBeDefined();
|
|
14
|
+
expect(Array.isArray(sddTools)).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('should export sddPrompts', async () => {
|
|
17
|
+
const { sddPrompts } = await import('../index.js');
|
|
18
|
+
expect(sddPrompts).toBeDefined();
|
|
19
|
+
expect(Array.isArray(sddPrompts)).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('Tools', () => {
|
|
23
|
+
it('should have tools defined', async () => {
|
|
24
|
+
const { sddTools } = await import('../index.js');
|
|
25
|
+
expect(sddTools.length).toBeGreaterThan(0);
|
|
26
|
+
});
|
|
27
|
+
it('should have valid tool structure', async () => {
|
|
28
|
+
const { sddTools } = await import('../index.js');
|
|
29
|
+
sddTools.forEach((tool) => {
|
|
30
|
+
expect(tool).toHaveProperty('name');
|
|
31
|
+
expect(tool).toHaveProperty('description');
|
|
32
|
+
expect(typeof tool.name).toBe('string');
|
|
33
|
+
expect(typeof tool.description).toBe('string');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('Prompts', () => {
|
|
38
|
+
it('should have prompts defined', async () => {
|
|
39
|
+
const { sddPrompts } = await import('../index.js');
|
|
40
|
+
expect(sddPrompts.length).toBeGreaterThan(0);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;YACvC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;YAClD,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,E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AC,QAAQ,CAAC,CAAC;gBACxC,MAAM,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;YAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;YACnD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @musubix/mcp-server - MUSUBIX MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Model Context Protocol Server for AI Coding Platforms
|
|
5
|
+
*
|
|
6
|
+
* Supported platforms:
|
|
7
|
+
* - Claude Code
|
|
8
|
+
* - GitHub Copilot
|
|
9
|
+
* - Cursor
|
|
10
|
+
* - Gemini CLI
|
|
11
|
+
* - Codex CLI
|
|
12
|
+
* - Qwen Code
|
|
13
|
+
* - Windsurf
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
* @module @musubix/mcp-server
|
|
17
|
+
*
|
|
18
|
+
* @see REQ-INT-102 - MCP Server
|
|
19
|
+
* @see DES-MUSUBIX-001 Section 11 - MCP Server Design
|
|
20
|
+
*/
|
|
21
|
+
export declare const VERSION = "1.0.0";
|
|
22
|
+
export type { ServerTransport, MCPServerConfig, ToolDefinition, ToolHandler, ToolResult, ToolContent, TextContent, ImageContent, ResourceContent, PromptDefinition, PromptArgument, PromptHandler, PromptResult, PromptMessage, ResourceDefinition, ResourceHandler, ResourceResult, ResourceTemplateDefinition, ResourceTemplateHandler, NotificationHandler, ServerCapabilities, } from './types.js';
|
|
23
|
+
export { DEFAULT_SERVER_CONFIG } from './types.js';
|
|
24
|
+
export { MCPServer, createMCPServer, type MCPServerEvents } from './server.js';
|
|
25
|
+
export { sddTools, getSddTools, createRequirementsTool, validateRequirementsTool, createDesignTool, validateDesignTool, createTasksTool, queryKnowledgeTool, updateKnowledgeTool, validateConstitutionTool, validateTraceabilityTool, } from './tools/index.js';
|
|
26
|
+
export { sddPrompts, getSddPrompts, requirementsAnalysisPrompt, requirementsReviewPrompt, designGenerationPrompt, designReviewPrompt, taskDecompositionPrompt, projectSteeringPrompt, } from './prompts/index.js';
|
|
27
|
+
export { sddResources, sddResourceTemplates, getSddResources, getSddResourceTemplates, constitutionResource, earsPatternsResource, c4PatternsResource, adrTemplateResource, requirementDocTemplate, designDocTemplate, taskDocTemplate, } from './resources/index.js';
|
|
28
|
+
export { PlatformAdapter, createPlatformAdapter, getSupportedPlatforms, getPlatformConfig, type PlatformType, type PlatformCapabilities, type PlatformConfig, type PlatformDetectionResult, PLATFORM_CONFIGS, } from './platform/index.js';
|
|
29
|
+
/**
|
|
30
|
+
* MCP Server Entry Point
|
|
31
|
+
*
|
|
32
|
+
* This module provides MCP tools, prompts, and resources for AI platforms.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import { createMCPServer, VERSION, registerSDDTools, registerSDDPrompts, registerSDDResources } from '@musubix/mcp-server';
|
|
37
|
+
*
|
|
38
|
+
* const server = createMCPServer({
|
|
39
|
+
* name: 'my-musubix-server',
|
|
40
|
+
* version: VERSION,
|
|
41
|
+
* transport: 'stdio',
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* // Register all SDD capabilities
|
|
45
|
+
* registerSDDTools(server);
|
|
46
|
+
* registerSDDPrompts(server);
|
|
47
|
+
* registerSDDResources(server);
|
|
48
|
+
*
|
|
49
|
+
* await server.start();
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Start Server Options
|
|
54
|
+
*/
|
|
55
|
+
export interface StartServerOptions {
|
|
56
|
+
/** Transport type: 'stdio' or 'sse' */
|
|
57
|
+
transport?: string;
|
|
58
|
+
/** Port for SSE transport */
|
|
59
|
+
port?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Start the MUSUBIX MCP Server
|
|
63
|
+
*
|
|
64
|
+
* @param options - Server options
|
|
65
|
+
*/
|
|
66
|
+
export declare function startServer(options?: StartServerOptions): Promise<void>;
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG/E,OAAO,EACL,QAAQ,EACR,WAAW,EACX,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,UAAU,EACV,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCjF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @musubix/mcp-server - MUSUBIX MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Model Context Protocol Server for AI Coding Platforms
|
|
5
|
+
*
|
|
6
|
+
* Supported platforms:
|
|
7
|
+
* - Claude Code
|
|
8
|
+
* - GitHub Copilot
|
|
9
|
+
* - Cursor
|
|
10
|
+
* - Gemini CLI
|
|
11
|
+
* - Codex CLI
|
|
12
|
+
* - Qwen Code
|
|
13
|
+
* - Windsurf
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
* @module @musubix/mcp-server
|
|
17
|
+
*
|
|
18
|
+
* @see REQ-INT-102 - MCP Server
|
|
19
|
+
* @see DES-MUSUBIX-001 Section 11 - MCP Server Design
|
|
20
|
+
*/
|
|
21
|
+
// Version
|
|
22
|
+
export const VERSION = '1.0.0';
|
|
23
|
+
export { DEFAULT_SERVER_CONFIG } from './types.js';
|
|
24
|
+
// Server
|
|
25
|
+
export { MCPServer, createMCPServer } from './server.js';
|
|
26
|
+
// SDD Tools
|
|
27
|
+
export { sddTools, getSddTools, createRequirementsTool, validateRequirementsTool, createDesignTool, validateDesignTool, createTasksTool, queryKnowledgeTool, updateKnowledgeTool, validateConstitutionTool, validateTraceabilityTool, } from './tools/index.js';
|
|
28
|
+
// SDD Prompts
|
|
29
|
+
export { sddPrompts, getSddPrompts, requirementsAnalysisPrompt, requirementsReviewPrompt, designGenerationPrompt, designReviewPrompt, taskDecompositionPrompt, projectSteeringPrompt, } from './prompts/index.js';
|
|
30
|
+
// SDD Resources
|
|
31
|
+
export { sddResources, sddResourceTemplates, getSddResources, getSddResourceTemplates, constitutionResource, earsPatternsResource, c4PatternsResource, adrTemplateResource, requirementDocTemplate, designDocTemplate, taskDocTemplate, } from './resources/index.js';
|
|
32
|
+
// Platform Adapter
|
|
33
|
+
export { PlatformAdapter, createPlatformAdapter, getSupportedPlatforms, getPlatformConfig, PLATFORM_CONFIGS, } from './platform/index.js';
|
|
34
|
+
/**
|
|
35
|
+
* Start the MUSUBIX MCP Server
|
|
36
|
+
*
|
|
37
|
+
* @param options - Server options
|
|
38
|
+
*/
|
|
39
|
+
export async function startServer(options = {}) {
|
|
40
|
+
const transport = (options.transport || 'stdio');
|
|
41
|
+
const port = options.port || 3000;
|
|
42
|
+
console.log(`Starting MUSUBIX MCP Server v${VERSION}...`);
|
|
43
|
+
console.log(`Transport: ${transport}${transport === 'sse' ? ` (port: ${port})` : ''}`);
|
|
44
|
+
// Import server and registries
|
|
45
|
+
const { createMCPServer } = await import('./server.js');
|
|
46
|
+
const { sddTools } = await import('./tools/index.js');
|
|
47
|
+
const { sddPrompts } = await import('./prompts/index.js');
|
|
48
|
+
const { sddResources, sddResourceTemplates } = await import('./resources/index.js');
|
|
49
|
+
const server = createMCPServer({
|
|
50
|
+
name: 'musubix-mcp-server',
|
|
51
|
+
version: VERSION,
|
|
52
|
+
transport,
|
|
53
|
+
port,
|
|
54
|
+
});
|
|
55
|
+
// Register all SDD tools, prompts, and resources
|
|
56
|
+
for (const tool of sddTools) {
|
|
57
|
+
server.registerTool(tool);
|
|
58
|
+
}
|
|
59
|
+
for (const prompt of sddPrompts) {
|
|
60
|
+
server.registerPrompt(prompt);
|
|
61
|
+
}
|
|
62
|
+
for (const resource of sddResources) {
|
|
63
|
+
server.registerResource(resource);
|
|
64
|
+
}
|
|
65
|
+
for (const template of sddResourceTemplates) {
|
|
66
|
+
server.registerResourceTemplate(template);
|
|
67
|
+
}
|
|
68
|
+
// Start the server
|
|
69
|
+
await server.start();
|
|
70
|
+
console.log('MUSUBIX MCP Server started successfully.');
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AA2B/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,SAAS;AACT,OAAO,EAAE,SAAS,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAE/E,YAAY;AACZ,OAAO,EACL,QAAQ,EACR,WAAW,EACX,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,cAAc;AACd,OAAO,EACL,UAAU,EACV,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAu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AAC,CAAC;IAEH,iDAAiD;IACjD,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE,CAAC;QACpC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,oBAAoB,EAAE,CAAC;QAC5C,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED,mBAAmB;IACnB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Adapter
|
|
3
|
+
*
|
|
4
|
+
* Adapts MUSUBIX MCP server for different AI coding platforms
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module platform
|
|
8
|
+
*
|
|
9
|
+
* @see REQ-PLAT-101 - Multi-platform Support
|
|
10
|
+
* @see DES-MUSUBIX-001 Section 2.2 - Container Diagram
|
|
11
|
+
*/
|
|
12
|
+
import type { MCPServerConfig, ServerCapabilities } from '../types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Supported AI coding platforms
|
|
15
|
+
*/
|
|
16
|
+
export type PlatformType = 'claude-code' | 'github-copilot' | 'cursor' | 'gemini-cli' | 'codex-cli' | 'qwen-code' | 'windsurf' | 'generic';
|
|
17
|
+
/**
|
|
18
|
+
* Platform-specific configuration
|
|
19
|
+
*/
|
|
20
|
+
export interface PlatformConfig {
|
|
21
|
+
/** Platform identifier */
|
|
22
|
+
platform: PlatformType;
|
|
23
|
+
/** Platform display name */
|
|
24
|
+
displayName: string;
|
|
25
|
+
/** Supported MCP protocol version */
|
|
26
|
+
protocolVersion: string;
|
|
27
|
+
/** Transport preferences */
|
|
28
|
+
preferredTransport: 'stdio' | 'sse';
|
|
29
|
+
/** Platform-specific capabilities */
|
|
30
|
+
capabilities: PlatformCapabilities;
|
|
31
|
+
/** Configuration file location */
|
|
32
|
+
configPath?: string;
|
|
33
|
+
/** Environment variable prefix */
|
|
34
|
+
envPrefix?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Platform-specific capabilities
|
|
38
|
+
*/
|
|
39
|
+
export interface PlatformCapabilities {
|
|
40
|
+
/** Supports tools */
|
|
41
|
+
tools: boolean;
|
|
42
|
+
/** Supports prompts */
|
|
43
|
+
prompts: boolean;
|
|
44
|
+
/** Supports resources */
|
|
45
|
+
resources: boolean;
|
|
46
|
+
/** Supports resource templates */
|
|
47
|
+
resourceTemplates: boolean;
|
|
48
|
+
/** Supports sampling */
|
|
49
|
+
sampling: boolean;
|
|
50
|
+
/** Supports roots */
|
|
51
|
+
roots: boolean;
|
|
52
|
+
/** Maximum context size */
|
|
53
|
+
maxContextSize?: number;
|
|
54
|
+
/** Supports images in responses */
|
|
55
|
+
supportsImages: boolean;
|
|
56
|
+
/** Custom features */
|
|
57
|
+
customFeatures?: string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Platform configurations
|
|
61
|
+
*/
|
|
62
|
+
export declare const PLATFORM_CONFIGS: Record<PlatformType, PlatformConfig>;
|
|
63
|
+
/**
|
|
64
|
+
* Platform detection result
|
|
65
|
+
*/
|
|
66
|
+
export interface PlatformDetectionResult {
|
|
67
|
+
platform: PlatformType;
|
|
68
|
+
confidence: number;
|
|
69
|
+
source: 'environment' | 'client-info' | 'default';
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Platform Adapter
|
|
73
|
+
*
|
|
74
|
+
* Detects and adapts to different AI coding platforms
|
|
75
|
+
*/
|
|
76
|
+
export declare class PlatformAdapter {
|
|
77
|
+
private currentPlatform;
|
|
78
|
+
private platformConfig;
|
|
79
|
+
constructor(platform?: PlatformType);
|
|
80
|
+
/**
|
|
81
|
+
* Get current platform
|
|
82
|
+
*/
|
|
83
|
+
getPlatform(): PlatformType;
|
|
84
|
+
/**
|
|
85
|
+
* Get platform configuration
|
|
86
|
+
*/
|
|
87
|
+
getConfig(): PlatformConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Get platform display name
|
|
90
|
+
*/
|
|
91
|
+
getDisplayName(): string;
|
|
92
|
+
/**
|
|
93
|
+
* Detect platform from environment
|
|
94
|
+
*/
|
|
95
|
+
detectPlatform(): PlatformDetectionResult;
|
|
96
|
+
/**
|
|
97
|
+
* Update platform from client info
|
|
98
|
+
*/
|
|
99
|
+
updateFromClientInfo(clientInfo: {
|
|
100
|
+
name: string;
|
|
101
|
+
version: string;
|
|
102
|
+
}): void;
|
|
103
|
+
/**
|
|
104
|
+
* Get server capabilities adapted for platform
|
|
105
|
+
*/
|
|
106
|
+
getAdaptedCapabilities(baseCapabilities: ServerCapabilities): ServerCapabilities;
|
|
107
|
+
/**
|
|
108
|
+
* Get server config adapted for platform
|
|
109
|
+
*/
|
|
110
|
+
getAdaptedServerConfig(baseConfig: Partial<MCPServerConfig>): MCPServerConfig;
|
|
111
|
+
/**
|
|
112
|
+
* Check if feature is supported
|
|
113
|
+
*/
|
|
114
|
+
supportsFeature(feature: keyof PlatformCapabilities): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get max context size
|
|
117
|
+
*/
|
|
118
|
+
getMaxContextSize(): number;
|
|
119
|
+
/**
|
|
120
|
+
* Generate configuration snippet for platform
|
|
121
|
+
*/
|
|
122
|
+
generateConfigSnippet(serverPath: string): string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create platform adapter instance
|
|
126
|
+
*/
|
|
127
|
+
export declare function createPlatformAdapter(platform?: PlatformType): PlatformAdapter;
|
|
128
|
+
/**
|
|
129
|
+
* Get all supported platforms
|
|
130
|
+
*/
|
|
131
|
+
export declare function getSupportedPlatforms(): PlatformType[];
|
|
132
|
+
/**
|
|
133
|
+
* Get platform config by type
|
|
134
|
+
*/
|
|
135
|
+
export declare function getPlatformConfig(platform: PlatformType): PlatformConfig;
|
|
136
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/platform/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,gBAAgB,GAChB,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UAAU,GACV,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,4BAA4B;IAC5B,kBAAkB,EAAE,OAAO,GAAG,KAAK,CAAC;IACpC,qCAAqC;IACrC,YAAY,EAAE,oBAAoB,CAAC;IACnC,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB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