@cocaxcode/api-testing-mcp 0.8.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <h1 align="center">@cocaxcode/api-testing-mcp</h1>
3
3
  <p align="center">
4
4
  <strong>The most complete API testing MCP server available.</strong><br/>
5
- 27 tools &middot; Zero config &middot; Zero dependencies &middot; Everything runs inside your AI conversation.
5
+ 31 tools &middot; Zero config &middot; Zero dependencies &middot; Everything runs inside your AI conversation.
6
6
  </p>
7
7
  </p>
8
8
 
@@ -11,8 +11,8 @@
11
11
  <a href="https://www.npmjs.com/package/@cocaxcode/api-testing-mcp"><img src="https://img.shields.io/npm/dm/@cocaxcode/api-testing-mcp.svg?style=flat-square" alt="npm downloads" /></a>
12
12
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="License" /></a>
13
13
  <img src="https://img.shields.io/badge/node-%3E%3D20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node" />
14
- <img src="https://img.shields.io/badge/tools-27-blueviolet?style=flat-square" alt="27 tools" />
15
- <img src="https://img.shields.io/badge/tests-83-brightgreen?style=flat-square" alt="83 tests" />
14
+ <img src="https://img.shields.io/badge/tools-31-blueviolet?style=flat-square" alt="29 tools" />
15
+ <img src="https://img.shields.io/badge/tests-110-brightgreen?style=flat-square" alt="96 tests" />
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -29,7 +29,7 @@
29
29
 
30
30
  ## What is this?
31
31
 
