@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.
Files changed (50) hide show
  1. package/bin/musubix-mcp.js +73 -0
  2. package/dist/__tests__/index.test.d.ts +2 -0
  3. package/dist/__tests__/index.test.d.ts.map +1 -0
  4. package/dist/__tests__/index.test.js +44 -0
  5. package/dist/__tests__/index.test.js.map +1 -0
  6. package/dist/index.d.ts +67 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +72 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/platform/adapter.d.ts +136 -0
  11. package/dist/platform/adapter.d.ts.map +1 -0
  12. package/dist/platform/adapter.js +370 -0
  13. package/dist/platform/adapter.js.map +1 -0
  14. package/dist/platform/index.d.ts +8 -0
  15. package/dist/platform/index.d.ts.map +1 -0
  16. package/dist/platform/index.js +8 -0
  17. package/dist/platform/index.js.map +1 -0
  18. package/dist/prompts/index.d.ts +8 -0
  19. package/dist/prompts/index.d.ts.map +1 -0
  20. package/dist/prompts/index.js +8 -0
  21. package/dist/prompts/index.js.map +1 -0
  22. package/dist/prompts/sdd-prompts.d.ts +45 -0
  23. package/dist/prompts/sdd-prompts.d.ts.map +1 -0
  24. package/dist/prompts/sdd-prompts.js +445 -0
  25. package/dist/prompts/sdd-prompts.js.map +1 -0
  26. package/dist/resources/index.d.ts +8 -0
  27. package/dist/resources/index.d.ts.map +1 -0
  28. package/dist/resources/index.js +8 -0
  29. package/dist/resources/index.js.map +1 -0
  30. package/dist/resources/sdd-resources.d.ts +57 -0
  31. package/dist/resources/sdd-resources.d.ts.map +1 -0
  32. package/dist/resources/sdd-resources.js +629 -0
  33. package/dist/resources/sdd-resources.js.map +1 -0
  34. package/dist/server.d.ts +201 -0
  35. package/dist/server.d.ts.map +1 -0
  36. package/dist/server.js +435 -0
  37. package/dist/server.js.map +1 -0
  38. package/dist/tools/index.d.ts +8 -0
  39. package/dist/tools/index.d.ts.map +1 -0
  40. package/dist/tools/index.js +8 -0
  41. package/dist/tools/index.js.map +1 -0
  42. package/dist/tools/sdd-tools.d.ts +57 -0
  43. package/dist/tools/sdd-tools.d.ts.map +1 -0
  44. package/dist/tools/sdd-tools.js +450 -0
  45. package/dist/tools/sdd-tools.js.map +1 -0
  46. package/dist/types.d.ts +207 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +20 -0
  49. package/dist/types.js.map +1 -0
  50. package/package.json +77 -0
