ai-testcase-generator-mcp

ai-testcase-generator-mcp

Generates comprehensive API test plans (positive, negative, and boundary/edge cases) from endpoint metadata using LLMs, and exports them as Excel files.

Category
Visit Server

README

πŸ€– AI Testcase Generator MCP

An Model Context Protocol(MCP) server that generates comprehensive API test plans (positive, negative, and boundary/edge cases) directly from endpoint metadataβ€”powered by LLMs.

This is a TypeScript-based Model Context Protocol(MCP) server for QA engineers. It demonstrates core Model Context Protocol concepts by providing:

  • AI-powered tool for generating exhaustive test case plans from API endpoints and payloads
  • Prompt-driven LLM integration for quality and coverage
  • Extensible structure for future automation tooling

✨ Features

  • πŸ”Œ MCP-compliant server (stdio transport).
  • πŸ“ Tool: generate_tests_excel
    • Input: endpoint, HTTP method, payload, extra context.
    • Input options:
      • Direct endpoint details: endpoint, HTTP method, payload
      • Use extraContext to provide any additional testing notes or constraints
    • OutputPut: πŸ“Š Excel test plan with columns: Sl no, Test Name, Pre-Condition, Steps, Expected Result.
  • 🧠 Prompt-driven test generation with configurable LLM (Groq, OpenAI, Anthropic).
  • πŸ“œ Detailed logging with Winston.

πŸ—οΈ Architecture

flowchart TD
    A[Claude / MCP Client] -->|Run Tool| B[MCP Server]
    B -->|Prompt| C[LLM API]
    C -->|Test Cases JSON| B
    B -->|Excel Export| D[(Test Plan .xlsx)]
    B -->|Logs| E[Server Log File]

πŸ“‚ Project Structure

<details>

ai-testcase-designer-mcp/
β”œβ”€β”€ build/                         # Compiled JavaScript output
β”œβ”€β”€ assets/                        # Demo gifs, images, and sample files
β”‚    β”œβ”€β”€ demo.gif
β”‚    β”œβ”€β”€ excel_preview.png
β”‚    └── sample_chat_message.txt
β”œβ”€β”€ configs/
β”‚    └── config.json               # Server/tool config
β”œβ”€β”€ src/
β”‚    β”œβ”€β”€ index.ts                  # Main server entry point (MCP interface & routing)
β”‚    β”œβ”€β”€ excel.ts                  # Excel file creation & writing logic (modular)
β”‚    β”œβ”€β”€ logger.ts                 # Winston logger configuration & log writing (modular)
β”‚    └── prompts/
β”‚         └── testcase_prompt.txt  # Prompt template for LLM-based test generation
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ README.md
└── .gitignore
  • src/excel.ts: Handles all Excel (.xlsx) file creation and test plan export (modularized).
  • src/logger.ts: Provides modular logging functionality across the MCP server using Winston.
  • src/prompts/: Contains prompt templates for LLM-driven test generation.
  • assets/: Demo GIFs, Excel sample preview, and chat prompt examples.

</details>

πŸŽ₯ Demo

Here’s the MCP generating test cases and exporting to Excel:

AI Testcase Designer Demo

πŸ” Excel Preview

Below is a quick preview of the generated test cases:

Excel Preview

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

βš™οΈ Installation

Follow these steps to set up the AI Testcase Designer MCP server locally:

  1. Clone the repository

    git clone https://github.com/yourusername/ai-testcase-designer-mcp.git
    cd ai-testcase-designer-mcp
    
  2. Install dependencies

    npm install
    
  3. Build the server

    npm run build
    
  4. Configure the server in your MCP client

    a. Claude Desktop or any MCP-compatible client

    <details>

    • Add the following server configuration:

      • On MacOS:
        ~/Library/Application Support/Claude/claude_desktop_config.json

      • On Windows:
        %APPDATA%/Claude/claude_desktop_config.json

    {
      "mcpServers": {
        "ai-testcase-designer-mcp": {
          "disabled": false,
          "timeout": 60,
          "command": "node",
          "args": [
            "c:/Auto_WS/ai-testcase-designer-mcp/build/index.js"
          ],
          "transportType": "stdio"
        }
      }
    }
    

    </details>

    b. Cline (VS Code Extension)

    <details> You can also use the AI Testcase Designer MCP server with Cline, the Model Context Protocol VS Code extension.

    Quick Start:

    1. Install Cline from the VS Code Marketplace.
    2. Open the Cline sidebar (from the VS Code activity bar).
    3. Go to the "MCP Servers" section and click "Add New MCP Server".
    4. Fill in the server details:
      {
        "mcpServers": {
          "ai-testcase-designer-mcp": {
            "disabled": false,
            "timeout": 60,
            "command": "node",
            "args": [
              "c:/Auto_WS/ai-testcase-designer-mcp/build/index.js"
            ],
            "transportType": "stdio"
          }
        }
      }
      
    5. Test the connection and save.

    For a visual step-by-step guide, see below:

    Cline MCP Server Add Steps

    Cline MCP Server Connection Success

    For detailed Cline guidance, see the official docs:
    cline.bot/getting-started/installing-cline#vs-code-marketplace%3A-step-by-step-setup

</details>

πŸ”‘ API Key & Work Directory Setup

To use the AI Testcase Designer MCP.

  1. Get your Groq API key from here for free: https://console.groq.com/keys
  2. A working directory (WORK_DIR) where generated Excel test plans and server logs will be saved.

Update your config.json file like this:

{
  "MODEL_API_KEY": "gsk_7Ma3Fabcd <your-api-key-here>",
  "WORK_DIR": "C:/Auto_WS/ai-testcase-designer-mcp"
}

How to Use

  1. πŸ–₯️ Open Claude Desktop (or any MCP-compatible client).
  2. πŸ“‚ Download Sample Chat Message: sample_chat_message.txt and copy its content.
  3. βœ‰οΈ Paste the content into the chat and send the message: the AI will generate detailed test cases in Excel format.
  4. πŸ’Ύ Generated Excel files and server logs are saved in your WORK_DIR folder.

▢️ Example Request

{
  "name": "generate_tests_excel",
  "arguments": {
    "endpoint": "https://api.example.com/v1/users",
    "method": "POST",
    "payload": {
      "name": "John Doe",
      "email": "john@example.com"
    },
    "extraContext": "Focus on invalid email and empty payload scenarios."
  }
}

πŸ“Š Example Excel Output

<details>

Sl no Test Name Pre-Condition Steps Expected Result
1 Valid User Create DB is empty Send POST with valid payload User created successfully
2 Missing Email DB is empty Send POST with name only 400 validation error
3 Invalid Email DB is empty Send POST with invalid email format 422 error message

</details>

πŸ“‚ Files Output

Files are written to: ./workdir/generated/


Sample Log Output

<details>

2025-09-13T10:22:11 [info]: [Step1] Incoming request: endpoint=/v1/users, method=POST
2025-09-13T10:22:11 [info]: [Step2] Building LLM prompt...
2025-09-13T10:22:13 [info]: [Step5] Converting LLM JSON to Excel rows (15 test cases)

</details>

Debugging

<details> Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

</details>

License

This project is licensed under the MIT License.
See the LICENSE file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured