@democratize-quality/mcp-server 1.2.0 → 1.2.1

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 (56) hide show
  1. package/cli.js +248 -0
  2. package/package.json +7 -5
  3. package/src/chatmodes//360/237/214/220 api-generator.chatmode.md" +409 -0
  4. package/src/chatmodes//360/237/214/220 api-healer.chatmode.md" +494 -0
  5. package/src/chatmodes//360/237/214/220 api-planner.chatmode.md" +954 -0
  6. package/src/config/environments/api-only.js +72 -0
  7. package/src/config/environments/development.js +73 -0
  8. package/src/config/environments/production.js +88 -0
  9. package/src/config/index.js +360 -0
  10. package/src/config/server.js +60 -0
  11. package/src/config/tools/api.js +86 -0
  12. package/src/config/tools/browser.js +109 -0
  13. package/src/config/tools/default.js +51 -0
  14. package/src/docs/Agent_README.md +310 -0
  15. package/src/docs/QUICK_REFERENCE.md +111 -0
  16. package/src/server.ts +234 -0
  17. package/src/services/browserService.js +344 -0
  18. package/src/skills/api-planning/SKILL.md +224 -0
  19. package/src/skills/test-execution/SKILL.md +777 -0
  20. package/src/skills/test-generation/SKILL.md +309 -0
  21. package/src/skills/test-healing/SKILL.md +405 -0
  22. package/src/tools/api/api-generator.js +1884 -0
  23. package/src/tools/api/api-healer.js +636 -0
  24. package/src/tools/api/api-planner.js +2617 -0
  25. package/src/tools/api/api-project-setup.js +332 -0
  26. package/src/tools/api/api-request.js +660 -0
  27. package/src/tools/api/api-session-report.js +1297 -0
  28. package/src/tools/api/api-session-status.js +414 -0
  29. package/src/tools/api/prompts/README.md +293 -0
  30. package/src/tools/api/prompts/generation-prompts.js +722 -0
  31. package/src/tools/api/prompts/healing-prompts.js +214 -0
  32. package/src/tools/api/prompts/index.js +44 -0
  33. package/src/tools/api/prompts/orchestrator.js +353 -0
  34. package/src/tools/api/prompts/validation-rules.js +358 -0
  35. package/src/tools/base/ToolBase.js +249 -0
  36. package/src/tools/base/ToolRegistry.js +288 -0
  37. package/src/tools/browser/advanced/browser-console.js +403 -0
  38. package/src/tools/browser/advanced/browser-dialog.js +338 -0
  39. package/src/tools/browser/advanced/browser-evaluate.js +356 -0
  40. package/src/tools/browser/advanced/browser-file.js +499 -0
  41. package/src/tools/browser/advanced/browser-keyboard.js +362 -0
  42. package/src/tools/browser/advanced/browser-mouse.js +351 -0
  43. package/src/tools/browser/advanced/browser-network.js +440 -0
  44. package/src/tools/browser/advanced/browser-pdf.js +426 -0
  45. package/src/tools/browser/advanced/browser-tabs.js +516 -0
  46. package/src/tools/browser/advanced/browser-wait.js +397 -0
  47. package/src/tools/browser/click.js +187 -0
  48. package/src/tools/browser/close.js +79 -0
  49. package/src/tools/browser/dom.js +89 -0
  50. package/src/tools/browser/launch.js +86 -0
  51. package/src/tools/browser/navigate.js +289 -0
  52. package/src/tools/browser/screenshot.js +370 -0
  53. package/src/tools/browser/type.js +193 -0
  54. package/src/tools/index.js +114 -0
  55. package/src/utils/agentInstaller.js +437 -0
  56. package/src/utils/browserHelpers.js +102 -0
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: api-planning
3
+ description: Analyze API schemas (OpenAPI, Swagger, GraphQL) and create comprehensive test plans with realistic sample data and optional endpoint validation. Use when user mentions API testing, test plans, test coverage, API documentation, schema analysis, REST APIs, GraphQL APIs, test scenarios, or needs to plan API test strategy.
4
+ ---
5
+
6
+ # API Test Planning Skill
7
+
8
+ Use this skill to analyze API schemas and generate comprehensive test plans with realistic, context-aware sample data.
9
+
10
+ ## When to Use This Skill
11
+
12
+ - User provides an API schema URL or file path
13
+ - User mentions creating test plans for APIs
14
+ - User needs to analyze API documentation
15
+ - User wants to validate API endpoints
16
+ - User requests test coverage analysis for REST or GraphQL APIs
17
+
18
+ ## Core Workflow
19
+
20
+ ### Step 1: Generate Test Plan with Realistic Samples
21
+
22
+ When user provides a schema URL or file path, use the `api_planner` tool from the democratize-quality MCP server:
23
+
24
+ ```javascript
25
+ await tools.api_planner({
26
+ schemaUrl: "https://api.example.com/swagger.json",
27
+ // OR schemaPath: "./schema.graphql" for local files
28
+ apiBaseUrl: "https://api.example.com",
29
+ includeAuth: true,
30
+ includeSecurity: true,
31
+ includeErrorHandling: true,
32
+ outputPath: "./api-test-plan.md",
33
+ testCategories: ["functional", "security", "performance", "integration", "edge-cases"],
34
+ validateEndpoints: false // Set to true for live validation
35
+ })
36
+ ```
37
+
38
+ **Important Workflow Rules:**
39
+ 1. Call `api_planner` tool ONCE to generate the test plan
40
+ 2. Review the results and explain what was generated to the user
41
+ 3. Answer questions based on the generated output
42
+ 4. Only call api_planner again if user explicitly requests a new/different test plan
43
+
44
+ ### Step 2: Optional Endpoint Validation
45
+
46
+ When API is accessible, enable validation to verify schemas match reality:
47
+
48
+ ```javascript
49
+ await tools.api_planner({
50
+ schemaUrl: "https://api.example.com/swagger.json",
51
+ validateEndpoints: true,
52
+ validationSampleSize: 3, // Default: 3, use -1 for all endpoints
53
+ validationTimeout: 5000 // 5 seconds per request
54
+ })
55
+ ```
56
+
57
+ **Validation Features:**
58
+ - Real API testing with actual responses
59
+ - Response time metrics
60
+ - Success/failure indicators (✅/❌)
61
+ - Validation summary with success rate
62
+ - Graceful error handling
63
+
64
+ ## What You Get
65
+
66
+ ### Without Validation (Fast):
67
+ - Test plan with realistic sample data
68
+ - Context-aware field values (names, emails, dates)
69
+ - Ready-to-use test data
70
+
71
+ ### With Validation (Comprehensive):
72
+ - Test plan with realistic samples
73
+ - Validation summary (success rate, statistics)
74
+ - Per-endpoint validation results
75
+ - Actual API responses captured
76
+ - Response time metrics for each endpoint
77
+
78
+ ## Working with Schema Files
79
+
80
+ ### GraphQL SDL Files (.graphql, .gql)
81
+ **ALWAYS use `schemaPath` parameter for SDL files:**
82
+
83
+ ```javascript
84
+ await tools.api_planner({
85
+ schemaPath: "./schema.graphql", // Tool reads full file, converts SDL to introspection
86
+ outputPath: "./test-plan.md"
87
+ })
88
+ ```
89
+
90
+ **What happens:**
91
+ - Tool reads full file (no truncation)
92
+ - Automatically converts SDL → Introspection JSON
93
+ - Saves `schema.json` alongside `schema.graphql`
94
+ - Generates test plan from introspection
95
+
96
+ ### OpenAPI/Swagger Files
97
+ - Use `schemaPath` for local files (`.json`, `.yaml`, `.yml`)
98
+ - Use `schemaUrl` for remote URLs
99
+
100
+ ## Realistic Sample Data Generation
101
+
102
+ The tool generates context-aware sample data automatically:
103
+
104
+ **50+ Field Patterns:**
105
+ - Personal info: `firstName` → "John", `email` → "john.doe@example.com"
106
+ - Contact: `phoneNumber` → "+1-555-0123", `city` → "New York"
107
+ - Business: `company` → "Acme Corp", `jobTitle` → "Engineer"
108
+ - Identifiers: `uuid` → valid UUID, `token` → realistic token
109
+ - Content: `title` → "Report Title", `description` → meaningful text
110
+ - Numeric: `price` → 19.99, `age` → 25, `rating` → 4.5
111
+ - Dates: `createdAt` → "2026-02-15T10:30:00Z"
112
+
113
+ ## Advanced Scenarios
114
+
115
+ ### Scenario 1: Local Schema File
116
+ ```javascript
117
+ await tools.api_planner({
118
+ schemaPath: "./openapi.json",
119
+ apiBaseUrl: "https://staging-api.example.com",
120
+ validateEndpoints: true
121
+ })
122
+ ```
123
+
124
+ ### Scenario 2: GraphQL API
125
+ ```javascript
126
+ await tools.api_planner({
127
+ schemaUrl: "https://api.example.com/graphql",
128
+ schemaType: "graphql",
129
+ testCategories: ["functional", "edge-cases"]
130
+ })
131
+ ```
132
+
133
+ ### Scenario 3: Multiple Related Services
134
+ ```javascript
135
+ const services = [
136
+ { url: "https://api1.example.com/swagger.json", name: "auth-service" },
137
+ { url: "https://api2.example.com/swagger.json", name: "user-service" }
138
+ ]
139
+
140
+ for (const service of services) {
141
+ await tools.api_planner({
142
+ schemaUrl: service.url,
143
+ outputPath: `./${service.name}-test-plan.md`
144
+ })
145
+ }
146
+ ```
147
+
148
+ ## Best Practices
149
+
150
+ ### DO:
151
+ - Use api_planner once per schema
152
+ - Enable validation when API is accessible
153
+ - Use schemaPath for local files (especially GraphQL SDL)
154
+ - Review validation results for API issues
155
+ - Save plans to files using outputPath parameter
156
+ - Include security and edge case testing
157
+
158
+ ### DON'T:
159
+ - Don't call api_planner multiple times without user request
160
+ - Don't regenerate plans just to answer questions
161
+ - Don't skip validation if API is accessible
162
+ - Don't ignore failed validations
163
+ - Don't validate all endpoints for large APIs (use validationSampleSize)
164
+
165
+ ## Parameter Reference
166
+
167
+ **Required (one of):**
168
+ - `schemaUrl` - URL to fetch schema
169
+ - `schemaPath` - Local file path
170
+
171
+ **Common Optional:**
172
+ - `apiBaseUrl` - Override base URL from schema
173
+ - `outputPath` - Save test plan to file
174
+ - `includeAuth` - Include auth scenarios (default: false)
175
+ - `includeSecurity` - Include security scenarios (default: false)
176
+ - `includeErrorHandling` - Include error scenarios (default: false)
177
+ - `testCategories` - Array of test types
178
+
179
+ **Validation Optional:**
180
+ - `validateEndpoints` - Enable actual API testing (default: false)
181
+ - `validationSampleSize` - Number to validate (default: 3, -1 = all)
182
+ - `validationTimeout` - Timeout in ms (default: 5000)
183
+
184
+ ## Troubleshooting
185
+
186
+ ### Issue: Validation Not Running
187
+ - Ensure `validateEndpoints: true` is set explicitly
188
+
189
+ ### Issue: All Validations Fail with 401/403
190
+ - API requires authentication
191
+ - Use api_request tool to test with proper auth headers
192
+ - Document auth requirements in manual review
193
+
194
+ ### Issue: Validation Timeout
195
+ - Increase `validationTimeout` parameter (e.g., 10000 for 10s)
196
+
197
+ ### Issue: Schema Parse Errors
198
+ - Verify schema URL is accessible
199
+ - Check schema format compatibility
200
+ - Try using `schemaPath` for local files
201
+
202
+ ## Additional Validation Tools
203
+
204
+ If you need to validate specific endpoints manually:
205
+
206
+ ```javascript
207
+ await tools.api_request({
208
+ sessionId: "validation-session",
209
+ method: "GET",
210
+ url: "https://api.example.com/endpoint",
211
+ expect: { status: 200 }
212
+ })
213
+
214
+ // Check session status
215
+ await tools.api_session_status({
216
+ sessionId: "validation-session"
217
+ })
218
+
219
+ // Generate report
220
+ await tools.api_session_report({
221
+ sessionId: "validation-session",
222
+ outputPath: "./validation-report.html"
223
+ })
224
+ ```