@stackguide/mcp-server 1.0.1 โ 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 +38 -345
- package/dist/index.js +337 -1
- package/dist/index.js.map +1 -1
- package/dist/services/autoDetect.d.ts +47 -0
- package/dist/services/autoDetect.d.ts.map +1 -0
- package/dist/services/autoDetect.js +550 -0
- package/dist/services/autoDetect.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,60 +1,12 @@
|
|
|
1
1
|
# StackGuide MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Dynamic context loading for AI coding assistants. Works with **Cursor** and **GitHub Copilot**.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- ๐ **Rules Management**: Select and apply coding standards, best practices, and security guidelines
|
|
9
|
-
- ๐ **Knowledge Base**: Access architecture patterns, common issues solutions, and code snippets
|
|
10
|
-
- ๐พ **Configuration Persistence**: Save and load your preferred configurations
|
|
11
|
-
- ๐ **Compatible**: Works with both Cursor and GitHub Copilot
|
|
12
|
-
- โจ **Dynamic Rule Management**: Create, edit, and delete rules at runtime using tools
|
|
13
|
-
- ๐ **Web Documentation**: Fetch and cache documentation from any URL
|
|
14
|
-
- ๐ **Rule Templates**: Quick-start templates for common rule types (coding-standard, best-practice, security, architecture, testing)
|
|
15
|
-
- ๐ **Cursor Directory Integration**: Browse, search, and import rules from [cursor.directory](https://cursor.directory/rules/) - a community-driven repository of AI coding rules
|
|
16
|
-
|
|
17
|
-
## Supported Project Types
|
|
18
|
-
|
|
19
|
-
| Type | Languages | Frameworks |
|
|
20
|
-
|------|-----------|------------|
|
|
21
|
-
| `python-django` | Python | Django, DRF |
|
|
22
|
-
| `python-fastapi` | Python | FastAPI |
|
|
23
|
-
| `python-flask` | Python | Flask |
|
|
24
|
-
| `react-node` | JavaScript, TypeScript | React, Node.js, Express |
|
|
25
|
-
| `react-typescript` | TypeScript | React |
|
|
26
|
-
| `vue-node` | JavaScript, TypeScript | Vue.js, Node.js |
|
|
27
|
-
| `nextjs` | JavaScript, TypeScript | Next.js, React |
|
|
28
|
-
| `express` | JavaScript, TypeScript | Express.js |
|
|
29
|
-
| `nestjs` | TypeScript | NestJS |
|
|
30
|
-
| `laravel` | PHP | Laravel |
|
|
31
|
-
| `rails` | Ruby | Ruby on Rails |
|
|
32
|
-
| `golang` | Go | - |
|
|
33
|
-
| `rust` | Rust | - |
|
|
34
|
-
|
|
35
|
-
## Installation
|
|
36
|
-
|
|
37
|
-
### From npm (Recommended)
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm install -g @stackguide/mcp-server
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### From Source
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
git clone https://github.com/taimiralain/StackGuide-MCP.git
|
|
47
|
-
cd StackGuide-MCP
|
|
48
|
-
npm install
|
|
49
|
-
npm run build
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Configuration
|
|
53
|
-
|
|
54
|
-
### For Cursor
|
|
55
|
-
|
|
56
|
-
Add to your Cursor settings (`.cursor/mcp.json`):
|
|
7
|
+
### 1. Configure
|
|
57
8
|
|
|
9
|
+
**Cursor** (`.cursor/mcp.json`):
|
|
58
10
|
```json
|
|
59
11
|
{
|
|
60
12
|
"mcpServers": {
|
|
@@ -66,23 +18,7 @@ Add to your Cursor settings (`.cursor/mcp.json`):
|
|
|
66
18
|
}
|
|
67
19
|
```
|
|
68
20
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"mcpServers": {
|
|
74
|
-
"stackguide": {
|
|
75
|
-
"command": "node",
|
|
76
|
-
"args": ["/path/to/StackGuide-MCP/dist/index.js"]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### For VS Code with GitHub Copilot
|
|
83
|
-
|
|
84
|
-
Add to `.vscode/mcp.json` in your workspace:
|
|
85
|
-
|
|
21
|
+
**VS Code** (`.vscode/mcp.json`):
|
|
86
22
|
```json
|
|
87
23
|
{
|
|
88
24
|
"mcpServers": {
|
|
@@ -94,302 +30,59 @@ Add to `.vscode/mcp.json` in your workspace:
|
|
|
94
30
|
}
|
|
95
31
|
```
|
|
96
32
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"github.copilot.chat.mcpServers": {
|
|
102
|
-
"stackguide": {
|
|
103
|
-
"command": "npx",
|
|
104
|
-
"args": ["-y", "@stackguide/mcp-server"]
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Usage
|
|
111
|
-
|
|
112
|
-
### Available Tools
|
|
113
|
-
|
|
114
|
-
#### Project Type Management
|
|
115
|
-
- `list_project_types` - List all supported project types
|
|
116
|
-
- `select_project_type` - Activate a project type context
|
|
117
|
-
- `get_current_context` - Get the currently active context
|
|
118
|
-
|
|
119
|
-
#### Rules Management
|
|
120
|
-
- `list_rules` - List available rules for current project
|
|
121
|
-
- `get_rule` - Get full content of a specific rule
|
|
122
|
-
- `select_rules` - Select which rules to include in context
|
|
123
|
-
- `search_rules` - Search rules by keyword
|
|
124
|
-
|
|
125
|
-
#### Knowledge Base
|
|
126
|
-
- `list_knowledge` - List knowledge base files
|
|
127
|
-
- `get_knowledge` - Get content of a knowledge file
|
|
128
|
-
- `select_knowledge` - Select knowledge to include
|
|
129
|
-
- `search_knowledge` - Search knowledge base
|
|
130
|
-
|
|
131
|
-
#### Configuration
|
|
132
|
-
- `save_configuration` - Save current context setup
|
|
133
|
-
- `load_configuration` - Load a saved configuration
|
|
134
|
-
- `list_configurations` - List all saved configurations
|
|
135
|
-
- `delete_configuration` - Delete a configuration
|
|
136
|
-
- `export_configuration` - Export config as JSON
|
|
137
|
-
- `import_configuration` - Import config from JSON
|
|
138
|
-
|
|
139
|
-
#### Dynamic Rule Management (NEW!)
|
|
140
|
-
- `create_rule` - Create a new custom rule from scratch
|
|
141
|
-
- `create_rule_from_template` - Create a rule using a template
|
|
142
|
-
- `list_rule_templates` - List available rule templates
|
|
143
|
-
- `update_rule` - Update an existing user rule
|
|
144
|
-
- `delete_rule` - Delete a user rule
|
|
145
|
-
- `list_user_rules` - List all user-created rules
|
|
146
|
-
- `export_user_rules` - Export all user rules as JSON
|
|
147
|
-
- `import_user_rules` - Import user rules from JSON
|
|
148
|
-
|
|
149
|
-
#### Web Documentation (NEW!)
|
|
150
|
-
- `fetch_web_docs` - Fetch documentation from any URL
|
|
151
|
-
- `fetch_multiple_docs` - Fetch multiple URLs at once
|
|
152
|
-
- `get_web_doc` - Get a cached web document
|
|
153
|
-
- `search_web_docs` - Search cached documentation
|
|
154
|
-
- `list_web_docs` - List all cached documents
|
|
155
|
-
- `get_suggested_docs` - Get suggested docs for a project type
|
|
156
|
-
- `remove_web_doc` - Remove a cached document
|
|
157
|
-
|
|
158
|
-
#### Cursor Directory Integration (NEW!)
|
|
159
|
-
- `browse_cursor_directory` - Browse rules by category from cursor.directory
|
|
160
|
-
- `search_cursor_directory` - Search for rules on cursor.directory
|
|
161
|
-
- `get_cursor_directory_rule` - Get a specific rule by slug
|
|
162
|
-
- `list_cursor_directory_categories` - List all available categories
|
|
163
|
-
- `get_popular_cursor_rules` - Get popular/featured rules
|
|
164
|
-
- `import_cursor_directory_rule` - Import a rule into your local collection
|
|
165
|
-
|
|
166
|
-
#### Context
|
|
167
|
-
- `get_full_context` - Get complete active context
|
|
168
|
-
- `add_custom_rule` - Add a custom rule
|
|
169
|
-
|
|
170
|
-
### Example Workflow
|
|
171
|
-
|
|
172
|
-
1. **Select your project type:**
|
|
173
|
-
```
|
|
174
|
-
Use select_project_type with "react-node"
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
2. **View available rules:**
|
|
178
|
-
```
|
|
179
|
-
Use list_rules to see all available rules
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
3. **Select specific rules:**
|
|
183
|
-
```
|
|
184
|
-
Use select_rules with the IDs of rules you want
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
4. **Save your configuration:**
|
|
188
|
-
```
|
|
189
|
-
Use save_configuration with a name like "My React Setup"
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
5. **Get full context for AI:**
|
|
193
|
-
```
|
|
194
|
-
Use get_full_context to get all selected rules and knowledge
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Available Resources
|
|
198
|
-
|
|
199
|
-
- `rules://{project_type}/all` - All rules for a project type
|
|
200
|
-
- `knowledge://{project_type}/all` - All knowledge for a project type
|
|
201
|
-
- `context://active` - Currently active context (includes rules, user rules, knowledge, and web docs)
|
|
202
|
-
- `user-rules://{project_type}/all` - All user-created rules for a project type
|
|
203
|
-
- `web-doc://{doc_id}` - Specific cached web document
|
|
204
|
-
- `templates://rules` - Available rule templates
|
|
33
|
+
### 2. Use
|
|
205
34
|
|
|
206
|
-
|
|
35
|
+
Just tell your AI assistant in natural language:
|
|
207
36
|
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
37
|
+
- *"Set up my project"* โ Auto-detects and configures everything
|
|
38
|
+
- *"I'm working on a Django API"* โ Configures Python/Django context
|
|
39
|
+
- *"Configure for React with TypeScript"* โ Sets up React-TS rules
|
|
40
|
+
- *"Browse Python rules from cursor directory"* โ Shows community rules
|
|
211
41
|
|
|
212
|
-
##
|
|
42
|
+
## Auto-Setup (NEW in 1.1.0!)
|
|
213
43
|
|
|
214
|
-
|
|
215
|
-
Use the `add_custom_rule` tool with:
|
|
216
|
-
- `name`: Rule name
|
|
217
|
-
- `category`: One of `coding-standards`, `best-practices`, `security`, `performance`, `architecture`, `testing`, `documentation`, `naming-conventions`
|
|
218
|
-
- `content`: Rule content in Markdown
|
|
219
|
-
- `description`: Brief description
|
|
44
|
+
StackGuide can automatically detect your project type and configure itself:
|
|
220
45
|
|
|
221
|
-
### Via Files
|
|
222
|
-
Add Markdown files to the `data/rules/{project-type}/{category}/` directory:
|
|
223
|
-
|
|
224
|
-
```markdown
|
|
225
|
-
# Rule Title
|
|
226
|
-
|
|
227
|
-
Description of the rule.
|
|
228
|
-
|
|
229
|
-
## Guidelines
|
|
230
|
-
|
|
231
|
-
- Guideline 1
|
|
232
|
-
- Guideline 2
|
|
233
|
-
|
|
234
|
-
## Examples
|
|
235
|
-
|
|
236
|
-
```python
|
|
237
|
-
# Code example
|
|
238
|
-
```
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## Configuration Storage
|
|
242
|
-
|
|
243
|
-
User configurations are stored in `~/.stackguide/`:
|
|
244
|
-
- `configurations.json` - All saved configurations
|
|
245
|
-
- `rules/{project-type}/*.json` - User-created rules
|
|
246
|
-
- `web-docs/cache.json` - Cached web documentation
|
|
247
|
-
|
|
248
|
-
## Development
|
|
249
|
-
|
|
250
|
-
### Build
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
npm run build
|
|
254
46
|
```
|
|
255
|
-
|
|
256
|
-
### Run in Development
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
npm run dev
|
|
47
|
+
auto_setup projectPath:"."
|
|
260
48
|
```
|
|
261
49
|
|
|
262
|
-
|
|
50
|
+
It analyzes your `package.json`, `requirements.txt`, `Cargo.toml`, etc. and loads the right rules.
|
|
263
51
|
|
|
264
|
-
|
|
265
|
-
StackGuide-MCP/
|
|
266
|
-
โโโ src/
|
|
267
|
-
โ โโโ index.ts # Main entry point
|
|
268
|
-
โ โโโ config/
|
|
269
|
-
โ โ โโโ types.ts # TypeScript types
|
|
270
|
-
โ โ โโโ persistence.ts # Configuration storage
|
|
271
|
-
โ โโโ resources/
|
|
272
|
-
โ โ โโโ rulesProvider.ts # Rules management
|
|
273
|
-
โ โ โโโ knowledgeProvider.ts # Knowledge base
|
|
274
|
-
โ โโโ services/
|
|
275
|
-
โ โโโ ruleManager.ts # Dynamic rule CRUD
|
|
276
|
-
โ โโโ webDocumentation.ts # Web docs fetcher
|
|
277
|
-
โโโ data/
|
|
278
|
-
โ โโโ rules/ # Rule files by project type
|
|
279
|
-
โ โ โโโ python-django/
|
|
280
|
-
โ โ โโโ react-node/
|
|
281
|
-
โ โโโ knowledge/ # Knowledge files by project type
|
|
282
|
-
โ โโโ python-django/
|
|
283
|
-
โ โโโ react-node/
|
|
284
|
-
โโโ docs/
|
|
285
|
-
โ โโโ ADDING_CUSTOM_RULES.md # Guide for adding rules
|
|
286
|
-
โโโ package.json
|
|
287
|
-
โโโ tsconfig.json
|
|
288
|
-
โโโ README.md
|
|
289
|
-
```
|
|
52
|
+
## Supported Stacks
|
|
290
53
|
|
|
291
|
-
|
|
54
|
+
`python-django` ยท `python-fastapi` ยท `python-flask` ยท `react-node` ยท `react-typescript` ยท `vue-node` ยท `nextjs` ยท `express` ยท `nestjs` ยท `laravel` ยท `rails` ยท `golang` ยท `rust`
|
|
292
55
|
|
|
293
|
-
|
|
56
|
+
## Tools (46 total)
|
|
294
57
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
58
|
+
| Category | Tools |
|
|
59
|
+
|----------|-------|
|
|
60
|
+
| **Smart Setup** | `auto_setup` `detect_project` `suggest_rules` `quick_start` |
|
|
61
|
+
| **Project** | `list_project_types` `select_project_type` `get_current_context` |
|
|
62
|
+
| **Rules** | `list_rules` `get_rule` `select_rules` `search_rules` `create_rule` `update_rule` `delete_rule` |
|
|
63
|
+
| **Knowledge** | `list_knowledge` `get_knowledge` `select_knowledge` `search_knowledge` |
|
|
64
|
+
| **Config** | `save_configuration` `load_configuration` `list_configurations` `export_configuration` |
|
|
65
|
+
| **Web Docs** | `fetch_web_docs` `list_web_docs` `search_web_docs` `get_suggested_docs` |
|
|
66
|
+
| **Cursor Directory** | `browse_cursor_directory` `search_cursor_directory` `import_cursor_directory_rule` |
|
|
67
|
+
| **Context** | `get_full_context` `add_custom_rule` |
|
|
299
68
|
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
Use create_rule_from_template with:
|
|
303
|
-
- templateId: "coding-standard"
|
|
304
|
-
- projectType: "react-node"
|
|
305
|
-
- name: "My Team Standards"
|
|
306
|
-
```
|
|
69
|
+
## How It Works
|
|
307
70
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
### Creating Rules from Scratch
|
|
314
|
-
|
|
315
|
-
```
|
|
316
|
-
Use create_rule with:
|
|
317
|
-
- projectType: "python-django"
|
|
318
|
-
- name: "API Versioning"
|
|
319
|
-
- category: "best-practices"
|
|
320
|
-
- content: "# API Versioning\n\nAlways version your APIs..."
|
|
321
|
-
- description: "Guidelines for API versioning"
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
## Web Documentation
|
|
325
|
-
|
|
326
|
-
### Fetching Documentation
|
|
327
|
-
|
|
328
|
-
```
|
|
329
|
-
Use fetch_web_docs with:
|
|
330
|
-
- url: "https://react.dev/reference/react/useState"
|
|
331
|
-
- projectType: "react-node"
|
|
332
|
-
- title: "useState Hook"
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Getting Suggestions
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
Use get_suggested_docs with projectType: "react-node"
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
This returns popular documentation URLs for the framework.
|
|
71
|
+
1. **Auto-detect**: Analyzes project files to identify your stack
|
|
72
|
+
2. **Load context**: Loads relevant rules, standards, and patterns
|
|
73
|
+
3. **Suggest**: Recommends community rules from cursor.directory
|
|
74
|
+
4. **Persist**: Saves your configuration for future sessions
|
|
342
75
|
|
|
343
76
|
## Cursor Directory Integration
|
|
344
77
|
|
|
345
|
-
[cursor.directory](https://cursor.directory/rules/)
|
|
346
|
-
|
|
347
|
-
### Browse Rules by Category
|
|
78
|
+
Import community rules from [cursor.directory](https://cursor.directory/rules/):
|
|
348
79
|
|
|
349
80
|
```
|
|
350
|
-
|
|
81
|
+
browse_cursor_directory category:"python"
|
|
82
|
+
search_cursor_directory query:"react hooks"
|
|
83
|
+
import_cursor_directory_rule slug:"nextjs-react-typescript-cursor-rules"
|
|
351
84
|
```
|
|
352
85
|
|
|
353
|
-
Available categories include: typescript, python, react, next.js, vue, django, fastapi, nestjs, prisma, tailwindcss, and many more.
|
|
354
|
-
|
|
355
|
-
### Search for Rules
|
|
356
|
-
|
|
357
|
-
```
|
|
358
|
-
Use search_cursor_directory with query: "react hooks best practices"
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### Get Popular Rules
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
Use get_popular_cursor_rules
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Returns featured rules from popular frameworks.
|
|
368
|
-
|
|
369
|
-
### Import Rules
|
|
370
|
-
|
|
371
|
-
```
|
|
372
|
-
Use import_cursor_directory_rule with:
|
|
373
|
-
- slug: "nextjs-react-typescript-cursor-rules"
|
|
374
|
-
- projectType: "react-typescript"
|
|
375
|
-
- category: "best-practices"
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
This fetches the rule from cursor.directory and saves it to your local rules collection.
|
|
379
|
-
|
|
380
|
-
## Contributing
|
|
381
|
-
|
|
382
|
-
1. Fork the repository
|
|
383
|
-
2. Create a feature branch
|
|
384
|
-
3. Add your rules/knowledge files or enhance the server
|
|
385
|
-
4. Submit a pull request
|
|
386
|
-
|
|
387
|
-
### Adding Support for New Frameworks
|
|
388
|
-
|
|
389
|
-
1. Add project type to `src/config/types.ts`
|
|
390
|
-
2. Create rule files in `data/rules/{new-type}/`
|
|
391
|
-
3. Create knowledge files in `data/knowledge/{new-type}/`
|
|
392
|
-
|
|
393
86
|
## License
|
|
394
87
|
|
|
395
|
-
GPL-3.0
|
|
88
|
+
GPL-3.0
|