mcp-ai-agent-guidelines 0.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/LICENSE +21 -0
- package/README.md +336 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +307 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +21 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +504 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +14 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +92 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/structured.d.ts +47 -0
- package/dist/resources/structured.d.ts.map +1 -0
- package/dist/resources/structured.js +857 -0
- package/dist/resources/structured.js.map +1 -0
- package/dist/tools/code-hygiene-analyzer.d.ts +7 -0
- package/dist/tools/code-hygiene-analyzer.d.ts.map +1 -0
- package/dist/tools/code-hygiene-analyzer.js +176 -0
- package/dist/tools/code-hygiene-analyzer.js.map +1 -0
- package/dist/tools/config/guidelines-config.d.ts +16 -0
- package/dist/tools/config/guidelines-config.d.ts.map +1 -0
- package/dist/tools/config/guidelines-config.js +236 -0
- package/dist/tools/config/guidelines-config.js.map +1 -0
- package/dist/tools/config/model-config.d.ts +33 -0
- package/dist/tools/config/model-config.d.ts.map +1 -0
- package/dist/tools/config/model-config.js +206 -0
- package/dist/tools/config/model-config.js.map +1 -0
- package/dist/tools/guidelines-validator.d.ts +7 -0
- package/dist/tools/guidelines-validator.d.ts.map +1 -0
- package/dist/tools/guidelines-validator.js +178 -0
- package/dist/tools/guidelines-validator.js.map +1 -0
- package/dist/tools/hierarchical-prompt-builder.d.ts +7 -0
- package/dist/tools/hierarchical-prompt-builder.d.ts.map +1 -0
- package/dist/tools/hierarchical-prompt-builder.js +147 -0
- package/dist/tools/hierarchical-prompt-builder.js.map +1 -0
- package/dist/tools/memory-context-optimizer.d.ts +7 -0
- package/dist/tools/memory-context-optimizer.d.ts.map +1 -0
- package/dist/tools/memory-context-optimizer.js +256 -0
- package/dist/tools/memory-context-optimizer.js.map +1 -0
- package/dist/tools/mermaid-diagram-generator.d.ts +7 -0
- package/dist/tools/mermaid-diagram-generator.d.ts.map +1 -0
- package/dist/tools/mermaid-diagram-generator.js +312 -0
- package/dist/tools/mermaid-diagram-generator.js.map +1 -0
- package/dist/tools/model-compatibility-checker.d.ts +7 -0
- package/dist/tools/model-compatibility-checker.d.ts.map +1 -0
- package/dist/tools/model-compatibility-checker.js +204 -0
- package/dist/tools/model-compatibility-checker.js.map +1 -0
- package/dist/tools/sprint-timeline-calculator.d.ts +7 -0
- package/dist/tools/sprint-timeline-calculator.d.ts.map +1 -0
- package/dist/tools/sprint-timeline-calculator.js +240 -0
- package/dist/tools/sprint-timeline-calculator.js.map +1 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Anselmoo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
## MCP AI Agent Guidelines Server
|
|
2
|
+
|
|
3
|
+
> [!CAUTION]
|
|
4
|
+
> **Disclaimer -- Experimental / Early Stage:** This project references third‑party models, tools, pricing, and docs that evolve quickly. Treat outputs as recommendations and verify against official docs and your own benchmarks before production use.
|
|
5
|
+
|
|
6
|
+
[](https://github.com/Anselmoo/mcp-ai-agent-guidelines/actions/workflows/ci-cd.yml)
|
|
7
|
+
[](https://badge.fury.io/js/mcp-ai-agent-guidelines)
|
|
8
|
+
[](https://nodejs.org/en/download/)
|
|
9
|
+
[](https://github.com/Anselmoo/mcp-ai-agent-guidelines/pkgs/container/mcp-ai-agent-guidelines)
|
|
10
|
+
[](./LICENSE)
|
|
11
|
+
|
|
12
|
+
A Model Context Protocol (MCP) server offering professional tools and templates for hierarchical prompting, code hygiene, visualization, memory optimization, and agile planning.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# NPX (recommended)
|
|
18
|
+
npx mcp-ai-agent-guidelines
|
|
19
|
+
|
|
20
|
+
# NPM global
|
|
21
|
+
npm install -g mcp-ai-agent-guidelines
|
|
22
|
+
|
|
23
|
+
# From source
|
|
24
|
+
git clone https://github.com/Anselmoo/mcp-ai-agent-guidelines.git
|
|
25
|
+
cd mcp-ai-agent-guidelines
|
|
26
|
+
npm ci && npm run build && npm start
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Scripts
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run build # TypeScript build
|
|
33
|
+
npm run start # Build and start server
|
|
34
|
+
npm run test:all # Unit + integration + demos + MCP smoke
|
|
35
|
+
npm run quality # Type-check + Biome checks
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Demos
|
|
39
|
+
|
|
40
|
+
Explore generated demo reports in the repository:
|
|
41
|
+
|
|
42
|
+
- Code Hygiene Report: [demos/demo-code-analysis.hygiene.md](./demos/demo-code-analysis.hygiene.md)
|
|
43
|
+
- Guidelines Validation: [demos/demo-code-analysis.guidelines.md](./demos/demo-code-analysis.guidelines.md)
|
|
44
|
+
- Hierarchical Prompt (Refactor plan): [demos/demo-code-analysis.hierarchical.prompt.md](./demos/demo-code-analysis.hierarchical.prompt.md)
|
|
45
|
+
- Memory Context Optimization: [demos/demo-code-analysis.memory.md](./demos/demo-code-analysis.memory.md)
|
|
46
|
+
- Architecture Diagram (Mermaid): [demos/demo-code-analysis.diagram.md](./demos/demo-code-analysis.diagram.md)
|
|
47
|
+
- Model Compatibility Analysis: [demos/demo-code-analysis.model-compat.md](./demos/demo-code-analysis.model-compat.md)
|
|
48
|
+
- Sprint Plan: [demos/demo-code-analysis.sprint.md](./demos/demo-code-analysis.sprint.md)
|
|
49
|
+
|
|
50
|
+
See more in [demos/README.md](./demos/README.md).
|
|
51
|
+
|
|
52
|
+
### Demo scripts (.js)
|
|
53
|
+
|
|
54
|
+
Run demo scripts to generate or test artifacts:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Build first
|
|
58
|
+
npm run build
|
|
59
|
+
|
|
60
|
+
# Run sample tool calls
|
|
61
|
+
node demos/demo-tools.js
|
|
62
|
+
|
|
63
|
+
# Generate all demo reports
|
|
64
|
+
node demos/generate-demo-reports.js
|
|
65
|
+
node demos/generate-hygiene-reports.js
|
|
66
|
+
# Or run everything with one command
|
|
67
|
+
node demos/generate-demos.js
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Scripts:
|
|
71
|
+
- `demos/demo-tools.js` — invokes several tools with sample inputs
|
|
72
|
+
- `demos/generate-demo-reports.js` — produces end-to-end demo outputs
|
|
73
|
+
- `demos/generate-hygiene-reports.js` — hygiene-focused reports
|
|
74
|
+
|
|
75
|
+
## VS Code Integration (One‑Click)
|
|
76
|
+
|
|
77
|
+
Use buttons below to add this MCP server to VS Code (User Settings → mcp.servers):
|
|
78
|
+
|
|
79
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=mcp-ai-agent-guidelines&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-ai-agent-guidelines%22%5D%7D)
|
|
80
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=mcp-ai-agent-guidelines&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-ai-agent-guidelines%22%5D%7D&quality=insiders)
|
|
81
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=mcp-ai-agent-guidelines&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-ai-agent-guidelines%3Alatest%22%5D%7D)
|
|
82
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=mcp-ai-agent-guidelines&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-ai-agent-guidelines%3Alatest%22%5D%7D&quality=insiders)
|
|
83
|
+
|
|
84
|
+
Manual settings (User Settings JSON):
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcp": {
|
|
89
|
+
"servers": {
|
|
90
|
+
"mcp-ai-agent-guidelines": {
|
|
91
|
+
"command": "npx",
|
|
92
|
+
"args": ["-y", "mcp-ai-agent-guidelines"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Using Docker:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"mcp": {
|
|
104
|
+
"servers": {
|
|
105
|
+
"mcp-ai-agent-guidelines": {
|
|
106
|
+
"command": "docker",
|
|
107
|
+
"args": [
|
|
108
|
+
"run",
|
|
109
|
+
"--rm",
|
|
110
|
+
"-i",
|
|
111
|
+
"ghcr.io/anselmoo/mcp-ai-agent-guidelines:latest"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Use tools from a chat window (VS Code/Cline)
|
|
120
|
+
|
|
121
|
+
After adding the server, open your chat client (e.g., Cline in VS Code). The tools appear under the server name. You can:
|
|
122
|
+
|
|
123
|
+
- Run a tool directly by name:
|
|
124
|
+
- `hierarchical-prompt-builder` — Provide context, goal, and optional requirements.
|
|
125
|
+
- `code-hygiene-analyzer` — Paste code or point to a file and set language.
|
|
126
|
+
- `mermaid-diagram-generator` — Describe the system and select a diagram type.
|
|
127
|
+
- Ask in natural language and pick the suggested tool.
|
|
128
|
+
|
|
129
|
+
Example prompts:
|
|
130
|
+
- "Use hierarchical-prompt-builder to create a refactor plan for src/index.ts with outputFormat markdown."
|
|
131
|
+
- "Analyze this Python file with code-hygiene-analyzer; highlight security issues."
|
|
132
|
+
- "Generate a Mermaid diagram for our pipeline using mermaid-diagram-generator (flowchart)."
|
|
133
|
+
|
|
134
|
+
Tip: Most clients can pass file content automatically when you select a file and invoke a tool.
|
|
135
|
+
|
|
136
|
+
GitHub Chat (VS Code): In the chat, type your request and pick a tool suggestion, or explicitly reference a tool by name (e.g., “Use mermaid-diagram-generator to draw a flowchart for our pipeline”).
|
|
137
|
+
|
|
138
|
+
## Features
|
|
139
|
+
|
|
140
|
+
<details>
|
|
141
|
+
<summary><strong>Hierarchical Prompt Builder</strong> — Build structured prompts with clear hierarchies</summary>
|
|
142
|
+
|
|
143
|
+
Usage: `hierarchical-prompt-builder`
|
|
144
|
+
|
|
145
|
+
| Parameter | Required | Description |
|
|
146
|
+
| -------------- | -------- | ------------------------------------- |
|
|
147
|
+
| `context` | ✅ | The broad context or domain |
|
|
148
|
+
| `goal` | ✅ | The specific goal or objective |
|
|
149
|
+
| `requirements` | ❌ | Detailed requirements and constraints |
|
|
150
|
+
| `outputFormat` | ❌ | Desired output format |
|
|
151
|
+
| `audience` | ❌ | Target audience or expertise level |
|
|
152
|
+
|
|
153
|
+
</details>
|
|
154
|
+
|
|
155
|
+
<details>
|
|
156
|
+
<summary><strong>Code Hygiene Analyzer</strong> — Analyze codebase for outdated patterns and hygiene issues</summary>
|
|
157
|
+
|
|
158
|
+
Usage: `code-hygiene-analyzer`
|
|
159
|
+
|
|
160
|
+
| Parameter | Required | Description |
|
|
161
|
+
| ------------- | -------- | ----------------------------- |
|
|
162
|
+
| `codeContent` | ✅ | Code content to analyze |
|
|
163
|
+
| `language` | ✅ | Programming language |
|
|
164
|
+
| `framework` | ❌ | Framework or technology stack |
|
|
165
|
+
|
|
166
|
+
</details>
|
|
167
|
+
|
|
168
|
+
<details>
|
|
169
|
+
<summary><strong>Mermaid Diagram Generator</strong> — Generate professional diagrams from text descriptions</summary>
|
|
170
|
+
|
|
171
|
+
Usage: `mermaid-diagram-generator`
|
|
172
|
+
|
|
173
|
+
| Parameter | Required | Description |
|
|
174
|
+
| ------------- | -------- | ---------------------------------------------------------------- |
|
|
175
|
+
| `description` | ✅ | Description of the system or process to diagram |
|
|
176
|
+
| `diagramType` | ✅ | Type: `flowchart`, `sequence`, `class`, `state`, `gantt`, `pie` |
|
|
177
|
+
| `theme` | ❌ | Visual theme for the diagram |
|
|
178
|
+
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary><strong>Memory Context Optimizer</strong> — Optimize prompt caching and context window usage</summary>
|
|
183
|
+
|
|
184
|
+
Usage: `memory-context-optimizer`
|
|
185
|
+
|
|
186
|
+
| Parameter | Required | Description |
|
|
187
|
+
| ---------------- | -------- | -------------------------------------------------- |
|
|
188
|
+
| `contextContent` | ✅ | Context content to optimize |
|
|
189
|
+
| `maxTokens` | ❌ | Maximum token limit |
|
|
190
|
+
| `cacheStrategy` | ❌ | Strategy: `aggressive`, `conservative`, `balanced` |
|
|
191
|
+
|
|
192
|
+
</details>
|
|
193
|
+
|
|
194
|
+
<details>
|
|
195
|
+
<summary><strong>Sprint Timeline Calculator</strong> — Calculate optimal development cycles and sprint timelines</summary>
|
|
196
|
+
|
|
197
|
+
Usage: `sprint-timeline-calculator`
|
|
198
|
+
|
|
199
|
+
| Parameter | Required | Description |
|
|
200
|
+
| -------------- | -------- | --------------------------------------- |
|
|
201
|
+
| `tasks` | ✅ | List of tasks with estimates |
|
|
202
|
+
| `teamSize` | ✅ | Number of team members |
|
|
203
|
+
| `sprintLength` | ❌ | Sprint length in days |
|
|
204
|
+
| `velocity` | ❌ | Team velocity (story points per sprint) |
|
|
205
|
+
|
|
206
|
+
</details>
|
|
207
|
+
|
|
208
|
+
<details>
|
|
209
|
+
<summary><strong>Model Compatibility Checker</strong> — Recommend best AI models for specific tasks</summary>
|
|
210
|
+
|
|
211
|
+
Usage: `model-compatibility-checker`
|
|
212
|
+
|
|
213
|
+
| Parameter | Required | Description |
|
|
214
|
+
| ----------------- | -------- | -------------------------------------------------------- |
|
|
215
|
+
| `taskDescription` | ✅ | Description of the task |
|
|
216
|
+
| `requirements` | ❌ | Specific requirements (context length, multimodal, etc.) |
|
|
217
|
+
| `budget` | ❌ | Budget constraints: `low`, `medium`, `high` |
|
|
218
|
+
|
|
219
|
+
</details>
|
|
220
|
+
|
|
221
|
+
<details>
|
|
222
|
+
<summary><strong>Guidelines Validator</strong> — Validate development practices against established guidelines</summary>
|
|
223
|
+
|
|
224
|
+
Usage: `guidelines-validator`
|
|
225
|
+
|
|
226
|
+
| Parameter | Required | Description |
|
|
227
|
+
| --------------------- | -------- | ----------------------------------------------------------------------------------------------- |
|
|
228
|
+
| `practiceDescription` | ✅ | Description of the development practice |
|
|
229
|
+
| `category` | ✅ | Category: `prompting`, `code-management`, `architecture`, `visualization`, `memory`, `workflow` |
|
|
230
|
+
|
|
231
|
+
</details>
|
|
232
|
+
|
|
233
|
+
## Configuration
|
|
234
|
+
|
|
235
|
+
- Node.js 20+ required (see `engines` in `package.json`).
|
|
236
|
+
- Tools are exposed by the MCP server and discoverable via client schemas.
|
|
237
|
+
- Mermaid diagrams render client-side (Markdown preview). No server rendering.
|
|
238
|
+
|
|
239
|
+
## Versioning
|
|
240
|
+
|
|
241
|
+
- Package version: `0.1.0` (matches internal resource versions).
|
|
242
|
+
- Tags `vX.Y.Z` trigger CI for NPM and Docker releases.
|
|
243
|
+
- Pin exact versions for production stability.
|
|
244
|
+
|
|
245
|
+
## Development
|
|
246
|
+
|
|
247
|
+
Prerequisites:
|
|
248
|
+
- Node.js 20+
|
|
249
|
+
- npm 10+
|
|
250
|
+
|
|
251
|
+
Setup:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
git clone https://github.com/Anselmoo/mcp-ai-agent-guidelines.git
|
|
255
|
+
cd mcp-ai-agent-guidelines
|
|
256
|
+
npm install
|
|
257
|
+
npm run build
|
|
258
|
+
npm start
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Project structure:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
/src - TypeScript source (tools, resources, server)
|
|
265
|
+
/tests - Test files and utilities
|
|
266
|
+
/scripts - Shell scripts and helpers
|
|
267
|
+
/demos - Demo scripts and generated artifacts
|
|
268
|
+
/.github - CI and community health files
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Testing and quality:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
npm run test:unit # Unit tests
|
|
275
|
+
npm run test:integration # Integration tests
|
|
276
|
+
npm run test:demo # Demo runner
|
|
277
|
+
npm run test:mcp # MCP smoke script
|
|
278
|
+
npm run quality # Type-check + Biome check
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Docker
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Run with Docker
|
|
285
|
+
docker run -p 3000:3000 ghcr.io/anselmoo/mcp-ai-agent-guidelines:latest
|
|
286
|
+
|
|
287
|
+
# Build locally
|
|
288
|
+
docker build -t mcp-ai-agent-guidelines .
|
|
289
|
+
docker run -p 3000:3000 mcp-ai-agent-guidelines
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
VS Code + Docker settings:
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"mcp": {
|
|
297
|
+
"servers": {
|
|
298
|
+
"mcp-ai-agent-guidelines": {
|
|
299
|
+
"command": "docker",
|
|
300
|
+
"args": [
|
|
301
|
+
"run",
|
|
302
|
+
"--rm",
|
|
303
|
+
"-i",
|
|
304
|
+
"ghcr.io/anselmoo/mcp-ai-agent-guidelines:latest"
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Security
|
|
313
|
+
|
|
314
|
+
- No secrets committed; releases use provenance where supported.
|
|
315
|
+
- Docker images are signed (Cosign); supply‑chain security via Sigstore.
|
|
316
|
+
- Report vulnerabilities via GitHub Security tab or Issues.
|
|
317
|
+
|
|
318
|
+
## Documentation
|
|
319
|
+
|
|
320
|
+
- MCP Specification: https://modelcontextprotocol.io/
|
|
321
|
+
- Tools implementation: see `src/tools/` in this repo.
|
|
322
|
+
- Generated examples: see `demos/` and links above.
|
|
323
|
+
|
|
324
|
+
## Contributing
|
|
325
|
+
|
|
326
|
+
Contributions welcome. Please see [CONTRIBUTING.md](./CONTRIBUTING.md). Keep changes typed, linted, and include tests when behavior changes.
|
|
327
|
+
|
|
328
|
+
## License
|
|
329
|
+
|
|
330
|
+
MIT © Anselmoo — see [LICENSE](./LICENSE).
|
|
331
|
+
|
|
332
|
+
## Acknowledgments
|
|
333
|
+
|
|
334
|
+
- Model Context Protocol team for the spec
|
|
335
|
+
- Anthropic for prompt caching research
|
|
336
|
+
- Mermaid community for diagram tooling
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AI Agent Development Guidelines MCP Server
|
|
4
|
+
*
|
|
5
|
+
* This MCP server provides tools, resources, and prompts for implementing
|
|
6
|
+
* AI agent best practices including hierarchical prompting, code hygiene
|
|
7
|
+
* analysis, mermaid diagram generation, memory optimization, and sprint planning.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AI Agent Development Guidelines MCP Server
|
|
4
|
+
*
|
|
5
|
+
* This MCP server provides tools, resources, and prompts for implementing
|
|
6
|
+
* AI agent best practices including hierarchical prompting, code hygiene
|
|
7
|
+
* analysis, mermaid diagram generation, memory optimization, and sprint planning.
|
|
8
|
+
*/
|
|
9
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
10
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
11
|
+
import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
12
|
+
// Import prompts
|
|
13
|
+
import { getPrompt, listPrompts } from "./prompts/index.js";
|
|
14
|
+
// Import resources
|
|
15
|
+
import { getResource, listResources } from "./resources/index.js";
|
|
16
|
+
import { codeHygieneAnalyzer } from "./tools/code-hygiene-analyzer.js";
|
|
17
|
+
import { guidelinesValidator } from "./tools/guidelines-validator.js";
|
|
18
|
+
// Import tool implementations
|
|
19
|
+
import { hierarchicalPromptBuilder } from "./tools/hierarchical-prompt-builder.js";
|
|
20
|
+
import { memoryContextOptimizer } from "./tools/memory-context-optimizer.js";
|
|
21
|
+
import { mermaidDiagramGenerator } from "./tools/mermaid-diagram-generator.js";
|
|
22
|
+
import { modelCompatibilityChecker } from "./tools/model-compatibility-checker.js";
|
|
23
|
+
import { sprintTimelineCalculator } from "./tools/sprint-timeline-calculator.js";
|
|
24
|
+
const server = new Server({
|
|
25
|
+
name: "mcp-ai-agent-guidelines",
|
|
26
|
+
version: "0.1.0",
|
|
27
|
+
}, {
|
|
28
|
+
capabilities: {
|
|
29
|
+
tools: {},
|
|
30
|
+
resources: {},
|
|
31
|
+
prompts: {},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
// Register tool handlers
|
|
35
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
36
|
+
return {
|
|
37
|
+
tools: [
|
|
38
|
+
{
|
|
39
|
+
name: "hierarchical-prompt-builder",
|
|
40
|
+
description: "Build structured prompts with clear hierarchies and layers of specificity",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
context: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "The broad context or domain",
|
|
47
|
+
},
|
|
48
|
+
goal: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "The specific goal or objective",
|
|
51
|
+
},
|
|
52
|
+
requirements: {
|
|
53
|
+
type: "array",
|
|
54
|
+
items: { type: "string" },
|
|
55
|
+
description: "Detailed requirements and constraints",
|
|
56
|
+
},
|
|
57
|
+
outputFormat: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Desired output format",
|
|
60
|
+
},
|
|
61
|
+
audience: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Target audience or expertise level",
|
|
64
|
+
},
|
|
65
|
+
includeDisclaimer: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
description: "Append a third-party disclaimer section",
|
|
68
|
+
},
|
|
69
|
+
includeReferences: {
|
|
70
|
+
type: "boolean",
|
|
71
|
+
description: "Append a short references list",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ["context", "goal"],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "code-hygiene-analyzer",
|
|
79
|
+
description: "Analyze codebase for outdated patterns, unused dependencies, and code hygiene issues",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
codeContent: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Code content to analyze",
|
|
86
|
+
},
|
|
87
|
+
language: { type: "string", description: "Programming language" },
|
|
88
|
+
framework: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Framework or technology stack",
|
|
91
|
+
},
|
|
92
|
+
includeReferences: {
|
|
93
|
+
type: "boolean",
|
|
94
|
+
description: "Include external best-practice links",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ["codeContent", "language"],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "mermaid-diagram-generator",
|
|
102
|
+
description: "Generate Mermaid diagrams from text descriptions following best practices",
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: "object",
|
|
105
|
+
properties: {
|
|
106
|
+
description: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Description of the system or process to diagram",
|
|
109
|
+
},
|
|
110
|
+
diagramType: {
|
|
111
|
+
type: "string",
|
|
112
|
+
enum: ["flowchart", "sequence", "class", "state", "gantt", "pie"],
|
|
113
|
+
description: "Type of diagram to generate",
|
|
114
|
+
},
|
|
115
|
+
theme: {
|
|
116
|
+
type: "string",
|
|
117
|
+
description: "Visual theme for the diagram",
|
|
118
|
+
},
|
|
119
|
+
accTitle: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Accessibility title (added as a Mermaid comment)",
|
|
122
|
+
},
|
|
123
|
+
accDescr: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "Accessibility description (added as a Mermaid comment)",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
required: ["description", "diagramType"],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "memory-context-optimizer",
|
|
133
|
+
description: "Optimize prompt caching and context window usage for AI agents",
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: {
|
|
137
|
+
contextContent: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "Context content to optimize",
|
|
140
|
+
},
|
|
141
|
+
maxTokens: { type: "number", description: "Maximum token limit" },
|
|
142
|
+
cacheStrategy: {
|
|
143
|
+
type: "string",
|
|
144
|
+
enum: ["aggressive", "conservative", "balanced"],
|
|
145
|
+
description: "Caching strategy",
|
|
146
|
+
},
|
|
147
|
+
includeReferences: {
|
|
148
|
+
type: "boolean",
|
|
149
|
+
description: "Include external links on caching",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
required: ["contextContent"],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "sprint-timeline-calculator",
|
|
157
|
+
description: "Calculate optimal development cycles and sprint timelines",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
tasks: {
|
|
162
|
+
type: "array",
|
|
163
|
+
items: { type: "object" },
|
|
164
|
+
description: "List of tasks with estimates",
|
|
165
|
+
},
|
|
166
|
+
teamSize: { type: "number", description: "Number of team members" },
|
|
167
|
+
sprintLength: {
|
|
168
|
+
type: "number",
|
|
169
|
+
description: "Sprint length in days",
|
|
170
|
+
},
|
|
171
|
+
velocity: {
|
|
172
|
+
type: "number",
|
|
173
|
+
description: "Team velocity (story points per sprint)",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
required: ["tasks", "teamSize"],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "model-compatibility-checker",
|
|
181
|
+
description: "Recommend best AI models for specific tasks and requirements",
|
|
182
|
+
inputSchema: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
taskDescription: {
|
|
186
|
+
type: "string",
|
|
187
|
+
description: "Description of the task",
|
|
188
|
+
},
|
|
189
|
+
requirements: {
|
|
190
|
+
type: "array",
|
|
191
|
+
items: { type: "string" },
|
|
192
|
+
description: "Specific requirements (context length, multimodal, etc.)",
|
|
193
|
+
},
|
|
194
|
+
budget: {
|
|
195
|
+
type: "string",
|
|
196
|
+
enum: ["low", "medium", "high"],
|
|
197
|
+
description: "Budget constraints",
|
|
198
|
+
},
|
|
199
|
+
language: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "Preferred language for example snippets (e.g., typescript, python)",
|
|
202
|
+
},
|
|
203
|
+
includeReferences: {
|
|
204
|
+
type: "boolean",
|
|
205
|
+
description: "Include external documentation links",
|
|
206
|
+
},
|
|
207
|
+
includeCodeExamples: {
|
|
208
|
+
type: "boolean",
|
|
209
|
+
description: "Include language-specific example snippets",
|
|
210
|
+
},
|
|
211
|
+
linkFiles: {
|
|
212
|
+
type: "boolean",
|
|
213
|
+
description: "Include links to relevant files/resources in this repo",
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
required: ["taskDescription"],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "guidelines-validator",
|
|
221
|
+
description: "Validate development practices against established AI agent guidelines",
|
|
222
|
+
inputSchema: {
|
|
223
|
+
type: "object",
|
|
224
|
+
properties: {
|
|
225
|
+
practiceDescription: {
|
|
226
|
+
type: "string",
|
|
227
|
+
description: "Description of the development practice",
|
|
228
|
+
},
|
|
229
|
+
category: {
|
|
230
|
+
type: "string",
|
|
231
|
+
enum: [
|
|
232
|
+
"prompting",
|
|
233
|
+
"code-management",
|
|
234
|
+
"architecture",
|
|
235
|
+
"visualization",
|
|
236
|
+
"memory",
|
|
237
|
+
"workflow",
|
|
238
|
+
],
|
|
239
|
+
description: "Category of practice to validate",
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
required: ["practiceDescription", "category"],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
};
|
|
247
|
+
});
|
|
248
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
249
|
+
const { name, arguments: args } = request.params;
|
|
250
|
+
try {
|
|
251
|
+
switch (name) {
|
|
252
|
+
case "hierarchical-prompt-builder":
|
|
253
|
+
return hierarchicalPromptBuilder(args);
|
|
254
|
+
case "code-hygiene-analyzer":
|
|
255
|
+
return codeHygieneAnalyzer(args);
|
|
256
|
+
case "mermaid-diagram-generator":
|
|
257
|
+
return mermaidDiagramGenerator(args);
|
|
258
|
+
case "memory-context-optimizer":
|
|
259
|
+
return memoryContextOptimizer(args);
|
|
260
|
+
case "sprint-timeline-calculator":
|
|
261
|
+
return sprintTimelineCalculator(args);
|
|
262
|
+
case "model-compatibility-checker":
|
|
263
|
+
return modelCompatibilityChecker(args);
|
|
264
|
+
case "guidelines-validator":
|
|
265
|
+
return guidelinesValidator(args);
|
|
266
|
+
default:
|
|
267
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
return {
|
|
272
|
+
content: [
|
|
273
|
+
{
|
|
274
|
+
type: "text",
|
|
275
|
+
text: `Error executing tool ${name}: ${error instanceof Error ? error.message : String(error)}`,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
// Register resource handlers
|
|
282
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
283
|
+
return { resources: await listResources() };
|
|
284
|
+
});
|
|
285
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
286
|
+
const { uri } = request.params;
|
|
287
|
+
return await getResource(uri);
|
|
288
|
+
});
|
|
289
|
+
// Register prompt handlers
|
|
290
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
291
|
+
return { prompts: await listPrompts() };
|
|
292
|
+
});
|
|
293
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
294
|
+
const { name, arguments: args } = request.params;
|
|
295
|
+
return await getPrompt(name, args || {});
|
|
296
|
+
});
|
|
297
|
+
// Start the server
|
|
298
|
+
async function main() {
|
|
299
|
+
const transport = new StdioServerTransport();
|
|
300
|
+
await server.connect(transport);
|
|
301
|
+
console.error("MCP AI Agent Guide Server running on stdio");
|
|
302
|
+
}
|
|
303
|
+
main().catch((error) => {
|
|
304
|
+
console.error("Server error:", error);
|
|
305
|
+
process.exit(1);
|
|
306
|
+
});
|
|
307
|
+
//# sourceMappingURL=index.js.map
|