Package Exports
- @kirti676/api-tester-mcp
 - @kirti676/api-tester-mcp/cli.js
 
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kirti676/api-tester-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
API Tester MCP Server
A comprehensive Model Context Protocol (MCP) server for QA/SDET engineers that provides API testing capabilities with Swagger/OpenAPI and Postman collection support.
๐ Now available on NPM! Install with
npx @kirti676/api-tester-mcp@latest
๐ What's New
- โ Enhanced Progress Tracking - Real-time progress with completion percentages and ETA
 - โ Visual Progress Bars - ASCII progress bars with milestone notifications
 - โ Performance Metrics - Throughput calculations and execution summaries
 - โ Published on NPM - Install instantly with NPX
 - โ VS Code Integration - One-click installation buttons
 - โ Simplified Setup - No manual Python installation required
 - โ Cross-Platform - Works on Windows, macOS, and Linux
 - โ
 Auto-Updates - Always get the latest version with 
@latest 
๐ Getting Started
๐ฆ Installation
The API Tester MCP server can be used directly with npx without any installation:
npx @kirti676/api-tester-mcp@latestโก Quick Install:
๐ค Claude Desktop
Follow the MCP install guide, use the standard config below:
{
  "mcpServers": {
    "api-tester": {
      "command": "npx",
      "args": ["@kirti676/api-tester-mcp@latest"]
    }
  }
}๐ Other MCP Clients
The standard configuration works with most MCP clients:
{
  "mcpServers": {
    "api-tester": {
      "command": "npx",
      "args": ["@kirti676/api-tester-mcp@latest"]
    }
  }
}๐ฅ๏ธ Supported Clients:
- ๐ค Claude Desktop
 - ๐ป VS Code with MCP extension
 - โก Cursor
 - ๐ Windsurf
 - ๐ชฟ Goose
 - ๐ง Any other MCP-compatible client
 
๐ Python Installation (Alternative)
pip install api-tester-mcp๐ป From Source
git clone https://github.com/kirti676/api_tester_mcp.git
cd api_tester_mcp
npm installโก Quick Start
Try the API Tester MCP server immediately:
# Run the server
npx @kirti676/api-tester-mcp@latest
# Check version
npx @kirti676/api-tester-mcp@latest --version
# Get help
npx @kirti676/api-tester-mcp@latest --helpFor MCP clients like Claude Desktop, use this configuration:
{
  "mcpServers": {
    "api-tester": {
      "command": "npx",
      "args": ["@kirti676/api-tester-mcp@latest"]
    }
  }
}โจ Features
- ๐ฅ Input Support: OpenAPI/Swagger documents, Postman collections, and GraphQL schemas
 - ๐ Test Generation: Automatic API and Load test scenario generation
 - ๐ Multi-Language Support: Generate tests in TypeScript/Playwright, JavaScript/Jest, Python/pytest, and more
 - โก Test Execution: Run generated tests with detailed reporting
 - ๐ Smart Auth Detection: Automatic environment variable analysis and setup guidance
 - ๐ Authentication: Bearer token and API key support via 
set_env_vars - ๐ HTML Reports: Beautiful, accessible reports via MCP resources
 - ๐ Real-time Progress: Live updates with progress bars and completion percentages
 - โฑ๏ธ ETA Calculations: Estimated time to completion for all operations
 - ๐ฏ Milestone Tracking: Special notifications at key progress milestones (25%, 50%, 75%, etc.)
 - ๐ Performance Metrics: Throughput calculations and execution summaries
 - โ Schema Validation: Request body generation from schema examples
 - ๐ฏ Assertions: Per-endpoint status code assertions (2xx, 4xx, 5xx)
 - ๐ฆ Project Generation: Complete project scaffolding with dependencies and configuration
 
