mk-qa-master
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| JIRA_EMAIL | No | Required if SPEC_SOURCE=jira. | |
| FIGMA_TOKEN | No | Required if SPEC_SOURCE=figma. | |
| SPEC_SOURCE | Yes | Adapter to use (markdown_local / github_issues / linear / jira / notion / figma) | |
| GITHUB_TOKEN | No | Optional. GitHub token for github_issues adapter (falls back to gh CLI if unset). | |
| NOTION_TOKEN | No | Required if SPEC_SOURCE=notion. | |
| JIRA_BASE_URL | No | Required if SPEC_SOURCE=jira (e.g., https://your-domain.atlassian.net). | |
| JIRA_API_TOKEN | No | Required if SPEC_SOURCE=jira. | |
| LINEAR_API_KEY | No | Required if SPEC_SOURCE=linear. | |
| SPEC_PROJECT_KEY | No | Optional. Team key (Linear), project key (JIRA), database ID (Notion), file key (Figma). | |
| SPEC_PROJECT_ROOT | Yes | Root path; traceability index stored at SPEC_PROJECT_ROOT/.mk-spec-master/index.json |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_runner_infoA | 回傳目前由 QA_RUNNER 環境變數選定的測試 runner(pytest / jest / cypress / go / maestro 五選一)加上 server 編譯時內建的全部 runner 清單。建議每個 session 第一個呼叫——AI 用它判斷後續該產 Playwright .py 還是 Maestro .yaml、要不要 headed browser,避免後面拿錯模板。也用來確認專案環境設定正確:QA_PROJECT_ROOT 指對地方、QA_RUNNER 沒拼錯。回傳 shape:{active: 'pytest', available: ['pytest', 'jest', ...]}。 |
| list_testsA | 用 runner 的原生 collection 機制列出受測專案內所有可執行測試:pytest 走 |
| run_testsA | Execute the test suite under the active QA_RUNNER and produce a structured report. The single most-called tool — invoke whenever a user says 「跑/run/test/check/驗證/執行」, after generate_test (verify new test), or after a fix (confirm bug gone). Behavior:
When to use:
When NOT to use:
Edge cases:
|
| run_failedA | 只重跑上次失敗的測試——比跑整套套件快很多,適合修完一個 bug 後驗證迭代。pytest 走 |
| get_test_reportA | 讀上一次 run_tests 留下的 report.json,回傳一個輕量摘要:total / passed / failed / skipped / flaky_in_run(auto-retry 救回的數量)/ duration(秒)。比再跑一次 suite 便宜得多——適合在連續操作中間反覆查狀態。未跑過時回 {error: 找不到報告,請先執行 run_tests}。拿到摘要後若 failed > 0,接 get_failure_details 拿錯誤細節。 |
| get_failure_detailsA | Extract full root-cause-analysis materials for every failed test in the most recent run. Behavior:
When to use:
When NOT to use:
Edge cases:
|
| generate_testA | 產生 pytest-playwright 測試骨架。推薦流程:先呼叫 analyze_url 拿 candidate_tcs,再對每條想覆蓋的 TC 呼叫一次 generate_test、把該 candidate_tc 整段字串當 description 傳入 — 這段會自動寫成 test 函式的 docstring,HTML 報告會把它當作 case 名稱顯示。若提供 url+module(來自 analyze_url 的 modules[]),會用 selectors 預填可執行版本。若想一次處理整個 URL、不想自己編排,請改用 auto_generate_tests。 |
| codegenA | Launch interactive test recording for the active runner. Useful as a baseline-builder before refining with generate_test. Behavior:
When to use:
When NOT to use:
Edge cases:
|
| generate_html_reportA | 把最近一次 run_tests 的結果渲染成單檔自包含 HTML——base64 內嵌截圖、嵌入式 step list、history sparkline 走勢、折疊的 Passed 區塊、展開的 Failed cards。沒外部 CSS/JS 依賴,可以直接寄信、丟靜態 host、貼到 Slack。預設輸出 PROJECT_ROOT/report.html。實作位於 reporters/html.py,走 sample_report.html 同款設計。 |
| get_test_historyA | 遍歷 test-results/history/*.json 快照(每次 run_tests 完會自動歸檔),回傳逐次摘要:timestamp / total / passed / failed / skipped / duration / pass_rate(0-100)。用於 flake 分析(『這條測試上週一直 fail 嗎』)、速度退化分析(『duration 是不是越來越長』)、覆蓋趨勢圖。預設回最近 10 次,limit 可調 1-100。想要可執行行動建議的話接 get_optimization_plan,它已綜合 history + telemetry。 |
| get_optimization_planA | 綜合 history/ 快照、telemetry tool-usage、analyze_url 偵測過的 modules,產出三層自我強化分析:(1) 測試套件品質:每條 test 算 outcomes 字串(PFPFP 那種)→ flake_score、再對失敗 error signature 做指紋比對,連 3 次相同 signature 升級為 broken,duration 退化超 1.5x 標記 slow_regression,否則 stable_passing;(2) MCP 使用模式:top tool、重複 args、錯誤率、常見呼叫鏈(A→B 共現);(3) AI 產測效益:generate_test 寫的 test 有沒有出現在下一次 run、analyze_url 偵測到的 module 對不對得到 test 檔(採用率 vs 覆蓋缺口)。回傳結構化 JSON 並同步寫進 PROJECT_ROOT/optimization-plan.md。每次 run_tests 結束會自動 trigger 一次、所以這個 tool 用來「即時讀」結果。 |
| analyze_urlA | Probe a live web page in headless Chromium and return a structured map of testable modules plus the API endpoints the page actually called. The web counterpart of analyze_screen. Behavior:
When to use:
When NOT to use:
Edge cases:
|
| analyze_screenA | Mobile 版的 analyze_url:透過 |
| init_qa_knowledgeA | 在受測專案根 (PROJECT_ROOT) 建立 qa-knowledge.md 起手範本,含業務規則 / 歷史 Bug / 標準斷言文字 / User Journeys / 技術約束 5 個 H2 區段,每段都有 TODO 提示。Idempotent:檔已存在不會覆蓋(除非 overwrite=true)。新用戶建議第一次跑 MCP 就先 call 一次。這份檔案後續會被 get_qa_context 讀、做為 business_context 傳進 generate_test,讓 AI 寫出有業務邏輯的測試(而不是泛例 monkey testing)。 |
| get_qa_contextA | 讀取受測專案的 qa-knowledge.md(業務規則 / 歷史 Bug / 標準斷言文字 / User Journeys 等領域知識),用 ## H2 區段拆分。用法:先 call 拿到整份或指定 section,再把相關段落以 business_context 傳給 generate_test,產出的 test 就會自帶業務知識註解 — 跳脫 monkey testing。若檔案不存在會 fallback 到內建的 ISTQB 七大原則 + 等價分割 + 邊界值 + 決策表 + 狀態轉換 + Mobile checklist 通用知識,先用著也可以;之後跑 init_qa_knowledge 建立專案專屬版本。 |
| auto_generate_testsA | 一鍵交付:在內部依序做 analyze_url → 為每個偵測到的 module 用 candidate_tcs 內容各跑一次 generate_test,把整套 pytest 測試骨架寫進 PROJECT_ROOT/tests/。等同於『analyze_url 後對每個 module 手動跑 N 次 generate_test』的自動化版本,適合「給我一個 URL、其他你看著辦」這種快速覆蓋場景。每條 candidate_tc 變成對應 test 函式的 docstring,run_tests 跑完 HTML 報告會用 docstring 當 case 名稱顯示。回傳產生的檔案路徑列表 + 每個 module 對應幾個 test。預設每個 module 1 條,想要更密的覆蓋拉 tests_per_module。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Latest Test Report (HTML) | 最近一次測試報告,即時渲染為自包含 HTML |
| Latest Test Report (JSON) | 原始 report.json(各 runner 的原生格式) |
| Optimization Plan (Markdown) | 自我強化分析:每跑完一次自動產出的下一輪行動清單 |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kao273183/mk-qa-master'
If you have feedback or need assistance with the MCP directory API, please join our Discord server