@atlashub/smartstack-mcp 1.1.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/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # @smartstack/mcp-server
2
+
3
+ MCP (Model Context Protocol) server for SmartStack/AtlasHub platform development.
4
+
5
+ ## Features
6
+
7
+ ### Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `validate_conventions` | Validate AtlasHub conventions (SQL schemas, domain table prefixes, migration naming, service interfaces) |
12
+ | `check_migrations` | Analyze EF Core migrations for conflicts and ordering issues |
13
+ | `scaffold_extension` | Generate code for services, entities, controllers, or React components |
14
+ | `api_docs` | Get API endpoint documentation from Swagger or code analysis |
15
+
16
+ ### Resources
17
+
18
+ | Resource URI | Description |
19
+ |--------------|-------------|
20
+ | `smartstack://conventions` | AtlasHub naming conventions and best practices |
21
+ | `smartstack://project` | Current project information and structure |
22
+ | `smartstack://api/{endpoint}` | API endpoint documentation |
23
+ | `smartstack://schema/{table}` | Database schema information |
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ # Clone and install dependencies
29
+ cd "D:\01 - projets\SmartStack.mcp\02-Develop"
30
+ npm install
31
+
32
+ # Build
33
+ npm run build
34
+ ```
35
+
36
+ ## Configuration
37
+
38
+ ### Environment Variables
39
+
40
+ | Variable | Description | Default |
41
+ |----------|-------------|---------|
42
+ | `SMARTSTACK_PROJECT_PATH` | Path to SmartStack.app project | `D:/SmartStack.app/features/Rework-to-package` |
43
+ | `SMARTSTACK_API_URL` | SmartStack API URL | `https://localhost:7055` |
44
+ | `SMARTSTACK_API_ENABLED` | Enable API integration | `true` |
45
+ | `LOG_LEVEL` | Logging level (debug, info, warn, error) | `info` |
46
+
47
+ ### Claude Desktop Configuration
48
+
49
+ Add to your Claude Desktop config file (`claude_desktop_config.json`):
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "smartstack": {
55
+ "command": "node",
56
+ "args": ["D:/01 - projets/SmartStack.mcp/02-Develop/dist/index.js"],
57
+ "env": {
58
+ "SMARTSTACK_PROJECT_PATH": "D:/SmartStack.app/features/Rework-to-package",
59
+ "SMARTSTACK_API_URL": "https://localhost:7055"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### Claude Code Configuration
67
+
68
+ Add to your `.claude/settings.json`:
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "smartstack": {
74
+ "command": "node",
75
+ "args": ["D:/01 - projets/SmartStack.mcp/02-Develop/dist/index.js"],
76
+ "env": {
77
+ "SMARTSTACK_PROJECT_PATH": "D:/SmartStack.app/features/Rework-to-package"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
84
+ ## Usage Examples
85
+
86
+ ### Validate Conventions
87
+
88
+ ```
89
+ Use validate_conventions tool with checks: ["tables", "migrations", "services"]
90
+ ```
91
+
92
+ ### Check Migrations
93
+
94
+ ```
95
+ Use check_migrations tool with compareBranch: "develop"
96
+ ```
97
+
98
+ ### Scaffold a Service
99
+
100
+ ```
101
+ Use scaffold_extension tool with:
102
+ - type: "service"
103
+ - name: "UserProfile"
104
+ - options: { methods: ["GetByIdAsync", "UpdateAsync"] }
105
+ ```
106
+
107
+ ### Get API Documentation
108
+
109
+ ```
110
+ Use api_docs tool with:
111
+ - endpoint: "/api/users"
112
+ - format: "markdown"
113
+ ```
114
+
115
+ ## Development
116
+
117
+ ```bash
118
+ # Watch mode
119
+ npm run dev
120
+
121
+ # Test with MCP Inspector
122
+ npm run inspect
123
+
124
+ # Type check
125
+ npm run typecheck
126
+
127
+ # Lint
128
+ npm run lint
129
+ ```
130
+
131
+ ## Project Structure
132
+
133
+ ```
134
+ src/
135
+ ├── index.ts # Entry point
136
+ ├── server.ts # MCP server configuration
137
+ ├── config.ts # Configuration management
138
+ ├── tools/ # MCP tool implementations
139
+ │ ├── validate-conventions.ts
140
+ │ ├── check-migrations.ts
141
+ │ ├── scaffold-extension.ts
142
+ │ └── api-docs.ts
143
+ ├── resources/ # MCP resource implementations
144
+ │ ├── conventions.ts
145
+ │ ├── project-info.ts
146
+ │ ├── api-endpoints.ts
147
+ │ └── db-schema.ts
148
+ ├── lib/ # Shared libraries
149
+ │ ├── detector.ts # Project detection
150
+ │ └── logger.ts # Logging utilities
151
+ ├── types/ # TypeScript types
152
+ │ └── index.ts
153
+ └── utils/ # Utility functions
154
+ ├── fs.ts # File system operations
155
+ ├── git.ts # Git commands
156
+ └── dotnet.ts # .NET CLI commands
157
+ ```
158
+
159
+ ## AtlasHub Conventions
160
+
161
+ This MCP server enforces the following conventions:
162
+
163
+ ### SQL Schemas
164
+ - **`core`**: SmartStack platform tables
165
+ - **`extensions`**: Client extension tables
166
+
167
+ ### Table Prefixes (by domain)
168
+ Tables use domain-specific prefixes within schemas:
169
+ - `auth_*` - Authorization (Users, Roles, Permissions)
170
+ - `nav_*` - Navigation (Contexts, Applications, Modules)
171
+ - `usr_*` - User profiles (Profiles, Preferences)
172
+ - `ai_*` - AI features (Providers, Models, Prompts)
173
+ - `cfg_*` - Configuration (Settings)
174
+ - `wkf_*` - Workflows (EmailTemplates, Workflows)
175
+ - `support_*` - Support (Tickets, Comments)
176
+ - `entra_*` - Entra sync (Groups, SyncState)
177
+ - `ref_*` - References (Companies, Departments)
178
+ - `loc_*` - Localization (Languages, Translations)
179
+ - `lic_*` - Licensing (Licenses)
180
+
181
+ Example: `.ToTable("auth_Users", "core")`
182
+
183
+ ### Migration Naming
184
+ Format: `YYYYMMDD_NNN_Description`
185
+ - Example: `20260115_001_InitialSchema`
186
+
187
+ ### Service Pattern
188
+ - Interface: `I{Name}Service`
189
+ - Implementation: `{Name}Service`
190
+
191
+ ### Namespace Structure
192
+ - Domain: `SmartStack.Domain`
193
+ - Application: `SmartStack.Application`
194
+ - Infrastructure: `SmartStack.Infrastructure`
195
+ - API: `SmartStack.Api`
196
+
197
+ ## License
198
+
199
+ MIT - AtlasHub
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://atlashub.ch/schemas/smartstack-mcp-config.json",
3
+ "version": "1.0.0",
4
+ "smartstack": {
5
+ "projectPath": "D:/SmartStack.app/features/Rework-to-package",
6
+ "apiUrl": "https://localhost:7055",
7
+ "apiEnabled": true
8
+ },
9
+ "conventions": {
10
+ "schemas": {
11
+ "platform": "core",
12
+ "extensions": "extensions"
13
+ },
14
+ "tablePrefixes": [
15
+ "auth_",
16
+ "nav_",
17
+ "usr_",
18
+ "ai_",
19
+ "cfg_",
20
+ "wkf_",
21
+ "support_",
22
+ "entra_",
23
+ "ref_",
24
+ "loc_",
25
+ "lic_"
26
+ ],
27
+ "migrationFormat": "YYYYMMDD_NNN_{Description}",
28
+ "namespaces": {
29
+ "domain": "SmartStack.Domain",
30
+ "application": "SmartStack.Application",
31
+ "infrastructure": "SmartStack.Infrastructure",
32
+ "api": "SmartStack.Api"
33
+ },
34
+ "servicePattern": {
35
+ "interface": "I{Name}Service",
36
+ "implementation": "{Name}Service"
37
+ }
38
+ },
39
+ "efcore": {
40
+ "contexts": [
41
+ {
42
+ "name": "ApplicationDbContext",
43
+ "projectPath": "auto-detect",
44
+ "migrationsFolder": "Migrations"
45
+ }
46
+ ],
47
+ "validation": {
48
+ "checkModelSnapshot": true,
49
+ "checkMigrationOrder": true,
50
+ "requireBuildSuccess": true
51
+ }
52
+ },
53
+ "scaffolding": {
54
+ "outputPath": "auto-detect",
55
+ "templates": {
56
+ "service": "templates/service-extension.cs.hbs",
57
+ "entity": "templates/entity-extension.cs.hbs",
58
+ "controller": "templates/controller.cs.hbs",
59
+ "component": "templates/component.tsx.hbs"
60
+ }
61
+ }
62
+ }
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node