@democratize-quality/mcp-server 1.1.0 โ†’ 1.1.2

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 CHANGED
@@ -1,640 +1,1111 @@
1
1
  # ๐ŸŽฏ Democratize Quality MCP Server
2
2
 
3
- A comprehensive **Model Context Protocol (MCP)** server that democratizes quality through comprehensive API testing capabilities.
3
+ **Intelligent API Testing Made Simple** - A comprehensive Model Context Protocol (MCP) server that brings professional-grade API testing capabilities to everyone, from QA engineers to developers.
4
4
 
5
- ## ๐Ÿค– API Testing Agents for GitHub Copilot
5
+ > Transform your API testing workflow with AI-powered agents that plan, generate, and heal your tests automatically.
6
6
 
7
- Introducing **intelligent API testing agents** that work seamlessly with GitHub Copilot Chat to automate your API testing workflow - from planning to generation to healing.
7
+ ---
8
+
9
+ ## ๐Ÿ“ฆ Quick Installation
10
+
11
+ ### Option 1: Agent Mode Installation (Recommended)
8
12
 
9
- ### ๐Ÿš€ One-Click Installation
13
+ **The fastest way to get started** - Install with intelligent testing agents for GitHub Copilot:
10
14
 
11
- Get started instantly with our VS Code integration:
15
+ ```bash
16
+ npx @democratize-quality/mcp-server --agents
17
+ ```
18
+
19
+ **What this does:**
20
+ - โœ… Installs the MCP server
21
+ - โœ… Sets up 3 AI-powered testing agents
22
+ - โœ… Configures VS Code integration automatically
23
+ - โœ… Creates project folders (`.github/chatmodes/`, `.vscode/`)
24
+
25
+ **One-Click Alternative:**
12
26
 
13
27
  [<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522democratize-quality%2522%252C%2522type%2522%253A%2522stdio%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540democratize-quality%252Fmcp-server%2522%255D%252C%2522cwd%2522%253A%2522%2524%257BworkspaceFolder%257D%2522%252C%2522env%2522%253A%257B%2522NODE_ENV%2522%253A%2522production%2522%252C%2522OUTPUT_DIR%2522%253A%2522.%252Fapi-test-reports%2522%257D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522democratize-quality%2522%252C%2522type%2522%253A%2522stdio%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540democratize-quality%252Fmcp-server%2522%255D%252C%2522cwd%2522%253A%2522%2524%257BworkspaceFolder%257D%2522%252C%2522env%2522%253A%257B%2522NODE_ENV%2522%253A%2522production%2522%252C%2522OUTPUT_DIR%2522%253A%2522.%252Fapi-test-reports%2522%257D%257D)
14
28
 
29
+ **Prerequisites:**
30
+ - Node.js 14+ installed
31
+ - VS Code with GitHub Copilot extension (for agents)
32
+ - Active internet connection
15
33
 
16
- > **Choose your installation:** Install the core server for direct tool access. Agent button installs chatmode files for GitHub Copilot Chat integration.
34
+ ### Option 2: Manual Installation
17
35
 
18
- Run following command in your project:
36
+ **For Claude Desktop or other MCP clients:**
19
37
 
