@mbc-cqrs-serverless/mcp-server 1.0.15
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/LICENSE.txt +7 -0
- package/README.md +196 -0
- package/bin/mcp-server.js +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/cqrs-guide.d.ts +8 -0
- package/dist/prompts/cqrs-guide.js +467 -0
- package/dist/prompts/cqrs-guide.js.map +1 -0
- package/dist/prompts/index.d.ts +11 -0
- package/dist/prompts/index.js +33 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/documentation.d.ts +12 -0
- package/dist/resources/documentation.js +131 -0
- package/dist/resources/documentation.js.map +1 -0
- package/dist/resources/errors.d.ts +12 -0
- package/dist/resources/errors.js +75 -0
- package/dist/resources/errors.js.map +1 -0
- package/dist/resources/index.d.ts +15 -0
- package/dist/resources/index.js +33 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/project.d.ts +12 -0
- package/dist/resources/project.js +193 -0
- package/dist/resources/project.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.js +113 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/analyze.d.ts +15 -0
- package/dist/tools/analyze.js +304 -0
- package/dist/tools/analyze.js.map +1 -0
- package/dist/tools/generate.d.ts +15 -0
- package/dist/tools/generate.js +153 -0
- package/dist/tools/generate.js.map +1 -0
- package/dist/tools/generator.d.ts +41 -0
- package/dist/tools/generator.js +241 -0
- package/dist/tools/generator.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.js +39 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/validate.d.ts +15 -0
- package/dist/tools/validate.js +204 -0
- package/dist/tools/validate.js.map +1 -0
- package/package.json +60 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2024 Murakami Business Consulting, Inc. https://www.mbc-net.com/
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# @mbc-cqrs-serverless/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for MBC CQRS Serverless framework. This package enables AI tools like Claude Code, Cursor, and other MCP-compatible clients to interact with the framework.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Resources
|
|
8
|
+
|
|
9
|
+
Access framework documentation and project information:
|
|
10
|
+
|
|
11
|
+
| Resource URI | Description |
|
|
12
|
+
|--------------|-------------|
|
|
13
|
+
| `mbc://docs/overview` | Complete framework documentation |
|
|
14
|
+
| `mbc://docs/llms-short` | Concise framework summary |
|
|
15
|
+
| `mbc://docs/architecture` | CQRS architecture guide |
|
|
16
|
+
| `mbc://docs/errors` | Error catalog with solutions |
|
|
17
|
+
| `mbc://docs/faq` | Frequently asked questions |
|
|
18
|
+
| `mbc://docs/troubleshooting` | Troubleshooting guide |
|
|
19
|
+
| `mbc://docs/security` | Security best practices |
|
|
20
|
+
| `mbc://project/entities` | List of project entities |
|
|
21
|
+
| `mbc://project/modules` | List of project modules |
|
|
22
|
+
| `mbc://project/structure` | Project directory structure |
|
|
23
|
+
|
|
24
|
+
### Tools
|
|
25
|
+
|
|
26
|
+
Generate code and analyze projects:
|
|
27
|
+
|
|
28
|
+
| Tool | Description |
|
|
29
|
+
|------|-------------|
|
|
30
|
+
| `mbc_generate_module` | Generate a complete CQRS module |
|
|
31
|
+
| `mbc_generate_controller` | Generate a controller |
|
|
32
|
+
| `mbc_generate_service` | Generate a service |
|
|
33
|
+
| `mbc_generate_entity` | Generate an entity |
|
|
34
|
+
| `mbc_generate_dto` | Generate a DTO |
|
|
35
|
+
| `mbc_validate_cqrs` | Validate CQRS pattern implementation |
|
|
36
|
+
| `mbc_analyze_project` | Analyze project structure |
|
|
37
|
+
| `mbc_lookup_error` | Look up error solutions |
|
|
38
|
+
|
|
39
|
+
### Prompts
|
|
40
|
+
|
|
41
|
+
Get guided assistance:
|
|
42
|
+
|
|
43
|
+
| Prompt | Description |
|
|
44
|
+
|--------|-------------|
|
|
45
|
+
| `cqrs_implementation_guide` | Step-by-step CQRS implementation |
|
|
46
|
+
| `debug_command_error` | Debug command-related errors |
|
|
47
|
+
| `migration_guide` | Version migration guidance |
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install @mbc-cqrs-serverless/mcp-server
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or use directly with npx:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx @mbc-cqrs-serverless/mcp-server
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
### Claude Code
|
|
64
|
+
|
|
65
|
+
Add to `~/.claude/claude_desktop_config.json`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"mbc-cqrs-serverless": {
|
|
71
|
+
"command": "npx",
|
|
72
|
+
"args": ["@mbc-cqrs-serverless/mcp-server"],
|
|
73
|
+
"env": {
|
|
74
|
+
"MBC_PROJECT_PATH": "/path/to/your/project"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Cursor
|
|
82
|
+
|
|
83
|
+
Add to Cursor's MCP settings:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mbc-cqrs-serverless": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["@mbc-cqrs-serverless/mcp-server"],
|
|
90
|
+
"env": {
|
|
91
|
+
"MBC_PROJECT_PATH": "/path/to/your/project"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Environment Variables
|
|
98
|
+
|
|
99
|
+
| Variable | Description | Default |
|
|
100
|
+
|----------|-------------|---------|
|
|
101
|
+
| `MBC_PROJECT_PATH` | Path to the project directory | Current working directory |
|
|
102
|
+
|
|
103
|
+
## Usage Examples
|
|
104
|
+
|
|
105
|
+
### With Claude Code
|
|
106
|
+
|
|
107
|
+
Once configured, you can ask Claude Code to:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
"Generate a new Order module with async command handling"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Claude Code will use the `mbc_generate_module` tool to create the module.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
"Analyze my project structure"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Claude Code will use the `mbc_analyze_project` tool to provide insights.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
"I'm getting a version mismatch error, help me debug"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Claude Code will use the `debug_command_error` prompt and `mbc_lookup_error` tool.
|
|
126
|
+
|
|
127
|
+
### Resource Access
|
|
128
|
+
|
|
129
|
+
AI tools can access framework documentation:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Read mbc://docs/errors to understand common errors
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Code Generation
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Use mbc_generate_module to create a Product module with sync mode
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Project Analysis
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Run mbc_validate_cqrs to check my CQRS implementation
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
### Building
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
cd packages/mcp-server
|
|
153
|
+
npm install
|
|
154
|
+
npm run build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Testing
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Run the server locally
|
|
161
|
+
npm start
|
|
162
|
+
|
|
163
|
+
# Or with a specific project path
|
|
164
|
+
MBC_PROJECT_PATH=/path/to/project npm start
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Architecture
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
171
|
+
│ AI Tools (Claude Code, Cursor, etc.) │
|
|
172
|
+
│ │ │
|
|
173
|
+
│ MCP Protocol (stdio) │
|
|
174
|
+
│ ↓ │
|
|
175
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
176
|
+
│ │ @mbc-cqrs-serverless/mcp-server │ │
|
|
177
|
+
│ │ │ │
|
|
178
|
+
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────┐ │ │
|
|
179
|
+
│ │ │ Resources │ │ Tools │ │ Prompts │ │ │
|
|
180
|
+
│ │ │ │ │ │ │ │ │ │
|
|
181
|
+
│ │ │ - docs │ │ - generate │ │ - cqrs_guide │ │ │
|
|
182
|
+
│ │ │ - project │ │ - validate │ │ - debug │ │ │
|
|
183
|
+
│ │ │ - errors │ │ - analyze │ │ - migration │ │ │
|
|
184
|
+
│ │ └─────────────┘ └─────────────┘ └──────────────┘ │ │
|
|
185
|
+
│ └───────────────────────────────────────────────────────┘ │
|
|
186
|
+
└─────────────────────────────────────────────────────────────┘
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT
|
|
192
|
+
|
|
193
|
+
## Related Packages
|
|
194
|
+
|
|
195
|
+
- [@mbc-cqrs-serverless/core](../core) - Core CQRS framework
|
|
196
|
+
- [@mbc-cqrs-serverless/cli](../cli) - CLI tool for code generation
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MCP Server executable for MBC CQRS Serverless framework.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx @mbc-cqrs-serverless/mcp-server
|
|
8
|
+
*
|
|
9
|
+
* Environment Variables:
|
|
10
|
+
* MBC_PROJECT_PATH - Path to the project directory (defaults to cwd)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
require('../dist/index.js')
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const server_js_1 = require("./server.js");
|
|
5
|
+
/**
|
|
6
|
+
* MCP Server for MBC CQRS Serverless framework.
|
|
7
|
+
*
|
|
8
|
+
* This server provides:
|
|
9
|
+
* - Resources: Framework documentation, error catalog, project info
|
|
10
|
+
* - Tools: Code generation, validation, analysis
|
|
11
|
+
* - Prompts: CQRS implementation guides, debugging help
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Run the server
|
|
15
|
+
* npx @mbc-cqrs-serverless/mcp-server
|
|
16
|
+
*
|
|
17
|
+
* // Configure in Claude Code
|
|
18
|
+
* // Add to ~/.claude/claude_desktop_config.json:
|
|
19
|
+
* {
|
|
20
|
+
* "mcpServers": {
|
|
21
|
+
* "mbc-cqrs-serverless": {
|
|
22
|
+
* "command": "npx",
|
|
23
|
+
* "args": ["@mbc-cqrs-serverless/mcp-server"],
|
|
24
|
+
* "env": {
|
|
25
|
+
* "MBC_PROJECT_PATH": "/path/to/your/project"
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
*/
|
|
31
|
+
// Global error handlers
|
|
32
|
+
process.on('uncaughtException', (error) => {
|
|
33
|
+
console.error('[Uncaught Exception]', error);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
});
|
|
36
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
37
|
+
console.error('[Unhandled Rejection]', reason);
|
|
38
|
+
});
|
|
39
|
+
async function main() {
|
|
40
|
+
try {
|
|
41
|
+
const server = new server_js_1.McpServer();
|
|
42
|
+
await server.run();
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('[Fatal Error]', error);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
main();
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,wBAAwB;AACxB,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAA;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAA;AAChD,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,qBAAS,EAAE,CAAA;QAC9B,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* CQRS implementation guide prompts.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCqrsPrompts(): Prompt[];
|
|
6
|
+
export declare function getCqrsPromptMessages(name: string, args: Record<string, string>): {
|
|
7
|
+
messages: PromptMessage[];
|
|
8
|
+
};
|