Generate Manual Test Cases

Generate Manual Test Cases

This MCP server provides a tool to generate manual test cases in Markdown or CSV format from documentation files and custom rules. It supports text and PDF inputs and can leverage LLM sampling to automate the creation of detailed test scenarios.

Category
访问服务器

README

MCP Server: Generate Manual Test Cases

This MCP server provides the generate_testcases tool to generate manual test cases from documentation and rules you supply.

Installation

npm install
npm run build

Running the server

  • Production: npm start (runs node dist/index.js)
  • Development: npm run dev (runs with ts-node)

The server communicates over stdio (stdin/stdout) and is intended to be started by Cursor or another MCP client.

Configuring in Cursor

Add to your MCP config (e.g. Cursor: Settings → MCP or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "manual-testcases": {
      "command": "node",
      "args": ["/PATH/TO/PROJECT/dist/index.js"]
    }
  }
}

Example with a real path:

{
  "mcpServers": {
    "manual-testcases": {
      "command": "node",
      "args": ["/Users/huenguyen/Desktop/hue-data/hue-data/workspace/mcp-manual-testcases/dist/index.js"]
    }
  }
}

After adding this, Cursor will expose the generate_testcases tool from this server.

Tool: generate_testcases

Generates test cases from documentation and rules.

Parameters

Parameter Required Description
document_content No Document content (text). Omit if using document_path.
document_path No Path to the document file (txt, md, or PDF). Prefer when available.
output_format No "markdown" (default) or "csv". CSV uses columns: 模块,标题,前置条件,步骤描述,预期结果,test1测试人员,test1测试结果,buglink,PRE测试人员,PRE测试结果,buglink.
rules Yes Rules for generating test cases (format, priority, scope, language, etc.).
use_llm No Default true. If true and client supports sampling, the LLM is used to generate test cases; if false, only the formatted prompt is returned.
max_tokens No Max tokens for the LLM response (default 4096).

Note: At least one of document_content or document_path is required.

How it works

  1. Read document: From document_content or by reading the file at document_path. PDF files are supported (text is extracted automatically).
  2. Combine with rules: Build a prompt from document + rules.
  3. Generate test cases:
    • If use_llm === true and the client (e.g. Cursor) supports sampling (LLM): the server sends a request to the client so the LLM generates test cases and returns the result.
    • Otherwise (client does not support sampling or use_llm === false): the server returns the formatted prompt for you to copy and use with an external LLM.

Example rules

  • "Output test cases as a table: ID, Description, Preconditions, Steps, Expected result, Priority."
  • "Priority P1 for login/payment flows; P2 for secondary screens."
  • "Output language: English."
  • "Each scenario has at most 10 steps; split into multiple scenarios if more complex."

Example usage in Cursor

You can ask the AI in Cursor, for example:

  • "Use the generate_testcases tool: document_path is docs/feature-login.md, rules are 'Table format, English, P1 for happy path'."
  • Or paste document content and use document_content with rules.

Generate test cases locally (script)

The script reads doc (txt, md, or PDF) and rules, then either calls OpenAI to generate test cases or prints the formatted prompt.

Environment variables:

Variable Description
DOC_PATH Path to requirement document (default: samples/doc-example.md). PDF is supported.
RULES_PATH Path to rules file (default: samples/rules-example.txt).
OUTPUT_FORMAT prompt (default) or csv.
OUTPUT_FILE Output file path. For CSV, default is samples/generated-testcases.csv.
OPENAI_API_KEY If set, the script calls OpenAI to generate test cases.

Examples:

# Print formatted prompt (no API key needed)
npm run generate-testcases

# Read requirement from PDF and output CSV (requires OPENAI_API_KEY)
export OPENAI_API_KEY=sk-your-key
export DOC_PATH=path/to/requirements.pdf
export RULES_PATH=samples/rules-example.txt
export OUTPUT_FORMAT=csv
export OUTPUT_FILE=samples/generated-testcases.csv
npm run generate-testcases

CSV columns match the rules format: 模块, 标题, 前置条件, 步骤描述, 预期结果, test1测试人员, test1测试结果, buglink, PRE测试人员, PRE测试结果, buglink.

Quick try with samples

The samples/ folder contains:

  • doc-example.md — sample requirement doc (中控后台PC, 6.1–6.4). It references prototype images in Images/ (image1.png–image4.png).
  • images/ (or Images/) — prototype screenshots; when present next to the doc, the script and MCP prompt include the image list so generated test cases can reference them (e.g. “参照原型 Images/image1.png”).
  • rules-example.txt — sample rules (table columns, 模块 format 代理后台-AGBE/…, language, strict/quality rules).

Generate test cases from doc + images + rules (MCP or script):

  • MCP: Call tool generate_testcases with document_path: samples/doc-example.md, rules: content from samples/rules-example.txt, and optionally output_format: "csv" or "markdown".
  • Script: DOC_PATH=samples/doc-example.md RULES_PATH=samples/rules-example.txt OUTPUT_FORMAT=both npm run generate-testcases (set OPENAI_API_KEY for LLM generation).

Project structure

mcp-manual-testcases/
├── src/
│   └── index.ts       # MCP server + generate_testcases tool
├── samples/
│   ├── doc-example.md      # Sample requirement (references Images/)
│   ├── images/             # Prototype images (image1.png …)
│   ├── rules-example.txt   # Sample rules
│   ├── generated-testcases.md
│   └── generated-testcases.csv
├── dist/              # Build output (after npm run build)
├── package.json
├── tsconfig.json
└── README.md

License

ISC

depend on doc-example.md and images folder generate tescase for the feature depend on mcp and rules

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选