Basic information
About Swagger Testcase MCP Server
MCP server for API testing: generates test cases, validates specs, compares versions, and creates mock data from Swagger/OpenAPI specifications
Swagger Testcase MCP is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by eyaushev. It exposes 10 tools, including fetch_swagger, analyze_endpoint, generate_test_cases, generate_test_cases_batch and more. Supported transport: stdio. Runtime: node. License: MIT. The repository has 2 GitHub stars. Source code is hosted on github.com. Related topics: allure, api-testing, mcp-server, openapi, postman.
Setup
{
"mcpServers": {
"swagger-testcase-mcp": {
"command": "npx",
"args": [
"-y",
"swagger-testcase-mcp"
]
}
}
}
{
"mcpServers": {
"swagger-testcase-mcp": {
"command": "npx",
"args": [
"-y",
"swagger-testcase-mcp"
]
}
}
}
{
"servers": {
"swagger-testcase-mcp": {
"command": "npx",
"args": [
"-y",
"swagger-testcase-mcp"
]
}
}
}
Swagger Testcase MCP config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"swagger-testcase-mcp": {
"command": "npx",
"args": [
"-y",
"swagger-testcase-mcp"
]
}
}
}
Swagger Testcase MCP tools
-
fetch_swagger
— Fetch and parse an OpenAPI/Swagger specification. Supports:
- Public URLs: https://api.example.com/swagger.json
- Internal URLs (accessible from user's machine/VPN): https://internal-api.company.com/docs/swagger.json
- Local files: /path/to/swagger.json, ./api-spec.yaml
- Auth-protected specs: pass auth_header for Bearer/Basic/API-Key auth
auth_header:string, headers:object, source:string* -
analyze_endpoint
— Analyze a specific endpoint from a loaded Swagger spec. Returns detailed info about parameters, request body, responses, and security.
auth_header:string, headers:object, method:string*, path:string*, source:string* -
generate_test_cases
— Generate QA test cases for a specific API endpoint. Produces positive, negative, boundary, auth, security, idempotency, pagination, and business logic test cases based on the OpenAPI spec.
auth_header:string, config:object, headers:object, method:string*, path:string*, source:string* -
generate_test_cases_batch
— Generate QA test cases for multiple endpoints at once. Optionally filter by tag, methods, or path prefix.
auth_header:string, config:object, headers:object, methods:array, path_prefix:string, source:string*, tag:string -
export_test_cases
— Export previously generated test cases in various formats: markdown, json, csv, allure_csv, gherkin, postman, k6, pytest, testrail_csv (Steps template), testrail_csv_text (Text template).
endpoint:string*, format:string*, output_path:string -
compare_specs
— Compare two versions of an OpenAPI spec. Detects added/removed/modified endpoints, schema changes, and breaking changes.
auth_header:string, headers:object, new_source:string*, old_source:string* -
validate_spec
— Validate an OpenAPI spec for quality and completeness. Checks for missing descriptions, orphaned schemas, naming inconsistencies, missing error responses, and more. Returns a quality score (0-100).
auth_header:string, headers:object, source:string* -
generate_mock_data
— Generate realistic mock/sample data from an endpoint's request or response schema. Useful for populating Postman, tests, or documentation.
auth_header:string, count:number, format:string, headers:object, locale:string, method:string*, path:string*, response_code:string, source:string*, target:string*, use_examples:boolean -
suggest_missing_tests
— Analyze test coverage for generated test cases. Shows which response codes, parameters, and boundary conditions are covered or missing. Provides prioritized suggestions for additional tests.
auth_header:string, endpoint:string, headers:object, source:string* -
clear_cache
— Clear cached specs and/or generated test cases. Useful when the spec has been updated and needs to be reloaded.
target:string*
Overview
What is Swagger Testcase MCP?
Swagger Testcase MCP is an MCP server for API testing that generates structured test cases, validates specs, compares versions, and creates mock data from Swagger/OpenAPI specifications. It is built for QA engineers and developers who need to automate baseline test case creation from API specs.
How to use Swagger Testcase MCP?
Install globally with npm install -g swagger-testcase-mcp or run directly with npx swagger-testcase-mcp. Configure the server in your MCP client’s config file (e.g., claude_desktop_config.json). Then load a spec using fetch_swagger, generate test cases for an endpoint, and export to your preferred format.
Key features of Swagger Testcase MCP
- Parses Swagger 2.0 and OpenAPI 3.x (JSON and YAML)
- Generates 8 test categories: positive, negative, boundary, auth, business logic, security, idempotency, pagination
- Exports to 9 formats: Markdown, JSON, CSV, Allure CSV, Gherkin, Postman, k6, pytest, TestRail CSV
- Validates spec quality with 11 rules and actionable suggestions
- Compares two spec versions with breaking change detection
- Creates realistic mock data from schemas with locale support
- Analyzes test coverage and suggests improvements
- Supports authenticated access to internal corporate APIs
- Configurable generation with category, priority, locale, and custom preconditions
Use cases of Swagger Testcase MCP
- Generate test cases for internal corporate APIs behind VPN or custom auth
- Compare two versions of an API spec to detect breaking changes
- Create realistic mock data for development and testing
- Export test cases in Postman or k6 format for automated execution
- Validate spec quality and get suggestions for improvement
Frequently asked questions
1 What does Swagger Testcase MCP not cover?
It does not generate test cases for business logic rules, cross-endpoint dependencies, or custom validation constraints beyond what OpenAPI supports. You can compensate by describing business rules in the MCP client chat and asking the LLM to extend the generated cases.
2 What are the runtime requirements?
Node.js version 18.0.0 or higher is required.
3 How does it handle authenticated API specs?
You can load specs from internal corporate networks by providing an auth_header parameter (e.g., Bearer eyJ...). The tool supports VPN, SSO, and other auth mechanisms.
4 What export formats are supported?
Markdown, JSON, CSV, Allure CSV, Gherkin, Postman, k6, pytest, and TestRail CSV (two templates). All exports are automatically saved to the working directory.
5 Can it work with local files and localhost?
Yes. It accepts file paths (e.g., /path/to/swagger.json), localhost URLs, and public URLs.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In