32
- An [MCP server](https://modelcontextprotocol.io) that gives your AI assistant the ability to **test, validate, mock, chain, diff, load-test, and manage** any API — all from natural language.
32
+ An [MCP server](https://modelcontextprotocol.io) that gives your AI assistant the ability to **test, validate, mock, chain, diff, load-test, import/export Postman collections, and manage** any API — all from natural language.
33
33
 
34
34
  You describe what you need. The AI figures out the rest.
35
35
 
@@ -47,16 +47,17 @@ There are other API testing MCP servers out there. Here's why this one is differ
47
47
 
48
48
  | Capability | @cocaxcode/api-testing-mcp | Others |
49
49
  |---|:---:|:---:|
50
- | HTTP requests with auth | 27 tools | 1-11 tools |
50
+ | HTTP requests with auth | 31 tools | 1-11 tools |
51
51
  | Assertions (eq, neq, gt, lt, contains, exists, type...) | 10 operators | Status code only or none |
52
52
  | Request flows with variable extraction | `flow_run` with `extract` | Not available |
53
- | Collections with tags and CRUD | Full CRUD + tag filtering | Import from Postman or none |
53
+ | Collections with tags and CRUD | Full CRUD + tag filtering | Basic or none |
54
54
  | Environments with variable interpolation | CRUD + project-scoped | Manual `set_env_vars` or none |
55
55
  | OpenAPI import with `$ref`, `allOf`, `oneOf`, `anyOf` | ~95% real-world coverage | Basic or none |
56
56
  | Mock data generation from schemas | Types, formats, enums | Not available |
57
57
  | Load testing with percentiles | p50/p95/p99 + req/s | Basic or none |
58
58
  | Response diffing | Field-by-field comparison | Not available |
59
59
  | Bulk testing by tag | Collection-wide pass/fail | Not available |
60
+ | **Postman import + export** | **Bidirectional: import from & export to Postman** | **Not available** |
60
61
  | cURL export | With resolved variables | Not available |
61
62
  | Project-scoped environments | Per-directory context | Not available |
62
63
  | External dependencies | **Zero** — just Node.js | Playwright, Jest, pytest... |
@@ -182,6 +183,10 @@ You don't need to memorize tool names, parameters, or JSON structures — just t
182
183
  | *"How fast is the health endpoint under load?"* | Fires 50 concurrent requests, reports p50/p95/p99 latencies |
183
184
  | *"Run all my saved smoke tests"* | Executes every request tagged `smoke`, reports pass/fail |
184
185
  | *"Export the create-user request as curl"* | Builds a ready-to-paste cURL command with resolved variables |
186
+ | *"Import my Postman collection from exported.json"* | Reads a Postman Collection v2.1, converts all requests into saved collection items |
187
+ | *"Import the Postman environment from prod.postman_environment.json"* | Imports variables from a Postman Environment file |
188
+ | *"Export my collection to Postman"* | Writes a `.postman_collection.json` file ready to import |
189
+ | *"Export the dev environment for Postman"* | Writes a `.postman_environment.json` file ready to import |
185
190
  | *"Compare the users endpoint between dev and prod"* | Hits both URLs, diffs status codes, body, and timing |
186
191
  | *"Switch to the production environment"* | Changes active env — all subsequent requests use prod URLs and tokens |
187
192
 
@@ -396,6 +401,77 @@ BULK TEST — 8/8 passed | 1.2s total
396
401
  login — POST /auth/login → 200 (156ms)
397
402
  ```
398
403
 
404
+ ### Postman Import & Export
405
+
406
+ **Bidirectional Postman support.** Import existing Postman collections and environments, or export yours for use in Postman. Migrate seamlessly between Postman and your AI workflow.
407
+
408
+ #### Import from Postman
409
+
410
+ ```
411
+ "Import my Postman collection from ./exported.postman_collection.json"
412
+ "Import the collection and tag everything as legacy"
413
+ "Import the Postman environment from ./prod.postman_environment.json and activate it"
414
+ ```
415
+
416
+ **Collection import features:**
417
+ - Postman Collection **v2.1** format (the default Postman export)
418
+ - **Folders become tags** — a request inside `Users > Admin` gets tags `["Users", "Admin"]`
419
+ - Auth inherited from folders/collection level (Bearer, API Key, Basic)
420
+ - Body parsing: raw JSON, x-www-form-urlencoded, form-data
421
+ - Query params, headers, and disabled items handled correctly
422
+ - `overwrite` option to update existing requests
423
+
424
+ **Environment import features:**
425
+ - Prefers `currentValue` over `value` (matches Postman runtime behavior)
426
+ - Skips disabled variables
427
+ - Optional `activate` flag to make it the active environment immediately
428
+ - Custom name override
429
+
430
+ #### Export to Postman
431
+
432
+ ```
433
+ "Export my collection to Postman"
434
+ "Export only the smoke tests to Postman"
435
+ "Export the dev environment for Postman"
436
+ ```
437
+
438
+ **What you get:**
439
+
440
+ ```
441
+ your-project/
442
+ └── postman/
443
+ ├── my-api.postman_collection.json ← Import in Postman: File → Import
444
+ └── dev.postman_environment.json ← Import in Postman: File → Import
445
+ ```
446
+
447
+ **Collection export features:**
448
+ - Requests grouped in **folders by tag** (smoke, auth, users, etc.)
449
+ - Auth (Bearer, API Key, Basic) mapped to Postman's native auth format
450
+ - `{{variables}}` preserved as-is (Postman uses the same syntax)
451
+ - Headers, query params, and JSON body included
452
+ - Collection variables from your active environment
453
+
454
+ **Environment export features:**
455
+ - All variables exported with `enabled: true`
456
+ - Postman-compatible format (`_postman_variable_scope: "environment"`)
457
+ - Works with any environment (active or by name)
458
+
459
+ <details>
460
+ <summary>Example: round-trip workflow</summary>
461
+
462
+ ```
463
+ You: "Import the Postman collection from ./legacy-api.postman_collection.json with tag migrated"
464
+ → 47 requests imported with tag "migrated"
465
+
466
+ You: "Run all migrated requests"
467
+ → Bulk test: 45/47 passed
468
+
469
+ You: "Fix the failing ones and export back to Postman"
470
+ → Updated collection exported to postman/legacy-api.postman_collection.json
471
+ ```
472
+
473
+ </details>
474
+
399
475
  ### cURL Export
400
476
 
401
477
  Convert any saved request into a ready-to-paste cURL command with resolved variables.
@@ -443,7 +519,7 @@ Resolution order: project-specific environment → global active environment.
443
519
 
444
520
  ## Tool Reference
445
521
 
446
- 27 tools organized in 8 categories:
522
+ 31 tools organized in 8 categories:
447
523
 
448
524
  | Category | Tools | Count |
449
525
  |----------|-------|-------|
@@ -454,7 +530,7 @@ Resolution order: project-specific environment → global active environment.
454
530
  | **Environments** | `env_create` `env_list` `env_set` `env_get` `env_switch` `env_rename` `env_delete` `env_spec` `env_project_clear` `env_project_list` | 10 |
455
531
  | **API Specs** | `api_import` `api_spec_list` `api_endpoints` `api_endpoint_detail` | 4 |
456
532
  | **Mock** | `mock` | 1 |
457
- | **Utilities** | `load_test` `export_curl` `diff_responses` `bulk_test` | 4 |
533
+ | **Utilities** | `load_test` `export_curl` `diff_responses` `bulk_test` `import_postman_collection` `import_postman_environment` `export_postman_collection` `export_postman_environment` | 8 |
458
534
 
459
535
  You don't need to call these tools directly. Just describe what you want and the AI picks the right one.
460
536
 
@@ -490,14 +566,14 @@ Override the default directory in your MCP config:
490
566
  Built for reliability and testability:
491
567
 
492
568
  - **Zero runtime dependencies** — only `@modelcontextprotocol/sdk` and `zod`
493
- - **83 integration tests** with mocked fetch (no network calls in CI)
569
+ - **110 integration tests** with mocked fetch (no network calls in CI)
494
570
  - **Factory pattern** — `createServer(storageDir?)` for isolated test instances
495
571
  - **Strict TypeScript** — zero `any`, full type coverage
496
- - **< 90KB** bundled output via tsup
572
+ - **< 95KB** bundled output via tsup
497
573
 
498
574
  ```
499
575
  src/
500
- ├── tools/ # 27 MCP tool handlers (one file per category)
576
+ ├── tools/ # 31 MCP tool handlers (one file per category)
501
577
  ├── lib/ # Business logic (no MCP dependency)
502
578
  │ ├── http-client # fetch wrapper with timing
503
579
  │ ├── storage # JSON file storage engine
@@ -506,7 +582,7 @@ src/
506
582
  │ ├── path # Dot-notation accessor (body.data.0.id)
507
583
  │ ├── interpolation # {{variable}} resolver
508
584
  │ └── openapi-parser # $ref + allOf/oneOf/anyOf resolution
509
- └── __tests__/ # 10 test suites, 83 tests
585
+ └── __tests__/ # 10 test suites, 110 tests
510
586
  ```
511
587
 
512
588
  ---
@@ -527,7 +603,7 @@ src/
527
603
  git clone https://github.com/cocaxcode/api-testing-mcp.git
528
604
  cd api-testing-mcp
529
605
  npm install
530
- npm test # 83 tests across 10 suites
606
+ npm test # 110 tests across 10 suites
531
607
  npm run build # ESM bundle via tsup
532
608
  npm run typecheck # Strict TypeScript
533
609
  ```