@@ -0,0 +1,207 @@
1
+ /**
2
+ * MCP Server Types
3
+ *
4
+ * Type definitions for MUSUBIX MCP Server
5
+ *
6
+ * @packageDocumentation
7
+ * @module types
8
+ *
9
+ * @see REQ-INT-102 - MCP Server
10
+ */
11
+ /**
12
+ * MCP Server transport type
13
+ */
14
+ export type ServerTransport = 'stdio' | 'sse';
15
+ /**
16
+ * MCP Server configuration
17
+ */
18
+ export interface MCPServerConfig {
19
+ /** Server name */
20
+ name: string;
21
+ /** Server version */
22
+ version: string;
23
+ /** Transport type */
24
+ transport: ServerTransport;
25
+ /** Port for SSE transport */
26
+ port?: number;
27
+ /** Enable debug logging */
28
+ debug?: boolean;
29
+ }
30
+ /**
31
+ * Default server configuration
32
+ */
33
+ export declare const DEFAULT_SERVER_CONFIG: MCPServerConfig;
34
+ /**
35
+ * Tool definition
36
+ */
37
+ export interface ToolDefinition {
38
+ /** Tool name */
39
+ name: string;
40
+ /** Tool description */
41
+ description: string;
42
+ /** Input schema (JSON Schema) */
43
+ inputSchema: Record<string, unknown>;
44
+ /** Handler function */
45
+ handler: ToolHandler;
46
+ }
47
+ /**
48
+ * Tool handler function type
49
+ */
50
+ export type ToolHandler = (args: Record<string, unknown>) => Promise<ToolResult>;
51
+ /**
52
+ * Tool execution result
53
+ */
54
+ export interface ToolResult {
55
+ /** Result content */
56
+ content: ToolContent[];
57
+ /** Is error result */
58
+ isError?: boolean;
59
+ }
60
+ /**
61
+ * Tool content types
62
+ */
63
+ export type ToolContent = TextContent | ImageContent | ResourceContent;
64
+ /**
65
+ * Text content
66
+ */
67
+ export interface TextContent {
68
+ type: 'text';
69
+ text: string;
70
+ }
71
+ /**
72
+ * Image content
73
+ */
74
+ export interface ImageContent {
75
+ type: 'image';
76
+ data: string;
77
+ mimeType: string;
78
+ }
79
+ /**
80
+ * Resource content
81
+ */
82
+ export interface ResourceContent {
83
+ type: 'resource';
84
+ resource: {
85
+ uri: string;
86
+ mimeType: string;
87
+ text?: string;
88
+ blob?: string;
89
+ };
90
+ }
91
+ /**
92
+ * Prompt definition
93
+ */
94
+ export interface PromptDefinition {
95
+ /** Prompt name */
96
+ name: string;
97
+ /** Prompt description */
98
+ description: string;
99
+ /** Arguments */
100
+ arguments?: PromptArgument[];
101
+ /** Handler function */
102
+ handler: PromptHandler;
103
+ }
104
+ /**
105
+ * Prompt argument
106
+ */
107
+ export interface PromptArgument {
108
+ /** Argument name */
109
+ name: string;
110
+ /** Argument description */
111
+ description: string;
112
+ /** Is required */
113
+ required: boolean;
114
+ }
115
+ /**
116
+ * Prompt handler function type
117
+ */
118
+ export type PromptHandler = (args: Record<string, string>) => Promise<PromptResult>;
119
+ /**
120
+ * Prompt result
121
+ */
122
+ export interface PromptResult {
123
+ /** Prompt description */
124
+ description?: string;
125
+ /** Messages */
126
+ messages: PromptMessage[];
127
+ }
128
+ /**
129
+ * Prompt message
130
+ */
131
+ export interface PromptMessage {
132
+ /** Role */
133
+ role: 'user' | 'assistant';
134
+ /** Content */
135
+ content: TextContent | ImageContent;
136
+ }
137
+ /**
138
+ * Resource definition
139
+ */
140
+ export interface ResourceDefinition {
141
+ /** Resource URI */
142
+ uri: string;
143
+ /** Resource name */
144
+ name: string;
145
+ /** Resource description */
146
+ description?: string;
147
+ /** MIME type */
148
+ mimeType?: string;
149
+ /** Handler function */
150
+ handler: ResourceHandler;
151
+ }
152
+ /**
153
+ * Resource handler function type
154
+ */
155
+ export type ResourceHandler = () => Promise<ResourceResult>;
156
+ /**
157
+ * Resource result
158
+ */
159
+ export interface ResourceResult {
160
+ /** Resource contents */
161
+ contents: Array<{
162
+ uri: string;
163
+ mimeType: string;
164
+ text?: string;
165
+ blob?: string;
166
+ }>;
167
+ }
168
+ /**
169
+ * Resource template definition
170
+ */
171
+ export interface ResourceTemplateDefinition {
172
+ /** URI template */
173
+ uriTemplate: string;
174
+ /** Template name */
175
+ name: string;
176
+ /** Template description */
177
+ description?: string;
178
+ /** MIME type */
179
+ mimeType?: string;
180
+ /** Handler function */
181
+ handler: ResourceTemplateHandler;
182
+ }
183
+ /**
184
+ * Resource template handler function type
185
+ */
186
+ export type ResourceTemplateHandler = (uri: string, params: Record<string, string>) => Promise<ResourceResult>;
187
+ /**
188
+ * JSON-RPC notification handler
189
+ */
190
+ export type NotificationHandler = (method: string, params: Record<string, unknown>) => void;
191
+ /**
192
+ * Server capabilities
193
+ */
194
+ export interface ServerCapabilities {
195
+ tools?: {
196
+ listChanged?: boolean;
197
+ };
198
+ prompts?: {
199
+ listChanged?: boolean;
200
+ };
201
+ resources?: {
202
+ subscribe?: boolean;
203
+ listChanged?: boolean;
204
+ };
205
+ logging?: Record<string, never>;
206
+ }
207
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,SAAS,EAAE,eAAe,CAAC;IAC3B,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,e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I,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3B,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACjC"}
package/dist/types.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * MCP Server Types
3
+ *
4
+ * Type definitions for MUSUBIX MCP Server
5
+ *
6
+ * @packageDocumentation
7
+ * @module types
8
+ *
9
+ * @see REQ-INT-102 - MCP Server
10
+ */
11
+ /**
12
+ * Default server configuration
13
+ */
14
+ export const DEFAULT_SERVER_CONFIG = {
15
+ name: 'musubix-mcp-server',
16
+ version: '0.1.0',
17
+ transport: 'stdio',
18
+ debug: false,
19
+ };
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,KAAK;CACb,CAAC"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@nahisaho/musubix-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "MUSUBIX MCP Server - Model Context Protocol Server for AI Platforms",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./tools": {
14
+ "import": "./dist/tools/index.js",
15
+ "types": "./dist/tools/index.d.ts"
16
+ },
17
+ "./prompts": {
18
+ "import": "./dist/prompts/index.js",
19
+ "types": "./dist/prompts/index.d.ts"
20
+ },
21
+ "./resources": {
22
+ "import": "./dist/resources/index.js",
23
+ "types": "./dist/resources/index.d.ts"
24
+ },
25
+ "./transport": {
26
+ "import": "./dist/transport/index.js",
27
+ "types": "./dist/transport/index.d.ts"
28
+ }
29
+ },
30
+ "bin": {
31
+ "musubix-mcp": "./bin/musubix-mcp.js"
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "bin"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc -p tsconfig.json",
39
+ "clean": "rm -rf dist *.tsbuildinfo",
40
+ "test": "vitest run",
41
+ "test:unit": "vitest run --dir __tests__/unit",
42
+ "test:integration": "vitest run --dir __tests__/integration",
43
+ "test:watch": "vitest",
44
+ "typecheck": "tsc --noEmit"
45
+ },
46
+ "dependencies": {
47
+ "@modelcontextprotocol/sdk": "^0.5.0",
48
+ "zod": "^3.22.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^20.10.0",
52
+ "typescript": "^5.3.0",
53
+ "vitest": "^1.0.0"
54
+ },
55
+ "peerDependencies": {
56
+ "@nahisaho/musubix-core": ">=0.1.0"
57
+ },
58
+ "keywords": [
59
+ "musubix",
60
+ "mcp",
61
+ "model-context-protocol",
62
+ "ai",
63
+ "claude",
64
+ "copilot",
65
+ "cursor"
66
+ ],
67
+ "repository": {
68
+ "type": "git",
69
+ "url": "https://github.com/nahisaho/MUSUBIX.git",
70
+ "directory": "packages/mcp-server"
71
+ },
72
+ "homepage": "https://github.com/nahisaho/MUSUBIX/tree/main/packages/mcp-server",
73
+ "publishConfig": {
74
+ "access": "public"
75
+ },
76
+ "license": "MIT"
77
+ }