๐ Multi-Language Test Generation
The API Tester MCP now supports generating test code in multiple programming languages and testing frameworks:
๐ง Supported Language/Framework Combinations
| Language | Framework | Description | Use Case | 
|---|---|---|---|
| ๐ TypeScript | ๐ญ Playwright | Modern E2E testing with excellent API support | ๐ข Enterprise web applications | 
| ๐ TypeScript | ๐ Supertest | Express.js focused API testing | ๐ข Node.js backend services | 
| ๐ JavaScript | ๐ Jest | Popular testing framework with good ecosystem | ๐ง General API testing | 
| ๐ JavaScript | ๐ฒ Cypress | E2E testing with great developer experience | ๐ Full-stack applications | 
| ๐ Python | ๐งช pytest | Comprehensive testing with fixtures & plugins | ๐ Data-heavy APIs & ML services | 
| ๐ Python | ๐ก requests | Simple HTTP testing for quick validation | โก Rapid prototyping & scripts | 
๐ฏ Language Selection Workflow
// 1. Get available languages and frameworks
const languages = await mcp.call("get_supported_languages");
// 2. Choose your preferred combination
await mcp.call("ingest_spec", {
  spec_type: "openapi",
  file_path: "./path/to/your/api-spec.json",
  preferred_language: "typescript",    // python, typescript, javascript
  preferred_framework: "playwright"     // varies by language
});
// 3. Generate test cases with code
await mcp.call("generate_test_cases", {
  language: "typescript",
  framework: "playwright"
});
// 4. Get complete project setup
await mcp.call("generate_project_files", {
  language: "typescript",
  framework: "playwright",
  project_name: "my-api-tests",
  include_examples: true
});๐ Generated Project Structure
The generate_project_files tool creates a complete, ready-to-run project:
๐ TypeScript + Playwright:
my-api-tests/
โโโ ๐ฆ package.json          # Dependencies & scripts
โโโ โ๏ธ playwright.config.ts  # Playwright configuration
โโโ ๐ tests/
โ   โโโ ๐งช api.spec.ts      # Generated test code
โโโ ๐ README.md            # Setup instructions๐ Python + pytest:
my-api-tests/
โโโ ๐ requirements.txt     # Python dependencies
โโโ โ๏ธ pytest.ini         # pytest configuration
โโโ ๐ tests/
โ   โโโ ๐งช test_api.py    # Generated test code
โโโ ๐ README.md          # Setup instructions๐ JavaScript + Jest:
my-api-tests/
โโโ ๐ฆ package.json       # Dependencies & scripts
โโโ โ๏ธ jest.config.js     # Jest configuration
โโโ ๐ tests/
โ   โโโ ๐งช api.test.js   # Generated test code
โโโ ๐ README.md         # Setup instructions๐ฏ Framework-Specific Features
- ๐ญ Playwright: Browser automation, parallel execution, detailed reporting
 - ๐ Jest: Snapshot testing, mocking, watch mode for development
 - ๐งช pytest: Fixtures, parametrized tests, extensive plugin ecosystem
 - ๐ฒ Cypress: Interactive debugging, time-travel debugging, real browser testing
 - ๐ Supertest: Express.js integration, middleware testing
 - ๐ก requests: Simple API calls, session management, authentication helpers
 
๐ Progress Tracking
The API Tester MCP includes comprehensive progress tracking for all operations:
๐ Visual Progress Indicators
๐ฏ API Test Execution: [โโโโโโโโโโโโโโโโโโโโ] 50.0% (5/10) | ETA: 2.5s - GET /api/users โ
๐ฅ Features:
- ๐ Progress Bars: ASCII progress bars with filled/empty indicators
 - ๐ Completion Percentages: Real-time percentage completion
 - โฐ ETA Calculations: Estimated time to completion based on current performance
 - ๐ฏ Milestone Notifications: Special highlighting at key progress points
 - โก Performance Metrics: Throughput and timing statistics
 - ๐ Operation Context: Detailed information about current step being executed
 
โ Available for:
- ๐ฌ Scenario generation
 - ๐งช Test case generation
 - ๐ API test execution
 - โก Load test execution
 - ๐ All long-running operations
 