38
+ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "democratize-quality": {
44
+ "command": "npx",
45
+ "args": ["@democratize-quality/mcp-server"],
46
+ "env": {
47
+ "NODE_ENV": "production",
48
+ "OUTPUT_DIR": "./api-test-reports"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Global installation option:**
20
56
  ```bash
21
- # Install MCP Server + Agents (Recommended)
22
- npx @democratize-quality/mcp-server --agents
57
+ npm install -g @democratize-quality/mcp-server
58
+
59
+ # Then use anywhere
60
+ democratize-quality-mcp --help
23
61
  ```
24
62
 
25
- ### ๐ŸŽญ Meet Your API Testing Agents
63
+ ---
26
64
 
27
- Once installed, these agents become available in GitHub Copilot Chat:
65
+ ## ๐Ÿ› ๏ธ Available Tools
28
66
 
29
- | Agent | Purpose | Example Usage |
30
- |-------|---------|---------------|
31
- | **๐ŸŒ @api-planner** | Analyze API schemas and create comprehensive test plans | `@๐ŸŒ api-planner analyze the OpenAPI spec at https://api.example.com/swagger.json` |
32
- | **๐ŸŒ @api-generator** | Generate executable tests from test plans | `@๐ŸŒ api-generator create Jest tests from ./api-test-plan.md` |
33
- | **๐ŸŒ @api-healer** | Debug and automatically fix failing API tests | `@๐ŸŒ api-healer fix the failing tests in ./tests/api.test.js` |
67
+ This MCP server provides **7 powerful tools** for comprehensive API testing:
34
68
 
35
- ### ๐Ÿ”„ Complete API Testing Workflow
69
+ ### ๐Ÿค– AI-Powered Testing Tools
36
70
 
37
- **1. Plan** โ†’ **2. Generate** โ†’ **3. Heal** โ†’ **Repeat**
71
+ | Tool | Purpose | When to Use |
72
+ |------|---------|-------------|
73
+ | **`api_planner`** | Analyzes API schemas (OpenAPI/Swagger, GraphQL) and creates comprehensive test plans with realistic sample data | Starting a new API testing project, documenting API behavior, validating API endpoints |
74
+ | **`api_generator`** | Generates executable tests (Jest, Playwright, Postman) from test plans using AI-powered code generation | Converting test plans to runnable code in TypeScript or JavaScript |
75
+ | **`api_healer`** | Debugs and automatically fixes failing tests by analyzing errors and applying healing strategies | Tests break after API changes, schema updates, or authentication issues |
76
+ | **`api_project_setup`** | Detects project configuration (framework and language) for smart test generation | Before using `api_generator` - auto-detects Playwright/Jest and TypeScript/JavaScript |
38
77
 
39
- ```bash
40
- # 1. Analyze your API and create a comprehensive test plan
41
- @๐ŸŒ api-planner analyze our REST API using the OpenAPI spec at /docs/api-spec.yaml
78
+ ### ๐Ÿ”ง Core API Testing Tools
42
79
 
43
- # 2. Generate executable tests from the plan
44
- @๐ŸŒ api-generator create Playwright tests from the generated test plan
80
+ | Tool | Purpose | When to Use |
81
+ |------|---------|-------------|
82
+ | **`api_request`** | Executes HTTP requests with validation and request chaining | Making individual API calls, testing specific endpoints, chaining multiple requests |
83
+ | **`api_session_status`** | Queries test session status and logs | Checking progress of test sequences, viewing request history |
84
+ | **`api_session_report`** | Generates comprehensive HTML test reports | Creating shareable test documentation with detailed analytics |
45
85
 
46
- # 3. If tests fail, automatically heal them
47
- @๐ŸŒ api-healer fix any failing tests and update assertions to match current API behavior
48
- ```
86
+ **Key Capabilities:**
87
+ - โœ… **Smart Validation**: Automatic "expected vs actual" comparison with detailed failure messages
88
+ - ๐Ÿ”— **Request Chaining**: Extract data from one response and use in subsequent requests
89
+ - ๐Ÿ“Š **Session Tracking**: Monitor multi-step API workflows across multiple requests
90
+ - ๐Ÿ“ˆ **Visual Reports**: Interactive HTML reports with timing analysis and validation results
91
+ - ๐ŸŽฏ **All HTTP Methods**: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
92
+ - ๐Ÿ”’ **Authentication**: Support for Bearer tokens, API keys, custom headers
93
+ - ๐ŸŽจ **Realistic Sample Data**: Auto-generates context-aware test data (names, emails, dates, etc.)
94
+ - ๐Ÿ” **Optional Validation**: Validate endpoints by making actual API calls with response time metrics
49
95
 
50
- ### โœจ Key Agent Capabilities
51
96
 
52
- - **๐Ÿ” Schema Analysis**: Automatically parse OpenAPI/Swagger specs and GraphQL schemas
53
- - **๐Ÿ“‹ Intelligent Planning**: Generate comprehensive test scenarios covering functional, security, and edge cases
54
- - **โšก Multi-Format Generation**: Create Jest, Playwright, and Postman tests from the same plan
55
- - **๐Ÿ› ๏ธ Automatic Healing**: Detect and fix common test failures like changed endpoints, updated schemas, and authentication issues
56
- - **๐Ÿ”— Workflow Integration**: Seamlessly work together to maintain your API test suite
97
+ ## ๐ŸŒ Chat Modes (AI Agents)
57
98
 
58
- ### ๐ŸŽฌ See It In Action
99
+ When you install with `--agents`, you get 3 intelligent testing assistants:
59
100
 
60
- > *Coming soon: Video demonstration of the complete API testing workflow*
101
+ ### 1. ๐ŸŒ @api-planner - The Strategist
61
102
 
62
- ---
103
+ **What it does:** Analyzes your API and creates comprehensive test strategies
63
104
 
64
- ## ๐Ÿ“‹ Overview
105
+ **Best for:**
106
+ - Starting new testing projects
107
+ - Documenting API behavior
108
+ - Creating test scenarios for complex workflows
109
+ - Security and edge case planning
65
110
 
66
- This MCP server offers **6 powerful API testing tools** for comprehensive API quality assurance:
111
+ **Example: Analyze a Real API**
112
+ ```
113
+ 1. Select the "๐ŸŒ api-planner" chatmode from GitHub Copilot Chat window and enter following prompt:
67
114
 
68
- ### ๐Ÿค– AI-Powered API Testing Tools
69
- - **`api_planner`**: Analyze API schemas and generate comprehensive test plans
70
- - **`api_generator`**: Generate executable tests (Jest, Playwright, Postman) from test plans
71
- - **`api_healer`**: Debug and automatically fix failing API tests
115
+ 2. Analyze this API and create a comprehensive test plan:
116
+ https://fakerestapi.azurewebsites.net/swagger/v1/swagger.json
72
117
 
73
- ### ๐Ÿ”— Core API Testing Tools
74
- - **`api_request`**: HTTP requests with validation and session management
75
- - **`api_session_status`**: Query API test session status and logs
76
- - **`api_session_report`**: Generate comprehensive HTML test reports
118
+ 3. Agent: I'll call the API planner once to analyze the OpenAPI schema at the provided URL and generate a comprehensive test plan with realistic sample data plus live validation of 5 endpoints; expected outcome: a saved test plan in ./api-test-reports/fakerest-test-plan.md and a validation summary. I'll run the planner now.
77
119
 
78
- **Key Features:**
79
- - ๐Ÿค– **AI-Powered Agents**: Intelligent test planning, generation, and healing
80
- - โœ… **Enhanced Validation**: Shows "expected vs actual" values in validation failures
81
- - ๐Ÿ”— **Request Chaining**: Use response data in subsequent requests
82
- - ๐Ÿ“Š **Session Management**: Track API test sequences across multiple requests
83
- - ๐Ÿ“ˆ **HTML Reports**: Beautiful, interactive test reports with detailed validation results
84
- - ๐ŸŽฏ **Comprehensive Testing**: Support for all HTTP methods with advanced validation options
120
+ 4. When prompted to allow the tool call " Run api_plannerdemocratize-quality (MCP Server)".
85
121
 
86
- ## โšก๏ธ Installation & Setup
122
+ ```
87
123
 
88
- ### Prerequisites
89
- - Node.js 14+
90
- - VS Code with GitHub Copilot extension (for agents)
91
- - MCP-compatible client (Claude Desktop, VS Code, etc.)
124
+ **What you get:**
125
+ - Comprehensive markdown test plan with 40+ test scenarios
126
+ - Realistic sample requests for each endpoint
127
+ - Expected response structures
128
+ - Error scenarios and edge cases
129
+ - Ready for test generation
92
130
 
93
- ### ๐ŸŽญ Agent Installation (Recommended)
131
+ ### 2. ๐ŸŒ @api-generator - The Builder
94
132
 
95
- **For GitHub Copilot Users:**
133
+ **What it does:** Converts test plans into executable code
96
134
 
97
- The fastest way to get started with API testing agents:
135
+ **Best for:**
136
+ - Generating Jest test suites
137
+ - Creating Playwright automation scripts
138
+ - Building Postman collections
98
139
 
99
- ```bash
100
- # Install agents in your VS Code project
101
- npx @democratize-quality/mcp-server --agents
140
+ **Example: Generate Tests from Plan**
102
141
  ```
142
+ 1. Once you have the test plan generated as part of API Planner mode, now change the chatmode to : "๐ŸŒ api-generator", open the test plan MD file created in previous step (so that it can be in context) and enter following prompt
143
+ Create Playwright tests in TypeScript for the Books API section
103
144
 
104
- This will:
105
- - ๐Ÿ“ Copy chatmode files to `.github/chatmodes/`
106
- - โš™๏ธ Set up MCP configuration in `.vscode/mcp.json`
107
- - ๐ŸŽฏ Enable `@๐ŸŒ api-planner`, `@๐ŸŒ api-generator`, and `@๐ŸŒ api-healer` agents
145
+ 2. Agent: I'm going to detect the project's test framework/language (required first step) so I can generate Playwright TypeScript tests in the correct layout; expected outcome: detection result with suggested framework/language. Then ask you to allow the another tool "Run api_project_setupdemocratize-quality (MCP Server)" for capturing the project info e.g. if you have an empty project then it will ask to select the framework/language otherwise if your project is playwright typescript it will create playwright test(s) accordingly.
108
146
 
109
- **Alternative one-click installation:**
147
+ 3. After you answer, it invoke tool "Run api_generatordemocratize-quality (MCP Server)" which will actually generate your tests, click "Allow"
110
148
 
111
- [<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522democratize-quality%2522%252C%2522type%2522%253A%2522stdio%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540democratize-quality%252Fmcp-server%2522%255D%252C%2522cwd%2522%253A%2522%2524%257BworkspaceFolder%257D%2522%252C%2522env%2522%253A%257B%2522NODE_ENV%2522%253A%2522production%2522%252C%2522OUTPUT_DIR%2522%253A%2522.%252Fapi-test-reports%2522%257D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522democratize-quality%2522%252C%2522type%2522%253A%2522stdio%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540democratize-quality%252Fmcp-server%2522%255D%252C%2522cwd%2522%253A%2522%2524%257BworkspaceFolder%257D%2522%252C%2522env%2522%253A%257B%2522NODE_ENV%2522%253A%2522production%2522%252C%2522OUTPUT_DIR%2522%253A%2522.%252Fapi-test-reports%2522%257D%257D)
149
+ Created files:
150
+ โœ… With Books CRUD operations
151
+ โœ… Show on screen instructions for running the tests
112
152
 
113
- **For GitHub Copilot Agents:** [![Install Agents](https://img.shields.io/badge/Install_Agents-GitHub_Copilot-purple?style=flat-square&logo=github)](vscode:extension/GitHub.copilot-chat?command=workbench.action.quickOpen&text=%40terminal%20npx%20%40democratize-quality%2Fmcp-server%20--agents)
153
+ Tests include:
154
+ - โœ… GET /api/v1/Books - List all books
155
+ - โœ… GET /api/v1/Books/{id} - Get book by ID
156
+ - โœ… POST /api/v1/Books - Create new book
157
+ - โœ… PUT /api/v1/Books/{id} - Update book
158
+ - โœ… DELETE /api/v1/Books/{id} - Delete book
159
+ - โœ… Error handling for invalid IDs
160
+ - โœ… Validation for required fields
114
161
 
115
- ### ๐Ÿ› ๏ธ Manual Installation Options
162
+ ```
116
163
 
117
- **Option 1: Use with npx (Recommended)**
118
- ```bash
119
- # Run directly without installation
120
- npx @democratize-quality/mcp-server --help
164
+ **Example: Generate Postman Collection**
165
+ ```
166
+ You: @๐ŸŒ api-generator create a Postman collection from the entire test plan
167
+
168
+ Agent: Creating Postman collection for Fake REST API...
169
+
170
+ Generated:
171
+ โœ… postman/FakeRestAPI.postman_collection.json
172
+ โœ… postman/environment.json (with base URL variables)
121
173
 
122
- # Use in Claude Desktop (see integration section below)
174
+ Sample Collection includes:
175
+ - ๐Ÿ“ Books (5 requests)
176
+ - ๐Ÿ“ Users (4 requests)
177
+ - ๐Ÿ“ Authors (4 requests)
178
+ - ๐Ÿ“ Activities (3 requests)
179
+ - ๐Ÿ“ CoverPhotos (4 requests)
180
+
181
+ Import into Postman and start testing!
123
182
  ```
124
183
 
125
- **Option 2: Global Installation**
126
- ```bash
127
- # Install globally
128
- npm install -g @democratize-quality/mcp-server
184
+ ### 3. ๐ŸŒ @api-healer - The Fixer
129
185
 
130
- # Then run anywhere
131
- democratize-quality-mcp --help
132
- dq-mcp-server --help
186
+ **What it does:** Automatically diagnoses and repairs failing tests
187
+
188
+ **Best for:**
189
+ - Fixing broken tests after API changes
190
+ - Updating endpoint URLs
191
+ - Resolving authentication issues
192
+ - Schema mismatch corrections
193
+
194
+ **Example: Fix Failing Tests**
133
195
  ```
196
+ You: @๐ŸŒ api-healer the Books tests are failing with 404 errors.
197
+ Please analyze and fix them.
134
198
 
135
- **Option 3: Local Development**
136
- ```bash
137
- # Clone and install dependencies
138
- git clone https://github.com/uppadhyayraj/democratize-quality-mcp-server.git
139
- cd mcp-server
140
- npm install
199
+ Agent: Analyzing test failures in tests/books.spec.ts...
141
200
 
142
- # Test the server
143
- npm test
201
+ Issues found:
202
+ โŒ Endpoint changed: /api/Books โ†’ /api/v1/Books
203
+ โŒ Response schema updated: added "pageCount" field
204
+ โŒ ID format changed: number โ†’ string
144
205
 
145
- # Start the server (API-only mode by default)
146
- npm start
206
+ Applying fixes:
207
+ โœ… Updated all endpoint URLs to include /v1/ prefix
208
+ โœ… Updated response assertions to include pageCount
209
+ โœ… Fixed ID type in test data (42 โ†’ "42")
210
+ โœ… Backed up original file to tests/books.spec.ts.backup
211
+
212
+ Re-running tests... โœ… All 15 tests now passing!
147
213
  ```
148
214
 
149
- ## ๐Ÿ”Œ Integration Methods
215
+ **Example: Fix Schema Mismatches**
216
+ ```
217
+ You: @๐ŸŒ api-healer fix assertion errors in tests/users.spec.ts
150
218
 
151
- ### Claude Desktop Integration (Recommended)
219
+ Agent: Analyzing assertion failures...
152
220
 
153
- Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
221
+ Found 3 schema mismatches:
222
+ โŒ Expected userName, API returns username (camelCase issue)
223
+ โŒ Password field removed from response (security update)
224
+ โŒ New field added: profileImageUrl
154
225
 
155
- ```json
156
- {
157
- "mcpServers": {
158
- "democratize-quality": {
159
- "command": "npx",
160
- "args": ["@democratize-quality/mcp-server"],
161
- "env": {
162
- "NODE_ENV": "production"
163
- }
164
- }
165
- }
166
- }
226
+ Healing actions:
227
+ โœ… Updated assertions: userName โ†’ username
228
+ โœ… Removed password field validation
229
+ โœ… Added profileImageUrl to expected response
230
+ โœ… Updated TypeScript interfaces
231
+
232
+ Tests healed successfully! โœ… 12/12 passing
167
233
  ```
168
234
 
169
- > **Note:** The server runs in `api-only` mode by default, providing secure and lightweight API testing capabilities.
235
+ ---
236
+
237
+ ## ๐Ÿ’ก Usage Examples - E2E Testing Scenarios
170
238
 
171
- ### Alternative Integration Methods
239
+ ### Scenario 1: Testing the Fake REST API (Complete Workflow)
172
240
 
173
- **Global Installation:**
174
- ```bash
175
- npm install -g @democratize-quality/mcp-server
241
+ **Real-world example using: https://fakerestapi.azurewebsites.net**
242
+
243
+ **Step 1: Plan your tests**
244
+ ```
245
+ @๐ŸŒ api-planner analyze the OpenAPI spec at
246
+ https://fakerestapi.azurewebsites.net/swagger/v1/swagger.json
247
+ and create a comprehensive test plan focusing on Books and Authors endpoints
176
248
  ```
177
249
 
178
- Then configure Claude Desktop:
179
- ```json
180
- {
181
- "mcpServers": {
182
- "democratize-quality": {
183
- "command": "democratize-quality-mcp"
184
- }
250
+ **What happens:**
251
+ - โœ… Agent analyzes the Fake REST API schema
252
+ - โœ… Identifies 5 resource types (Books, Authors, Users, Activities, CoverPhotos)
253
+ - โœ… Creates 40+ test scenarios covering:
254
+ - Happy paths (GET all books, GET book by ID, CREATE book)
255
+ - Error cases (404 for invalid IDs, 400 for bad data)
256
+ - Edge cases (empty lists, ID boundaries)
257
+ - Data validation (response schema checks)
258
+ - โœ… Generates realistic sample data:
259
+ ```json
260
+ {
261
+ "id": 1,
262
+ "title": "The Great Gatsby",
263
+ "description": "A classic American novel",
264
+ "pageCount": 180,
265
+ "excerpt": "In my younger and more vulnerable years...",
266
+ "publishDate": "1925-04-10T00:00:00Z"
185
267
  }
186
- }
187
- ```
268
+ ```
188
269
 
189
- **MCP Inspector (Development/Testing):**
190
- ```bash
191
- npx @modelcontextprotocol/inspector npx @democratize-quality/mcp-server
270
+ **Step 2: Generate executable tests**
271
+ ```
272
+ @๐ŸŒ api-generator create Playwright tests in TypeScript from the test plan,
273
+ focusing on the Books API section
192
274
  ```
193
275
 
194
- **Direct Usage:**
195
- ```bash
196
- # Run the server directly
197
- npx @democratize-quality/mcp-server
276
+ **What you get:**
277
+ - `tests/books.spec.ts` - Complete Books CRUD test suite
278
+ ```typescript
279
+ import { test, expect } from '@playwright/test';
280
+
281
+ test.describe('Books API', () => {
282
+ test('GET /api/v1/Books - should return all books', async ({ request }) => {
283
+ const response = await request.get('https://fakerestapi.azurewebsites.net/api/v1/Books');
284
+ expect(response.ok()).toBeTruthy();
285
+ expect(response.status()).toBe(200);
286
+ const books = await response.json();
287
+ expect(Array.isArray(books)).toBeTruthy();
288
+ });
289
+
290
+ test('POST /api/v1/Books - should create a new book', async ({ request }) => {
291
+ const newBook = {
292
+ id: 201,
293
+ title: "Test Book",
294
+ pageCount: 350
295
+ };
296
+ const response = await request.post('https://fakerestapi.azurewebsites.net/api/v1/Books', {
297
+ data: newBook
298
+ });
299
+ expect(response.status()).toBe(200);
300
+ });
301
+ });
302
+ ```
303
+
304
+ **Step 3: Run and heal tests**
305
+ ```
306
+ # Run tests
307
+ npx playwright test tests/books.spec.ts
198
308
 
199
- # Or if installed globally
200
- democratize-quality-mcp
309
+ # If any tests fail due to API changes:
310
+ @๐ŸŒ api-healer fix the failing tests in tests/books.spec.ts
201
311
  ```
202
312
 
203
- ## ๐Ÿ“š Usage Examples
313
+ **What healer fixes:**
314
+ - โœ… Endpoint URL updates (if API version changes)
315
+ - โœ… Response schema corrections (new/removed fields)
316
+ - โœ… Data type adjustments (string vs number IDs)
317
+ - โœ… Status code updates
204
318
 
205
- ### ๐Ÿค– Agent-Powered API Testing Workflow
319
+ ### Scenario 2: Quick API Documentation with Postman
206
320
 
207
- **Complete end-to-end API testing with intelligent agents:**
321
+ **What healer fixes:**
322
+ - โœ… Endpoint URL updates (if API version changes)
323
+ - โœ… Response schema corrections (new/removed fields)
324
+ - โœ… Data type adjustments (string vs number IDs)
325
+ - โœ… Status code updates
208
326
 
209
- ```bash
210
- # 1. ๐Ÿ” Analyze API and create comprehensive test plan
211
- @๐ŸŒ api-planner analyze our user management API using the OpenAPI spec at https://api.example.com/swagger.json
327
+ ### Scenario 2: Quick API Documentation with Postman
212
328
 
213
- # 2. โšก Generate executable tests in multiple formats
214
- @๐ŸŒ api-generator create Jest and Playwright tests from the generated test plan
329
+ **Goal:** Generate a ready-to-use Postman collection for the Fake REST API
215
330
 
216
- # 3. ๐Ÿ› ๏ธ Automatically heal any failing tests
217
- @๐ŸŒ api-healer fix the failing authentication tests in ./tests/user-api.test.js
218
331
  ```
332
+ Step 1:
333
+ @๐ŸŒ api-planner create test plan from
334
+ https://fakerestapi.azurewebsites.net/swagger/v1/swagger.json
335
+ with validation enabled to test actual endpoints
219
336
 
220
- **Individual agent usage:**
337
+ Step 2:
338
+ @๐ŸŒ api-generator create Postman collection from the test plan
339
+ with all endpoints and example requests
221
340
 
222
- ```bash
223
- # API Planning Agent
224
- @๐ŸŒ api-planner create a test plan for our REST API with authentication, CRUD operations, and error handling scenarios
341
+ Step 3:
342
+ Import the generated collection into Postman and start testing!
343
+ ```
225
344
 
226
- # Test Generation Agent
227
- @๐ŸŒ api-generator generate Postman collection from ./docs/api-test-plan.md with authentication setup
345
+ **What you get:**
346
+ - ๐Ÿ“ฆ `postman/FakeRestAPI.postman_collection.json` - Complete collection
347
+ - ๐ŸŒ `postman/environment.json` - Environment variables
348
+ - โœ… 20+ pre-configured requests across all resource types
349
+ - ๐Ÿ“ Example request bodies with realistic data
350
+ - โœ”๏ธ Response validation tests included
228
351
 
229
- # Test Healing Agent
230
- @๐ŸŒ api-healer analyze and fix all failing tests in ./tests/ directory with detailed healing report
231
- ```
352
+ **Result:** Professional Postman collection ready to share with your team
232
353
 
233
- ### ๐ŸŽฏ Real-World Agent Scenarios
354
+ ---
234
355
 
235
- **Scenario 1: New API Testing**
236
- ```bash
237
- # Start with schema analysis
238
- @๐ŸŒ api-planner analyze the GraphQL schema at /graphql/schema and create comprehensive test scenarios
356
+ ## ๐Ÿ”ง Calling Individual Tools
357
+
358
+ ### When to Use Individual Tools
359
+
360
+ **Use agents (@api-planner, @api-generator, @api-healer) when:**
361
+ - You want AI assistance and recommendations
362
+ - You're working on complex, multi-step workflows
363
+ - You need explanations and best practices
364
+
365
+ **Use individual tools when:**
366
+ - You need precise control over parameters
367
+ - You're automating tests in CI/CD
368
+ - You're integrating with other tools
369
+ - You want to script repetitive tasks
239
370
 
240
- # Generate tests for multiple environments
241
- @๐ŸŒ api-generator create Jest tests with environment-specific configurations for dev, staging, and prod
371
+ ### Tool 1: `api_planner`
242
372
 
243
- # Heal tests after API changes
244
- @๐ŸŒ api-healer update tests to handle the new authentication flow and endpoint changes
373
+ ```
374
+ @๐ŸŒ api-generator create Jest tests with environment-specific configurations
375
+ for dev (api-dev.example.com), staging (api-staging.example.com),
376
+ and prod (api.example.com) environments
245
377
  ```
246
378
 
247
- **Scenario 2: Legacy API Modernization**
248
- ```bash
249
- # Document existing API behavior
250
- @๐ŸŒ api-planner explore and document our legacy API endpoints by testing various HTTP methods
379
+ **What you get:**
380
+ ```javascript
381
+ // tests/config/environments.js
382
+ module.exports = {
383
+ dev: { baseURL: 'https://api-dev.example.com', timeout: 5000 },
384
+ staging: { baseURL: 'https://api-staging.example.com', timeout: 3000 },
385
+ prod: { baseURL: 'https://api.example.com', timeout: 2000 }
386
+ };
387
+
388
+ // Run with: NODE_ENV=staging npm test
389
+ ```
390
+
391
+ ---
392
+
393
+ ## ๏ฟฝ Calling Individual Tools
394
+
395
+ ### When to Use Individual Tools
396
+
397
+ **Use agents (@api-planner, @api-generator, @api-healer) when:**
398
+ - You want AI assistance and recommendations
399
+ - You're working on complex, multi-step workflows
400
+ - You need explanations and best practices
401
+
402
+ **Use individual tools when:**
403
+ - You need precise control over parameters
404
+ - You're automating tests in CI/CD
405
+ - You're integrating with other tools
406
+ - You want to script repetitive tasks
251
407
 
252
- # Create modern test suite
253
- @๐ŸŒ api-generator create comprehensive Playwright tests with modern async/await patterns
408
+ ### Tool 1: `api_planner`
254
409
 
255
- # Fix compatibility issues
256
- @๐ŸŒ api-healer resolve test failures caused by API versioning and deprecated endpoints
410
+ **Purpose:** Analyze API schemas and generate comprehensive test plans with realistic sample data
411
+
412
+ **Basic usage:**
413
+ ```javascript
414
+ // In Claude Desktop or MCP client
415
+ {
416
+ "tool": "api_planner",
417
+ "parameters": {
418
+ "schemaUrl": "https://api.example.com/swagger.json",
419
+ "schemaType": "openapi",
420
+ "outputPath": "./test-plan.md"
421
+ }
422
+ }
257
423
  ```
258
424
 
259
- ### ๐Ÿ”ง Manual API Testing (Core Tools)
425
+ **With endpoint validation:**
426
+ ```javascript
427
+ {
428
+ "tool": "api_planner",
429
+ "parameters": {
430
+ "schemaUrl": "https://petstore3.swagger.io/api/v3/openapi.json",
431
+ "schemaType": "openapi",
432
+ "outputPath": "./api-test-plan.md",
433
+ "includeAuth": true,
434
+ "includeSecurity": true,
435
+ "includeErrorHandling": true,
436
+ "testCategories": ["functional", "security", "edge-cases"],
437
+ "validateEndpoints": true,
438
+ "validationSampleSize": 3,
439
+ "validationTimeout": 5000
440
+ }
441
+ }
442
+ ```
260
443
 
261
- **When you need direct control over API testing:**
444
+ **Parameters explained:**
445
+ - `schemaUrl` - URL to fetch API schema (OpenAPI/Swagger, GraphQL introspection endpoint)
446
+ - `schemaContent` - Direct schema content as JSON/YAML string (alternative to schemaUrl)
447
+ - `schemaType` - Type of schema: `openapi`, `swagger`, `graphql`, `auto` (default: auto)
448
+ - `apiBaseUrl` - Base URL of the API (overrides schema baseUrl if provided)
449
+ - `includeAuth` - Include authentication testing scenarios (default: true)
450
+ - `includeSecurity` - Include security testing scenarios (default: true)
451
+ - `includeErrorHandling` - Include error handling scenarios (default: true)
452
+ - `outputPath` - File path to save test plan (default: ./api-test-plan.md)
453
+ - `testCategories` - Types of tests: `functional`, `security`, `performance`, `integration`, `edge-cases`
454
+ - `validateEndpoints` - Make actual API calls to validate endpoints (default: false)
455
+ - `validationSampleSize` - Number of endpoints to validate, use -1 for all (default: 3)
456
+ - `validationTimeout` - Timeout per validation request in ms (default: 5000)
457
+
458
+ ### Tool 2: `api_generator`
459
+
460
+ **Purpose:** Generate executable tests (Playwright, Jest, Postman) from test plans using AI
461
+
462
+ **Generate Playwright tests:**
463
+ ```javascript
464
+ {
465
+ "tool": "api_generator",
466
+ "parameters": {
467
+ "testPlanPath": "./test-plan.md",
468
+ "outputFormat": "playwright",
469
+ "outputDir": "./tests",
470
+ "includeSetup": true,
471
+ "language": "typescript"
472
+ }
473
+ }
474
+ ```
262
475
 
263
- ### Basic API Testing
476
+ **Generate Jest tests:**
477
+ ```javascript
478
+ {
479
+ "tool": "api_generator",
480
+ "parameters": {
481
+ "testPlanPath": "./test-plan.md",
482
+ "outputFormat": "jest",
483
+ "outputDir": "./tests",
484
+ "testFramework": "jest",
485
+ "baseUrl": "https://api.example.com"
486
+ }
487
+ }
488
+ ```
264
489
 
490
+ **Generate Postman collection:**
265
491
  ```javascript
266
- // Single API request with validation
267
- await tools.api_request({
268
- method: "GET",
269
- url: "https://jsonplaceholder.typicode.com/users/1",
270
- expect: {
271
- status: 200,
272
- contentType: "application/json"
492
+ {
493
+ "tool": "api_generator",
494
+ "parameters": {
495
+ "testPlanPath": "./test-plan.md",
496
+ "outputFormat": "postman",
497
+ "outputDir": "./postman",
498
+ "includeAuth": true
499
+ }
500
+ }
501
+ ```
502
+
503
+ **Generate all formats:**
504
+ ```javascript
505
+ {
506
+ "tool": "api_generator",
507
+ "parameters": {
508
+ "testPlanPath": "./test-plan.md",
509
+ "outputFormat": "all",
510
+ "outputDir": "./tests",
511
+ "language": "typescript"
273
512
  }
274
- })
513
+ }
275
514
  ```
276
515
 
277
- ### Advanced API Testing with Session Management
516
+ **Parameters explained:**
517
+ - `testPlanPath` - Path to test plan markdown file
518
+ - `testPlanContent` - Direct test plan content as markdown (alternative to testPlanPath)
519
+ - `outputFormat` - Format: `playwright`, `postman`, `jest`, `all` (default: all)
520
+ - `outputDir` - Directory to save generated tests (default: ./tests)
521
+ - `sessionId` - Session ID for tracking generated tests
522
+ - `includeAuth` - Include authentication setup (default: true)
523
+ - `includeSetup` - Include test setup/teardown code (default: true)
524
+ - `testFramework` - Framework: `jest`, `mocha`, `playwright-test`
525
+ - `baseUrl` - Base URL for API (optional)
526
+ - `language` - Language: `javascript`, `typescript` (default: typescript)
527
+
528
+ ### Tool 3: `api_healer`
529
+
530
+ **Purpose:** Debug and automatically fix failing API tests
278
531
 
532
+ **Fix specific test file:**
279
533
  ```javascript
280
- // 1. Start a test session
281
- await tools.api_request({
282
- sessionId: "user-workflow-test",
283
- method: "POST",
284
- url: "https://jsonplaceholder.typicode.com/users",
285
- data: {
286
- name: "John Doe",
287
- email: "john@example.com"
288
- },
289
- expect: { status: 201 }
290
- })
291
-
292
- // 2. Follow up request in same session
293
- await tools.api_request({
294
- sessionId: "user-workflow-test",
295
- method: "GET",
296
- url: "https://jsonplaceholder.typicode.com/users/1",
297
- expect: {
298
- status: 200,
299
- body: { name: "John Doe" }
534
+ {
535
+ "tool": "api_healer",
536
+ "parameters": {
537
+ "testPath": "./tests/auth.test.js",
538
+ "testType": "auto",
539
+ "autoFix": true,
540
+ "backupOriginal": true
541
+ }
542
+ }
543
+ ```
544
+
545
+ **Fix multiple test files:**
546
+ ```javascript
547
+ {
548
+ "tool": "api_healer",
549
+ "parameters": {
550
+ "testFiles": ["./tests/auth.test.js", "./tests/users.test.js"],
551
+ "testType": "playwright",
552
+ "healingStrategies": ["schema-update", "endpoint-fix", "auth-repair"]
300
553
  }
301
- })
554
+ }
555
+ ```
302
556
 
303
- // 3. Generate comprehensive HTML report
304
- await tools.api_session_report({
305
- sessionId: "user-workflow-test",
306
- outputPath: "user_workflow_test_report.html"
307
- })
557
+ **Analysis only (no fixes):**
558
+ ```javascript
559
+ {
560
+ "tool": "api_healer",
561
+ "parameters": {
562
+ "testPath": "./tests/api.test.js",
563
+ "analysisOnly": true
564
+ }
565
+ }
308
566
  ```
309
567
 
310
- ### Request Chaining Example
568
+ **Parameters explained:**
569
+ - `testPath` - Path to a specific test file to heal
570
+ - `testFiles` - Array of test file paths (alternative to testPath)
571
+ - `testType` - Type: `jest`, `playwright`, `postman`, `auto` (default: auto)
572
+ - `sessionId` - Session ID for tracking healing process
573
+ - `maxHealingAttempts` - Max attempts per test (default: 3)
574
+ - `autoFix` - Automatically apply fixes (default: true)
575
+ - `backupOriginal` - Create backup files (default: true)
576
+ - `analysisOnly` - Only analyze without fixing (default: false)
577
+ - `healingStrategies` - Specific strategies: `schema-update`, `endpoint-fix`, `auth-repair`, `data-correction`, `assertion-update`
578
+
579
+ ### Tool 4: `api_project_setup`
311
580
 
581
+ **Purpose:** Detect project configuration for test generation
582
+
583
+ **Detect project configuration:**
312
584
  ```javascript
313
- // Chain requests using response data
314
- await tools.api_request({
315
- sessionId: "chained-test",
316
- chain: [
585
+ {
586
+ "tool": "api_project_setup",
587
+ "parameters": {
588
+ "outputDir": "./tests"
589
+ }
590
+ }
591
+ ```
592
+
593
+ **What it does:**
594
+ - Scans for `playwright.config.ts/js`, `jest.config.ts/js`, `tsconfig.json`
595
+ - Auto-detects framework (Playwright/Jest) and language (TypeScript/JavaScript)
596
+ - Returns configuration or prompts user if ambiguous
597
+ - **Must be called BEFORE `api_generator`** for optimal test generation
598
+
599
+ **Response (when auto-detected):**
600
+ ```json
601
+ {
602
+ "success": true,
603
+ "autoDetected": true,
604
+ "config": {
605
+ "framework": "playwright",
606
+ "language": "typescript",
607
+ "hasTypeScript": true,
608
+ "hasPlaywrightConfig": true,
609
+ "configFiles": ["playwright.config.ts", "tsconfig.json"]
610
+ },
611
+ "nextStep": "Call api_generator with outputFormat: 'playwright' and language: 'typescript'"
612
+ }
613
+ ```
614
+
615
+ **Response (when user input needed):**
616
+ ```json
617
+ {
618
+ "success": true,
619
+ "needsUserInput": true,
620
+ "prompts": [
317
621
  {
318
- name: "create_user",
319
- method: "POST",
320
- url: "https://jsonplaceholder.typicode.com/users",
321
- data: { name: "Jane Doe", email: "jane@example.com" },
322
- expect: { status: 201 },
323
- extract: { userId: "id" }
622
+ "name": "framework",
623
+ "question": "Which test framework would you like to use?",
624
+ "choices": ["playwright", "jest", "postman", "all"]
324
625
  },
325
626
  {
326
- name: "get_user",
327
- method: "GET",
328
- url: "https://jsonplaceholder.typicode.com/users/{{ create_user.userId }}",
329
- expect: {
330
- status: 200,
331
- body: { name: "Jane Doe" }
332
- }
627
+ "name": "language",
628
+ "question": "Which language would you like to use?",
629
+ "choices": ["typescript", "javascript"]
333
630
  }
334
631
  ]
335
- })
632
+ }
336
633
  ```
337
634
 
338
- ๐Ÿ“– **For comprehensive API testing examples and advanced usage patterns, see:** [API Tools Usage Guide](docs/api_tools_usage.md)
339
-
340
- ## โš™๏ธ Configuration
635
+ **Parameters:**
636
+ - `outputDir` - Directory for tests (default: `./tests`). Used to locate project root
637
+ - `promptUser` - Force user prompts even if config detected (default: false)
341
638
 
342
- ### Environment Settings
639
+ ### Tool 5: `api_request`
343
640
 
344
- The server runs in **API-only mode** by default for secure, lightweight deployments focused on API testing.
641
+ **Purpose:** Execute individual HTTP requests with validation
345
642
 
346
- ```bash
347
- NODE_ENV=production # Default: API-only mode
348
- OUTPUT_DIR=./output # Output directory for reports
349
- MCP_FEATURES_ENABLEDEBUGMODE=true # Enable debug logging
643
+ **Simple GET request:**
644
+ ```javascript
645
+ {
646
+ "tool": "api_request",
647
+ "parameters": {
648
+ "method": "GET",
649
+ "url": "https://api.example.com/users/1",
650
+ "expect": {
651
+ "status": 200,
652
+ "contentType": "application/json"
653
+ }
654
+ }
655
+ }
350
656
  ```
351
657
 
352
- ### Command Line Options
353
- ```bash
354
- npx @democratize-quality/mcp-server [options]
355
-
356
- Options:
357
- --help, -h Show help
358
- --version, -v Show version
359
- --agents Install GitHub Copilot Chat agents and VS Code MCP configuration
360
- --agents --rollback Rollback agents installation (future feature)
361
- --debug Enable debug mode
362
- --verbose Enable verbose output (useful with --agents)
363
- --port <number> Set server port
658
+ **POST with authentication:**
659
+ ```javascript
660
+ {
661
+ "tool": "api_request",
662
+ "parameters": {
663
+ "method": "POST",
664
+ "url": "https://api.example.com/users",
665
+ "headers": {
666
+ "Authorization": "Bearer your-token-here",
667
+ "Content-Type": "application/json"
668
+ },
669
+ "data": {
670
+ "name": "John Doe",
671
+ "email": "john@example.com"
672
+ },
673
+ "expect": {
674
+ "status": 201,
675
+ "body": {
676
+ "name": "John Doe",
677
+ "email": "john@example.com"
678
+ }
679
+ }
680
+ }
681
+ }
364
682
  ```
365
683
 
366
- ### Agent Installation Options
367
- ```bash
368
- # Install agents with default settings
369
- npx @democratize-quality/mcp-server --agents
684
+ **Request chaining (use response in next request):**
685
+ ```javascript
686
+ {
687
+ "tool": "api_request",
688
+ "parameters": {
689
+ "sessionId": "user-workflow",
690
+ "chain": [
691
+ {
692
+ "name": "create_user",
693
+ "method": "POST",
694
+ "url": "https://api.example.com/users",
695
+ "data": { "name": "Jane Doe" },
696
+ "extract": { "userId": "id" }
697
+ },
698
+ {
699
+ "name": "get_user",
700
+ "method": "GET",
701
+ "url": "https://api.example.com/users/{{ create_user.userId }}",
702
+ "expect": { "status": 200 }
703
+ }
704
+ ]
705
+ }
706
+ }
707
+ ```
370
708
 
371
- # Install with verbose output
372
- npx @democratize-quality/mcp-server --agents --verbose
709
+ **Parameters explained:**
710
+ - `method` - HTTP method (GET, POST, PUT, DELETE, PATCH, etc.)
711
+ - `url` - Target endpoint
712
+ - `headers` - Custom headers (authentication, content-type)
713
+ - `data` - Request body for POST/PUT/PATCH
714
+ - `expect` - Validation rules (status, headers, body)
715
+ - `sessionId` - Group related requests
716
+ - `chain` - Execute multiple requests in sequence
373
717
 
374
- # Future: Rollback installation
375
- npx @democratize-quality/mcp-server --agents --rollback
376
- ```
718
+ ### Tool 6: `api_session_status`
377
719
 
378
- ### Configuration Examples
720
+ **Purpose:** Check status of API test sessions
379
721
 
380
- #### VS Code MCP Configuration (Auto-generated by --agents)
381
- When you run `npx @democratize-quality/mcp-server --agents`, this configuration is automatically created in `.vscode/mcp.json`:
722
+ **Check session progress:**
723
+ ```javascript
724
+ {
725
+ "tool": "api_session_status",
726
+ "parameters": {
727
+ "sessionId": "user-workflow"
728
+ }
729
+ }
730
+ ```
382
731
 
732
+ **Response example:**
383
733
  ```json
384
734
  {
385
- "servers": {
386
- "democratize-quality": {
387
- "type": "stdio",
388
- "command": "npx",
389
- "args": ["@democratize-quality/mcp-server"],
390
- "cwd": "${workspaceFolder}",
391
- "env": {
392
- "NODE_ENV": "production",
393
- "OUTPUT_DIR": "./api-test-reports"
394
- }
395
- }
396
- },
397
- "inputs": []
735
+ "sessionId": "user-workflow",
736
+ "totalRequests": 5,
737
+ "successfulRequests": 4,
738
+ "failedRequests": 1,
739
+ "status": "completed",
740
+ "startTime": "2025-10-23T10:00:00Z",
741
+ "endTime": "2025-10-23T10:05:00Z",
742
+ "duration": "5 minutes"
398
743
  }
399
744
  ```
400
745
 
401
- > **Note:** If you already have an `mcp.json` file, the installation will safely merge the configuration and create a backup.
746
+ ### Tool 7: `api_session_report`
402
747
 
403
- #### Basic Claude Desktop Configuration
404
- ```json
748
+ **Purpose:** Generate comprehensive HTML test reports
749
+
750
+ **Generate report:**
751
+ ```javascript
405
752
  {
406
- "mcpServers": {
407
- "democratize-quality": {
408
- "command": "npx",
409
- "args": ["@democratize-quality/mcp-server"],
410
- "env": {
411
- "OUTPUT_DIR": "~/api-test-reports"
412
- }
413
- }
753
+ "tool": "api_session_report",
754
+ "parameters": {
755
+ "sessionId": "user-workflow",
756
+ "outputPath": "./reports/user-workflow-report.html",
757
+ "includeCharts": true
414
758
  }
415
759
  }
416
760
  ```
417
761
 
418
- #### Debug Mode Configuration
762
+ **What you get:**
763
+ - ๐Ÿ“Š Visual charts (success rate, response times)
764
+ - ๐Ÿ“‹ Request/response details
765
+ - โœ… Validation results (pass/fail with diffs)
766
+ - ๐Ÿ• Timing information
767
+ - ๐Ÿ“ธ Screenshots (if applicable)
768
+
769
+ ---
770
+ ---
771
+
772
+ ## โš™๏ธ Configuration
773
+
774
+ ### Environment Variables
775
+
776
+ ```bash
777
+ NODE_ENV=production # Run in production mode (default)
778
+ OUTPUT_DIR=./api-test-reports # Where to save reports (default)
779
+ MCP_FEATURES_ENABLEDEBUGMODE=true # Enable detailed logging
780
+ ```
781
+
782
+ ### Command-Line Options
783
+
784
+ ```bash
785
+ npx @democratize-quality/mcp-server [options]
786
+
787
+ Options:
788
+ --help, -h Show help information
789
+ --version, -v Display version number
790
+ --agents Install AI testing agents for GitHub Copilot
791
+ --debug Enable debug mode with detailed logs
792
+ --verbose Show detailed installation output
793
+ --port <number> Specify server port (if needed)
794
+ ```
795
+
796
+ ### VS Code MCP Configuration
797
+
798
+ After running `--agents`, this file is created at `.vscode/mcp.json`:
799
+
419
800
  ```json
420
801
  {
421
- "mcpServers": {
802
+ "servers": {
422
803
  "democratize-quality": {
804
+ "type": "stdio",
423
805
  "command": "npx",
424
- "args": ["@democratize-quality/mcp-server", "--debug"],
806
+ "args": ["@democratize-quality/mcp-server"],
807
+ "cwd": "${workspaceFolder}",
425
808
  "env": {
426
- "MCP_FEATURES_ENABLEDEBUGMODE": "true"
809
+ "NODE_ENV": "production",
810
+ "OUTPUT_DIR": "./api-test-reports"
427
811
  }
428
812
  }
429
813
  }
430
814
  }
431
815
  ```
432
816
 
433
- ### Output Directory Behavior
434
- - **VS Code/Local**: Uses `./output` in your project directory
435
- - **Claude Desktop**: Uses `~/.mcp-browser-control` (in your home directory)
436
- - **Custom**: Set `OUTPUT_DIR` environment variable to specify location
817
+ ### Output Directory Locations
437
818
 
438
- > **Note:** API test reports and session data will be saved to the configured output directory.
819
+ - **VS Code/Local Projects**: `./api-test-reports` in your project
820
+ - **Claude Desktop**: `~/.mcp-browser-control` in your home directory
821
+ - **Custom Location**: Set `OUTPUT_DIR` environment variable
439
822
 
440
- ## ๐Ÿ”ง Troubleshooting
823
+ ---
824
+
825
+ ---
826
+
827
+ ## ๏ฟฝ Troubleshooting
441
828
 
442
829
  ### Agent Installation Issues
443
830
 
444
- **1. Agents not appearing in GitHub Copilot Chat**
445
- - Ensure you've restarted VS Code after running `--agents` installation
446
- - Check that `.vscode/mcp.json` was created in your project root
447
- - Verify GitHub Copilot extension is installed and enabled
448
- - Try refreshing the workspace: `Ctrl/Cmd + Shift + P` โ†’ "Developer: Reload Window"
831
+ <details>
832
+ <summary><strong>Agents not appearing in GitHub Copilot Chat</strong></summary>
833
+
834
+ **Solution:**
835
+ 1. Restart VS Code completely
836
+ 2. Verify `.vscode/mcp.json` exists in your project root
837
+ 3. Check that GitHub Copilot extension is installed and active
838
+ 4. Reload the workspace: `Cmd/Ctrl + Shift + P` โ†’ "Developer: Reload Window"
839
+
840
+ </details>
841
+
842
+ <details>
843
+ <summary><strong>"democratize-quality server not found" error</strong></summary>
844
+
845
+ **Solution:**
846
+ 1. Test the server: `npx @democratize-quality/mcp-server --help`
847
+ 2. Check `.vscode/mcp.json` configuration
848
+ 3. Try manual installation of chatmode files
849
+ 4. Ensure Node.js 14+ is installed
449
850
 
450
- **2. "democratize-quality server not found" error**
451
- - Check the MCP configuration in `.vscode/mcp.json`
452
- - Ensure the server is running: Test with `npx @democratize-quality/mcp-server --help`
453
- - Try manual installation: Copy `.github/chatmodes/` files and recreate `.vscode/mcp.json`
851
+ </details>
454
852
 
455
- **3. Agent installation overwrites existing MCP config**
456
- - The installer creates automatic backups with timestamps
457
- - Restore from backup: `.vscode/mcp.json.backup.{timestamp}`
458
- - The installer safely merges configurations, preserving existing servers
853
+ <details>
854
+ <summary><strong>Installation overwrites existing MCP config</strong></summary>
459
855
 
460
- **4. Permission errors during installation**
461
- - Run with elevated permissions if needed: `sudo npx @democratize-quality/mcp-server --agents`
462
- - Check directory permissions for `.github/` and `.vscode/` folders
463
- - Ensure you have write access to the project directory
856
+ **Solution:**
857
+ - Automatic backups are created: `.vscode/mcp.json.backup.{timestamp}`
858
+ - The installer safely merges configurations
859
+ - To restore: Copy backup file back to `mcp.json`
464
860
 
465
- ### Common Issues
861
+ </details>
466
862
 
467
- **1. "No such file or directory: mkdir /mcp-output"**
468
- - This happens when Claude Desktop runs the server with restricted permissions
469
- - The server automatically creates `~/.mcp-browser-control` in your home directory
470
- - API test reports will be saved there instead of your project folder
863
+ <details>
864
+ <summary><strong>Permission errors during installation</strong></summary>
471
865
 
472
- **2. Output files not appearing in expected location**
473
- - Check the actual output directory: `~/.mcp-browser-control/`
474
- - You can set a custom location with: `OUTPUT_DIR=/your/custom/path`
866
+ **Solution:**
867
+ 1. Check directory permissions for `.github/` and `.vscode/`
868
+ 2. Run with elevated permissions if needed: `sudo npx @democratize-quality/mcp-server --agents`
869
+ 3. Ensure write access to project directory
475
870
 
476
- **3. Server not starting in Claude Desktop**
477
- - Verify the npx package is published: `npx @democratize-quality/mcp-server --help`
478
- - Check Claude Desktop logs for detailed error messages
479
- - Try running directly in terminal first to test functionality
871
+ </details>
480
872
 
481
- **4. API validation failures not showing details**
482
- - The enhanced validation feature shows "expected vs actual" values
483
- - Check the generated HTML reports for detailed comparison views
484
- - Enable debug mode for more detailed logging
873
+ ### Common Runtime Issues
485
874
 
486
- ### Debug Mode
875
+ <details>
876
+ <summary><strong>API test reports not appearing in expected location</strong></summary>
487
877
 
878
+ **Solution:**
879
+ - Check the configured `OUTPUT_DIR` environment variable
880
+ - For Claude Desktop: Look in `~/.mcp-browser-control/`
881
+ - For VS Code: Look in `./api-test-reports/` in your project
882
+ - Set custom location: `OUTPUT_DIR=/your/custom/path`
883
+
884
+ </details>
885
+
886
+ <details>
887
+ <summary><strong>Server not starting in Claude Desktop</strong></summary>
888
+
889
+ **Solution:**
890
+ 1. Test package availability: `npx @democratize-quality/mcp-server --help`
891
+ 2. Check Claude Desktop logs for detailed errors
892
+ 3. Verify configuration in `claude_desktop_config.json`
893
+ 4. Try running in terminal first to isolate issues
894
+
895
+ </details>
896
+
897
+ <details>
898
+ <summary><strong>API validation failures not showing details</strong></summary>
899
+
900
+ **Solution:**
901
+ - Enhanced validation automatically shows "expected vs actual"
902
+ - Check generated HTML reports for detailed comparisons
903
+ - Enable debug mode: `MCP_FEATURES_ENABLEDEBUGMODE=true`
904
+ - Review session logs with `api_session_status` tool
905
+
906
+ </details>
907
+
908
+ ### Getting Help
909
+
910
+ **Enable debug mode for detailed logging:**
488
911
  ```bash
489
- # Enable debug output with CLI tool
912
+ # CLI
490
913
  npx @democratize-quality/mcp-server --debug
491
914
 
492
- # Or via environment variable
915
+ # Environment variable
493
916
  MCP_FEATURES_ENABLEDEBUGMODE=true node mcpServer.js
494
917
  ```
495
918
 
496
- **Logging Levels:**
497
- - **Production Mode**: Shows only essential startup messages and errors
498
- - **Debug Mode**: Shows detailed API request/response logs and validation details
499
-
500
- ## ๐Ÿ” Advanced API Testing Features
919
+ **Log levels:**
920
+ - **Production**: Essential startup messages and errors only
921
+ - **Debug**: Detailed request/response logs and validation details
501
922
 
502
- ### ๐Ÿค– AI-Powered Testing Agents
503
- - **๐Ÿง  Intelligent Planning**: Automatically analyze API schemas and generate comprehensive test scenarios
504
- - **โšก Multi-Format Generation**: Create Jest, Playwright, and Postman tests from the same test plan
505
- - **๐Ÿ› ๏ธ Automatic Healing**: Detect and fix authentication issues, endpoint changes, and schema updates
506
- - **๐Ÿ” Schema Analysis**: Parse OpenAPI/Swagger specs and GraphQL schemas automatically
507
- - **๐ŸŽฏ End-to-End Workflow**: Complete testing pipeline from planning to generation to maintenance
923
+ ---
508
924
 
509
- ### ๐Ÿ”ง Core Testing Capabilities
510
- - **๐Ÿ“Š Session Management**: Track API test sequences across multiple requests
511
- - **๐Ÿ”— Request Chaining**: Use response data from one request in subsequent requests
512
- - **โœ… Enhanced Validation**: Shows "expected vs actual" values when validation fails
513
- - **๐Ÿ“ˆ Interactive Reports**: Beautiful HTML test reports with detailed validation results
514
- - **๐ŸŽฏ Comprehensive Testing**: Support for all HTTP methods (GET, POST, PUT, DELETE, PATCH, etc.)
515
- - **๐Ÿ”„ Response Extraction**: Extract and reuse data from API responses
516
- - **๐Ÿ“ Detailed Logging**: Complete request/response logging for debugging
925
+ ## ๏ฟฝ Additional Resources
517
926
 
518
- ## ๐Ÿ“„ License
927
+ ### Documentation
519
928
 
520
- ISC License
929
+ - ๐Ÿ“– [Getting Started Guide](docs/getting-started.md) - Complete setup walkthrough
930
+ - ๐Ÿ”ง [Tool Reference](docs/api/tool-reference.md) - Detailed tool documentation
931
+ - ๐ŸŽฏ [API Tools Usage Guide](docs/api_tools_usage.md) - Advanced examples and patterns
932
+ - ๏ฟฝโ€๐Ÿ’ป [Developer Guide](docs/development/adding-tools.md) - Extend the server
933
+ - โš™๏ธ [Configuration Guide](docs/development/configuration.md) - Advanced settings
934
+ - ๏ฟฝ [Examples](docs/examples/) - Real-world usage examples
521
935
 
522
- ---
936
+ ### Quick Links
523
937
 
524
- **Ready to democratize quality through comprehensive API testing with MCP!** ๐ŸŽฏ
938
+ | Resource | Description |
939
+ |----------|-------------|
940
+ | [GitHub Repository](https://github.com/uppadhyayraj/democratize-quality-mcp-server) | Source code and issues |
941
+ | [Discussions](https://github.com/uppadhyayraj/democratize-quality-mcp-server/discussions) | Community Q&A |
942
+ | [Issue Tracker](https://github.com/uppadhyayraj/democratize-quality-mcp-server/issues) | Bug reports and feature requests |
943
+ | [NPM Package](https://www.npmjs.com/package/@democratize-quality/mcp-server) | Package information |
525
944
 
526
- ## ๐Ÿ“š Documentation
527
-
528
- - [๐Ÿ“– Getting Started](docs/getting-started.md) - Quick start guide
529
- - [๐Ÿ”ง Tool Reference](docs/api/tool-reference.md) - Complete tool documentation
530
- - [๐ŸŽฏ API Tools Usage Guide](docs/api_tools_usage.md) - Comprehensive API testing examples and patterns
531
- - [๐Ÿ‘จโ€๐Ÿ’ป Developer Guide](docs/development/adding-tools.md) - Extending the server
532
- - [โš™๏ธ Configuration](docs/development/configuration.md) - Advanced configuration
533
- - [๐Ÿ’ก Examples](docs/examples/) - Real-world usage examples
945
+ ---
534
946
 
535
947
  ## ๐Ÿ—๏ธ Architecture
536
948
 
949
+ ### Project Structure
950
+
537
951
  ```
538
- src/
539
- โ”œโ”€โ”€ tools/api/ # API testing tools
540
- โ”œโ”€โ”€ config/ # Configuration management
541
- โ””โ”€โ”€ utils/ # Utility functions
952
+ democratize-quality-mcp-server/
953
+ โ”œโ”€โ”€ src/
954
+ โ”‚ โ”œโ”€โ”€ tools/
955
+ โ”‚ โ”‚ โ”œโ”€โ”€ api/ # API testing tools
956
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-planner.js
957
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-generator.js
958
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-healer.js
959
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-project-setup.js
960
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-request.js
961
+ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ api-session-status.js
962
+ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ api-session-report.js
963
+ โ”‚ โ”‚ โ””โ”€โ”€ base/ # Tool framework
964
+ โ”‚ โ”œโ”€โ”€ chatmodes/ # AI agent definitions
965
+ โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŒ api-planner.chatmode.md
966
+ โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŒ api-generator.chatmode.md
967
+ โ”‚ โ”‚ โ””โ”€โ”€ ๐ŸŒ api-healer.chatmode.md
968
+ โ”‚ โ”œโ”€โ”€ config/ # Configuration management
969
+ โ”‚ โ””โ”€โ”€ utils/ # Utility functions
970
+ โ”œโ”€โ”€ docs/ # Documentation
971
+ โ”œโ”€โ”€ mcpServer.js # Main MCP server
972
+ โ””โ”€โ”€ cli.js # Command-line interface
542
973
  ```
543
974
 
544
975
  ### Key Features
545
- - **Automatic Tool Discovery**: API tools are automatically loaded and registered
546
- - **Configuration System**: Environment-based configuration with sensible defaults
547
- - **Error Handling**: Comprehensive error handling and validation with detailed reporting
548
- - **Session Management**: Track and manage API test sessions
549
976
 
550
- ## ๐Ÿ”ง Development
977
+ - **๐Ÿ” Automatic Tool Discovery**: Tools are automatically loaded and registered
978
+ - **โš™๏ธ Configuration System**: Environment-based config with sensible defaults
979
+ - **๐Ÿ›ก๏ธ Error Handling**: Comprehensive validation and detailed error reporting
980
+ - **๐Ÿ“Š Session Management**: Track and manage multi-step API test workflows
981
+
982
+ ---
983
+
984
+ ## ๐Ÿ”’ Security Considerations
985
+
986
+ ### Security Posture
987
+
988
+ - **โœ… API-Only Mode**: Enabled by default for secure deployments
989
+ - **โœ… Standard HTTP Libraries**: All requests use trusted Node.js libraries
990
+ - **โœ… No File System Access**: API tools only write to configured output directory
991
+ - **โœ… No Browser Automation**: No browser processes in API-only mode
992
+
993
+ ### Production Deployment Best Practices
994
+
995
+ ```json
996
+ {
997
+ "mcpServers": {
998
+ "democratize-quality": {
999
+ "command": "npx",
1000
+ "args": ["@democratize-quality/mcp-server"],
1001
+ "env": {
1002
+ "NODE_ENV": "production",
1003
+ "OUTPUT_DIR": "~/api-test-reports"
1004
+ }
1005
+ }
1006
+ }
1007
+ }
1008
+ ```
1009
+
1010
+ ### Security Recommendations
1011
+
1012
+ 1. **๐Ÿ“ Secure Output Directory**: Set appropriate permissions on report directories
1013
+ 2. **๐Ÿ”„ Regular Updates**: Keep the package updated for security patches
1014
+ 3. **๐ŸŒ Environment Separation**: Use different configs for dev vs production
1015
+ 4. **๐Ÿ“Š Monitoring**: Enable debug mode during initial deployment to monitor usage
1016
+ 5. **๏ฟฝ API Keys**: Never commit API keys or tokens to version control
1017
+ 6. **๐ŸŒ Network Security**: Use HTTPS endpoints for production API testing
1018
+
1019
+ ---
1020
+
1021
+ ## ๐Ÿ‘จโ€๐Ÿ’ป Development & Contributing
1022
+
1023
+ ### Adding New Tools
551
1024
 
552
- ### Adding New API Tools
553
1025
  1. Create tool file in `src/tools/api/`
554
1026
  2. Extend `ToolBase` class
555
1027
  3. Define tool schema and implementation
556
1028
  4. Tools are automatically discovered!
557
1029
 
558
- ### Example API Tool
1030
+ **Example tool structure:**
559
1031
  ```javascript
1032
+ const ToolBase = require('../base/ToolBase');
1033
+
560
1034
  class MyApiTool extends ToolBase {
561
1035
  static definition = {
562
1036
  name: "my_api_tool",
563
- description: "Performs API testing operations",
564
- input_schema: { /* JSON schema */ },
565
- output_schema: { /* JSON schema */ }
1037
+ description: "Performs custom API testing operations",
1038
+ input_schema: {
1039
+ type: "object",
1040
+ properties: {
1041
+ endpoint: { type: "string", description: "API endpoint URL" }
1042
+ },
1043
+ required: ["endpoint"]
1044
+ }
566
1045
  };
567
1046
 
568
1047
  async execute(parameters) {
569
- // API tool implementation
570
- return { success: true, data: responseData };
1048
+ // Implementation
1049
+ return {
1050
+ success: true,
1051
+ data: { /* results */ }
1052
+ };
571
1053
  }
572
1054
  }
1055
+
1056
+ module.exports = MyApiTool;
573
1057
  ```
574
1058
 
575
- ## ๐Ÿงช Testing
1059
+ ### Running Tests
576
1060
 
577
1061
  ```bash
578
- # Run tests
1062
+ # Run test suite
579
1063
  npm test
580
1064
 
581
- # Run with coverage
582
- npm run test:coverage
583
- ```
1065
+ # Run MCP inspector for development
1066
+ npm run inspector
584
1067
 
585
- ## ๐Ÿ”’ Security Considerations
1068
+ # Start server in debug mode
1069
+ npm run dev
1070
+ ```
586
1071
 
587
- ### Default Security Posture
588
- - **API-Only Mode**: Enabled by default for secure, lightweight deployments
589
- - **HTTP Requests**: All API requests are performed using standard HTTP libraries
590
- - **No File System Access**: API tools don't access local file system (except for report generation)
591
- - **No Browser Automation**: No browser processes are launched in API-only mode
1072
+ ### Contributing Guidelines
592
1073
 
593
- ### Production Deployment Recommendations
594
- ```json
595
- {
596
- "mcpServers": {
597
- "democratize-quality": {
598
- "command": "npx",
599
- "args": ["@democratize-quality/mcp-server"],
600
- "env": {
601
- "NODE_ENV": "production",
602
- "OUTPUT_DIR": "~/api-test-reports"
603
- }
604
- }
605
- }
606
- }
607
- ```
1074
+ 1. ๐Ÿด Fork the repository
1075
+ 2. ๐ŸŒฟ Create a feature branch (`git checkout -b feature/amazing-feature`)
1076
+ 3. โœ… Add tests for your changes
1077
+ 4. ๐Ÿ“ Update documentation
1078
+ 5. ๐Ÿ” Ensure tests pass (`npm test`)
1079
+ 6. ๐Ÿ“ค Submit a pull request
608
1080
 
609
- ### Security Levels
610
- - **๐ŸŸข Low Risk**: API Tools - HTTP requests with validation and reporting
1081
+ **What to include in PRs:**
1082
+ - Clear description of changes
1083
+ - Test coverage for new features
1084
+ - Updated documentation
1085
+ - Examples of usage (if applicable)
611
1086
 
612
- ### Best Practices
613
- 1. **Secure Output Directory**: Ensure output directories have appropriate permissions
614
- 2. **Regular Updates**: Keep the package updated for security patches
615
- 3. **Environment Separation**: Use different configurations for development vs production
616
- 4. **Monitoring**: Enable debug mode during initial deployment to monitor API usage
1087
+ ---
617
1088
 
618
1089
  ## ๐Ÿ“„ License
619
1090
 
620
- [License Type] - see [LICENSE](LICENSE) file for details
1091
+ ISC License - See [LICENSE](LICENSE) file for details
621
1092
 
622
- ## ๐Ÿค Contributing
1093
+ ---
623
1094
 
624
- 1. Fork the repository
625
- 2. Create a feature branch
626
- 3. Add your changes with tests
627
- 4. Update documentation
628
- 5. Submit a pull request
1095
+ ## ๐Ÿ™ Acknowledgments
629
1096
 
630
- ## ๐Ÿ“ž Support
1097
+ Built with the [Model Context Protocol](https://modelcontextprotocol.io/) framework.
631
1098
 
632
- - [Issues](https://github.com/uppadhyayraj/democratize-quality-mcp-server/issues) - Bug reports and feature requests
633
- - [Discussions](https://github.com/uppadhyayraj/democratize-quality-mcp-server/discussions) - Questions and community support
634
- - [Documentation](docs/) - Comprehensive guides and references
1099
+ Special thanks to the MCP community and all contributors!
635
1100
 
636
1101
  ---
637
1102
 
638
- **Ready to democratize quality through intelligent API testing agents!** ๐ŸŽฏ
1103
+ <div align="center">
1104
+
1105
+ **Ready to democratize quality through intelligent API testing!** ๐ŸŽฏ
1106
+
1107
+ Made with โค๏ธ by [Raj Uppadhyay](https://github.com/uppadhyayraj)
1108
+
1109
+ [โญ Star on GitHub](https://github.com/uppadhyayraj/democratize-quality-mcp-server) โ€ข [๐Ÿ“ฆ View on NPM](https://www.npmjs.com/package/@democratize-quality/mcp-server) โ€ข [๐Ÿ› Report Bug](https://github.com/uppadhyayraj/democratize-quality-mcp-server/issues) โ€ข [๐Ÿ’ก Request Feature](https://github.com/uppadhyayraj/democratize-quality-mcp-server/issues)
639
1110
 
640
- *Generated automatically from tool definitions and configuration*
1111
+ </div>