Educational Demo / Proof of Concept

CaptAIn-Q TestGenerator

Learn AI-Powered API Test Generation

An educational demonstration project that shows how to build an intelligent test case generation system using Retrieval-Augmented Generation (RAG) combined with Model Context Protocol (MCP).

πŸŽ“

What Is CaptAIn-Q?

CaptAIn-Q is an educational demonstration project that shows how to build an intelligent system that automatically generates API and UI test cases using Retrieval-Augmented Generation (RAG) combined with the Model Context Protocol (MCP).

Learning Objectives

βœ“Vector embeddings & cosine similarity
βœ“RAG (Retrieval-Augmented Generation) pattern
βœ“Model Context Protocol (MCP)
βœ“Docker containerization
βœ“Structured logging & tracing
βœ“Test-driven development (70%+ coverage)

architectureTechnical Architecture

The system comprises three core components working together:

🐍

RAG Service (Python/FastAPI)

  • β€’Ingests documentation from OpenAPI specs, wikis, business documents, and UI specifications
  • β€’Creates vector embeddings using deterministic "fake embeddings" based on character frequency and hashing
  • β€’Performs cosine similarity searches to locate relevant documentation
  • β€’Generates canonical test definitions in JSON format
  • β€’Implements structured logging with correlation IDs for request tracing
πŸ”Œ

MCP Server (TypeScript/Node.js)

  • β€’Provides tool layer for AI assistant integration (ChatGPT, Claude Desktop)
  • β€’Parses OpenAPI specifications
  • β€’Converts test definitions to multiple formats (Postman collections, RestAssured Java tests)
  • β€’Acts as HTTP client communicating with the RAG service
πŸ“š

Data Sources

OpenAPI specsMarkdown wikisGoogle DocsWord documentsUI documentationSequence diagrams

βš™οΈ How It Works Behind the Scenes

1

MCP Integration

You interact with ChatGPT or Claude Desktop (requires your own subscription). The MCP server connects your AI assistant to the RAG service through the Model Context Protocol.

2

Natural Language Query

Ask "generate tests for POST /login" in your AI assistant. The MCP server receives this request and forwards it to the RAG service.

3

Vector Similarity Search

The RAG service uses deterministic embeddings (character frequency + hashing) to find relevant documentation via cosine similarityβ€”no external LLM API calls needed for embeddings!

4

Test Generation

Based on the retrieved documentation, the system generates test cases across five profiles: Smoke, Functional, Regression, Security, and Bugfix.

5

Multi-Format Export

Tests are returned in your chosen format: canonical JSON, Postman collections, or RestAssured Java codeβ€”ready to use in your testing workflow.

🎯 Five Test Profiles

πŸ’¨

Smoke

Happy path scenarios only

βš™οΈ

Functional

Positive and negative test cases

πŸ”„

Regression

Comprehensive edge cases

πŸ”’

Security

Authentication and injection tests

πŸ›

Bugfix

Targeted verification tests

⭐ Key Differentiators

πŸ”§ Deterministic Embeddings

Uses character frequency and hashing instead of external embedding servicesβ€”making it entirely self-contained with no embedding API costs

πŸ”Œ MCP Protocol

Leverages Model Context Protocol to integrate with AI assistants like ChatGPT and Claude Desktop

πŸ“‹ Multi-Format Export

Exports to industry-standard formats (Postman, RestAssured) while maintaining a canonical test definition layer

🐳 Docker-Based

Fully containerized with Docker Compose for easy setup and deployment

πŸ“‹ Requirements

  • βœ“Docker and Docker Compose for containerization
  • βœ“4GB+ RAM for running the services
  • βœ“Ports 8000 and 3000 available on your system
  • βœ“ChatGPT Plus or Claude subscription (bring your own) to use with MCP

πŸ“– Educational Resources

πŸ“š

Learn Automated Testing Blog

Explore in-depth articles, tutorials, and guides on AI-powered test generation, RAG patterns, MCP integration, and more through our educational blog.

Visit Educational Blogarrow_forward
πŸŽ“

Educational Services

Get hands-on training, workshops, and personalized guidance on implementing AI test automation in your projects through our educational services.

Explore Servicesarrow_forward

Ready to Learn AI Test Generation?

This educational project teaches you how to build intelligent test automation systems using RAG and MCP.