๐ ๏ธ MCP Tools
The server provides 11 comprehensive MCP tools with detailed parameter specifications:
1. ๐ฅ ingest_spec - Load API Specifications
Load OpenAPI/Swagger, Postman collections, or GraphQL schemas with language/framework preferences
{
  "spec_type": "openapi",           // openapi, swagger, postman, graphql (optional, auto-detected)
  "file_path": "./api-spec.json",   // Path to JSON, YAML, or GraphQL schema file (required)
  "preferred_language": "python",   // python, typescript, javascript (optional, default: python)
  "preferred_framework": "requests" // pytest, requests, playwright, jest, cypress, supertest (optional, default: requests)
}2. ๐ง set_env_vars - Configure Authentication & Environment
Set environment variables with automatic validation and guidance
{
  "variables": {},                  // Dictionary of custom environment variables (optional)
  "baseUrl": null,                 // API base URL (optional)
  "auth_bearer": null,             // Bearer/JWT token (optional)
  "auth_apikey": null,             // API key (optional)
  "auth_basic": null,              // Base64 encoded credentials (optional)
  "auth_username": null,           // Username for basic auth (optional)
  "auth_password": null            // Password for basic auth (optional)
}3. ๐ฌ generate_scenarios - Create Test Scenarios
Generate test scenarios from ingested specifications
{
  "include_negative_tests": true,   // Generate failure scenarios (default: true)
  "include_edge_cases": true        // Generate boundary conditions (default: true)
}4. ๐งช generate_test_cases - Convert to Executable Tests
Convert scenarios to executable test cases in preferred language/framework
{
  "scenario_ids": null              // Array of scenario IDs or null for all (optional)
}5. ๐ run_api_tests - Execute API Tests
Execute API tests with detailed results and reporting
{
  "test_case_ids": null,           // Array of test case IDs or null for all (optional)
  "max_concurrent": 10             // Number of concurrent requests 1-50 (default: 10)
}6. โก run_load_tests - Execute Performance Tests
Execute load/performance tests with configurable parameters
{
  "test_case_ids": null,           // Array of test case IDs or null for all (optional)
  "duration": 60,                  // Test duration in seconds (default: 60)
  "users": 10,                     // Number of concurrent virtual users (default: 10)
  "ramp_up": 10                    // Ramp up time in seconds (default: 10)
}7. ๐ get_supported_languages - List Language/Framework Options
Get list of supported programming languages and testing frameworks
// No parameters required
{}8. ๐ฆ generate_project_files - Generate Complete Projects
Generate complete project structure with dependencies and configuration
{
  "project_name": null,            // Project folder name (optional, auto-generated if null)
  "include_examples": true         // Include example test files (default: true)
}9. ๐ get_workspace_info - Workspace Information
Get information about workspace directory and file generation locations
// No parameters required
{}10. ๐ debug_file_system - File System Diagnostics
Get comprehensive workspace information and file system diagnostics
// No parameters required
{}11. ๐ get_session_status - Session Status & Progress
Retrieve current session information with progress details
// No parameters required
{}๐ MCP Resources
file://reports- List all available test reportsfile://reports/{report_id}- Access individual HTML test reports
๐ก MCP Prompts
create_api_test_plan- Generate comprehensive API test plansanalyze_test_failures- Analyze test failures and provide recommendations
๐ Smart Environment Variable Analysis
The API Tester MCP now automatically analyzes your API specifications to detect required environment variables and provides helpful setup guidance:
๐ฏ Automatic Detection
- ๐ Authentication Schemes: Bearer tokens, API keys, Basic auth, OAuth2
 - ๐ Base URLs: Extracted from specification servers/hosts
 - ๐ Template Variables: Postman collection variables like 
{{baseUrl}},{{authToken}} - ๐ Path Parameters: Dynamic values in paths like 
/users/{userId} 
๐ก Smart Suggestions
// 1. Ingest specification - automatic analysis included
const result = await mcp.call("ingest_spec", {
  spec_type: "openapi",
  file_path: "./api-specification.json"
});
// Check the setup message for immediate guidance
console.log(result.setup_message);
// "โ ๏ธ 2 required environment variable(s) detected..."
// 2. Get detailed setup instructions
const suggestions = await mcp.call("get_env_var_suggestions");
console.log(suggestions.setup_instructions);
// Provides copy-paste ready configuration examples๐ฏ Default Parameter Keys
All MCP tools now provide helpful default parameter keys to guide users on what values they can set:
๐ง Environment Variables (set_env_vars)
๐ ALL PARAMETERS ARE OPTIONAL - Provide only what you need:
// Option 1: Just the base URL
await mcp.call("set_env_vars", {
  baseUrl: "https://api.example.com/v1"
});
// Option 2: Just authentication
await mcp.call("set_env_vars", {
  auth_bearer: "your-jwt-token-here"
});
// Option 3: Multiple parameters
await mcp.call("set_env_vars", {
  baseUrl: "https://api.example.com/v1",
  auth_bearer: "your-jwt-token",
  auth_apikey: "your-api-key"
});
// Option 4: Using variables dict for custom values
await mcp.call("set_env_vars", {
  variables: {
    "baseUrl": "https://api.example.com/v1",
    "custom_header": "custom-value"
  }
});๐ Language & Framework Selection
Default values help you understand available options:
// Ingest with defaults shown
await mcp.call("ingest_spec", {
  spec_type: "openapi",        // openapi, swagger, postman
  file_path: "./api-spec.json", // Path to JSON or YAML specification file
  preferred_language: "python", // python, typescript, javascript
  preferred_framework: "requests" // pytest, requests, playwright, jest, cypress, supertest
});
// Project generation with defaults
await mcp.call("generate_project_files", {
  language: "python",          // python, typescript, javascript
  framework: "requests",       // Framework matching the language
  project_name: "api-tests",   // Project folder name
  include_examples: true       // Include example test files
});โก Test Execution Parameters
Clear defaults for performance tuning:
// API tests with concurrency control
await mcp.call("run_api_tests", {
  test_case_ids: null,        // ["test_1", "test_2"] or null for all
  max_concurrent: 10          // Number of concurrent requests (1-50)
});
// Load tests with performance parameters  
await mcp.call("run_load_tests", {
  test_case_ids: null,        // ["test_1", "test_2"] or null for all
  duration: 60,               // Test duration in seconds
  users: 10,                  // Number of concurrent virtual users
  ramp_up: 10                 // Ramp up time in seconds
});๐ง Configuration Example
// NEW: Check supported languages and frameworks
const languages = await mcp.call("get_supported_languages");
console.log(languages.supported_combinations);
// Ingest specification with language preferences
await mcp.call("ingest_spec", {
  spec_type: "openapi",
  file_path: "./openapi-specification.json",
  preferred_language: "typescript",
  preferred_framework: "playwright"
});
// Set environment variables for authentication
await mcp.call("set_env_vars", {
  variables: {
    "baseUrl": "https://api.example.com",
    "auth_bearer": "your-bearer-token",
    "auth_apikey": "your-api-key"
  }
});
// Generate test scenarios
await mcp.call("generate_scenarios", {
  include_negative_tests: true,
  include_edge_cases: true
});
// Generate test cases in TypeScript/Playwright
await mcp.call("generate_test_cases", {
  language: "typescript",
  framework: "playwright"
});
// Generate complete project files
await mcp.call("generate_project_files", {
  language: "typescript",
  framework: "playwright",
  project_name: "my-api-tests",
  include_examples: true
});
// Run API tests (still works with existing execution engine)
await mcp.call("run_api_tests", {
  max_concurrent: 5
});๐ Complete Workflow Example
Here's a complete example of testing the Petstore API:
# 1. Start the MCP server
npx @kirti676/api-tester-mcp@latestThen in your MCP client (like Claude Desktop):
// 1. Load the Petstore OpenAPI spec
await mcp.call("ingest_spec", {
  spec_type: "openapi",
  file_path: "./examples/petstore_openapi.json"
});
// 2. Set environment variables
await mcp.call("set_env_vars", {
  pairs: {
    "baseUrl": "https://petstore.swagger.io/v2",
    "auth_apikey": "special-key"
  }
});
// 3. Generate test cases
const tests = await mcp.call("get_generated_tests");
// 4. Run API tests
const result = await mcp.call("run_api_tests");
// 5. View results in HTML report
const reports = await mcp.call("list_resources", {
  uri: "file://reports"
});๐ Usage Examples
๐ Basic API Testing Workflow
๐ฅ Ingest API Specification
{ "tool": "ingest_spec", "params": { "spec_type": "openapi", "content": "{ ... your OpenAPI spec ... }" } }
๐ Configure Authentication
{ "tool": "set_env_vars", "params": { "variables": { "auth_bearer": "your-token", "baseUrl": "https://api.example.com" } } }
๐ Generate and Run Tests
{ "tool": "generate_scenarios", "params": { "include_negative_tests": true } }
๐ View Results
- ๐ Access HTML reports via MCP resources
 - ๐ Get session status and statistics
 
๐ GraphQL API Testing Workflow
๐ฅ Ingest GraphQL Schema
{ "tool": "ingest_spec", "params": { "spec_type": "graphql", "file_path": "./schema.graphql" } }
๐ Configure GraphQL Endpoint
{ "tool": "set_env_vars", "params": { "graphqlEndpoint": "https://api.example.com/graphql", "auth_bearer": "your-jwt-token" } }
๐งช Generate GraphQL Tests
{ "tool": "generate_test_cases", "params": { "preferred_language": "python", "preferred_framework": "pytest" } }
๐ Execute GraphQL Tests
{ "tool": "run_api_tests", "params": { "max_concurrent": 5 } }
โก Load Testing
{
  "tool": "run_load_tests",
  "params": {
    "users": 10,
    "duration": 60,
    "ramp_up": 10
  }
}๐ Test Generation Features
- โ Positive Tests: Valid requests with expected 2xx responses
 - โ Negative Tests: Invalid authentication (401), wrong methods (405)
 - ๐ฏ Edge Cases: Large payloads, boundary conditions
 - ๐๏ธ Schema-based Bodies: Automatic request body generation from OpenAPI schemas
 - ๐ Comprehensive Assertions: Status codes, response times, content validation
 
๐ HTML Reports
Generated reports include:
- ๐ Test execution summary with pass/fail statistics
 - โฑ๏ธ Detailed test results with timing information
 - ๐ Assertion breakdowns and error details
 - ๐๏ธ Response previews and debugging information
 - ๐ฑ Mobile-friendly responsive design
 
๐ Authentication Support
- ๐ซ Bearer Tokens: 
auth_bearerenvironment variable - ๐ API Keys: 
auth_apikeyenvironment variable (sent as X-API-Key header) - ๐ค Basic Auth: 
auth_basicenvironment variable 
๐ง Requirements
- ๐ Python: 3.8 or higher
 - ๐ข Node.js: 14 or higher (for npm installation)
 
๐ฆ Dependencies
๐ Python Dependencies
- ๐ fastmcp>=0.2.0
 - ๐ pydantic>=2.0.0
 - ๐ requests>=2.28.0
 - โ jsonschema>=4.0.0
 - ๐ pyyaml>=6.0
 - ๐จ jinja2>=3.1.0
 - โก aiohttp>=3.8.0
 - ๐ญ faker>=19.0.0
 
๐ข Node.js Dependencies
- โจ None (self-contained package)
 
๐ง Troubleshooting
โ Common Issues
๐ฆ NPX Command Not Working
# If npx command fails, try:
npm install -g @kirti676/api-tester-mcp@latest
# Or run directly:
node ./node_modules/@kirti676/api-tester-mcp/cli.js๐ Python Not Found
# Make sure Python 3.8+ is installed and in PATH
python --version
# Install Python dependencies manually if needed:
pip install fastmcp>=0.2.0 pydantic>=2.0.0 requests>=2.28.0๐ MCP Client Connection Issues
- โ Ensure the MCP server is running on stdio transport (default)
 - ๐ Check that your MCP client supports the latest MCP protocol version
 - ๐ Verify the configuration JSON syntax is correct
 
๐ Getting Help
- ๐ Check the Examples directory for working configurations
 - ๐ Run with 
--verboseflag for detailed logging - ๐ Report issues on GitHub Issues
 
๐ค Contributing
- Fork the repository
 - Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
 
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Issues & Support
- NPM Package: @kirti676/api-tester-mcp
 - Report bugs: GitHub Issues
 
๐ Roadmap
- Multi-Language Test Generation - TypeScript/Playwright, JavaScript/Jest, Python/pytest support โจ NEW!
 - Complete Project Generation - Full project scaffolding with dependencies and configuration โจ NEW!
 - GraphQL API support - Supports GraphQL Schemas โจ NEW!
 - Additional authentication methods (OAuth2, JWT)
 - Go/Golang test generation (with testify/ginkgo)
 - C#/.NET test generation (with NUnit/xUnit)
 - Performance monitoring and alerting
 - Integration with CI/CD pipelines (GitHub Actions, Jenkins)
 - Advanced test data generation from examples and schemas
 - API contract testing with Pact support
 - Mock server generation for development
 
๐ Copyright & Usage
ยฉ 2025 kirti676. All rights reserved.
This repository and its contents are protected by copyright law. For permission to reuse, reference, or redistribute any part of this project, please contact the owner at kirti676@outlook.com.
โ Allowed without permission:
- Personal learning and experimentation
 - Contributing back to this repository via Pull Requests
 
โ Requires permission:
- Commercial use or integration
 - Redistribution in modified form
 - Publishing derived works
 
For licensing inquiries, collaboration opportunities, or permission requests, reach out to kirti676@outlook.com.