mk-spec-master
mk-spec-master is an MCP server that transforms specs from various sources into structured test scenarios, maintains a bidirectional spec ↔ test traceability matrix, and provides quality coaching — sitting between your spec source and your test runner.
Spec Discovery & Loading
Connect to and fetch specs from Local Markdown, GitHub Issues, Linear, JIRA, Notion, and Figma
List, filter, and fetch individual specs; parse them to extract structured acceptance criteria (with multi-language heading support) and generate an
ac_hashfor drift detection
Test Generation & Planning
Convert acceptance criteria into classified test scenarios (happy/edge/error) with Given/When/Then structure
Generate a complete markdown test plan in one shot, ready to hand off to
mk-qa-masteror other test runners
Coverage & Drift Tracking
Link tests to specs manually or by scanning test directories for
@spec: <ID>tags (Python, JS/TS, Go)View a coverage matrix to instantly see which specs have no tests
Detect spec drift — specs that changed since tests were last linked — to flag potentially stale tests
Spec Quality Coaching
Analyze specs for vague language, implementation-detail leakage, and unclear role references
Generate PM-facing markdown with concrete rewrite suggestions
Produce a three-layer prioritized optimization plan: coverage gaps (L1), spec quality (L2), and process drift (L3)
Knowledge Management
Initialize and read a
spec-knowledge.mdfile storing team methodology, EARS/INVEST rules, actors, and glossary
Self-Reinforcement & Telemetry
Track historical optimization snapshots for trend analysis (spec count, coverage, quality, drift over time)
Identify chronic problem specs that repeatedly appear as drifted, low-quality, or unlinked
Aggregate tool-usage telemetry: call frequency, error rates, latency, and unused tools
Integration with Figma to extract specifications from file frames and comments.
Integration with GitHub Issues to fetch and parse specifications and link them to test scenarios.
Integration with JIRA Cloud to retrieve stories and issues as specifications.
Integration with Linear API to fetch Linear tickets as specifications and maintain traceability.
Integration with local Markdown files with YAML frontmatter as specification source.
Integration with Notion databases to use pages as specifications.
Spec-driven testing over MCP. Turn Linear / JIRA / GitHub Issues / Notion / Figma / Markdown specs into runnable scenarios, hand off to any test runner via
mk-qa-master, and keep a live spec ↔ test coverage matrix.
🟢 Alpha — v0.4: self-reinforcement. 18 tools + 6 adapters. Snapshots archived per
get_optimization_plancall → trend analysis + chronic-spec detection + tool-usage telemetry. Full design indocs/prd.md.
What this is
An MCP server that turns specs — Linear tickets, JIRA stories, GitHub Issues, Notion pages, Figma annotations, plain Markdown — into structured test scenarios, hands them to any test runner (via mk-qa-master or directly), and maintains a live spec ↔ test coverage matrix.
Sibling to mk-qa-master in the mk-* family of opinionated AI-QA MCPs.
Related MCP server: Gigaspec
What this is NOT
It's not | Use this instead |
A spec editor | Linear / JIRA / Notion / Markdown — keep writing specs where you already do |
A test runner |
|
An issue tracker UI | Linear / JIRA / Notion's native interface |
A spec → code generator | GitHub Spec Kit, AWS Kiro |
An LLM | Leverages your AI client (Claude / Cursor / Codex / Gemini) for the reasoning |
mk-spec-master sits between your spec source and your test runner — purely about the spec ↔ test link, the coverage matrix that lives on top, and the quality coach that grades both.
Tool surface (15 tools)
Grouped by role. Each group is a layer in the spec→test→coverage→coach loop.
Meta — orientation (1)
Tool | Purpose |
| Active adapter + all available. Call first so the AI knows whether to expect Linear / JIRA / Notion / Figma / Markdown semantics |
Discovery — find and load specs (3)
Tool | Purpose |
| Enumerate specs from the active source (filter by status / label / limit) |
| Pull a single spec's full content by id |
| Heuristic AC extraction (en + zh-TW + zh-CN headings supported); accepts |
Generation — specs → testable artifacts (2)
Tool | Purpose |
| AC → scenarios with happy / edge / error classification (negation-aware) and best-effort Given/When/Then split |
| One-shot fetch + parse + extract → markdown plan ready to feed to |
Coverage & drift — the traceability layer (4)
Tool | Purpose |
| Record that a test verifies a spec (writes to |
| Scan a test directory for |
| Spec × test grid — answer "which specs have no tests" in one call |
| Re-fetch each linked spec, recompute ac_hash, compare. Buckets into fresh / drifted / unknown / stranded |
Coach — quality + prioritization (3)
Tool | Purpose |
| Heuristic findings on vague language, implementation-leak AC, unclear role refs (the differentiator vs Kiro / Spec Kit) |
| Take analyze output → PM-facing markdown with concrete rewrites |
| Three-layer prioritized plan: coverage gaps (L1) + spec-quality (L2) + process drift (L3). The "what should we fix next" tool |
Knowledge — domain methodology (2)
Tool | Purpose |
| Create |
| Read the spec-knowledge file (with built-in fallback). Optional |
Self-reinforcement — long-running view (3, v0.4)
Tool | Purpose |
| Last N snapshots archived by |
| Scan recent snapshots for specs that repeatedly land in drifted / unknown / low-quality buckets — chronic patterns. "Which specs keep causing trouble?" |
| Aggregate the tool-usage log: which tools get called most, error rates, p50 / p95 latency, dead-surface (declared but never called) |
Adapter status
| Source | Status | Auth |
| Local | ✅ since 0.1.0 | none |
| GitHub Issues via | ✅ since 0.1.0 |
|
| Linear API (GraphQL) | ✅ since 0.2.2 |
|
| JIRA Cloud (REST v3, ADF → markdown) | ✅ since 0.2.3 |
|
| Notion databases (REST v1, blocks → markdown) | ✅ since 0.3.0 |
|
| Figma file frames (TEXT nodes + comments → markdown) | ✅ since 0.3.1 |
|
Common workflows
Four patterns cover ~90% of real use. Each is one sentence to the AI client; the tools chain automatically.
1. Spec → test → run → coverage (the main loop)
"Fetch LIN-123 from Linear, extract scenarios, generate Playwright tests with mk-qa-master, run them, and update the coverage matrix."
Chains: fetch_spec → parse_spec → extract_scenarios → mk-qa-master.generate_test (×N) → link_test_to_spec (×N) → mk-qa-master.run_tests → get_coverage_matrix.
2. Spec health check
"Review every in-progress spec for quality issues and give me a prioritized improvement plan."
Chains: list_specs(status="in-progress") → analyze_spec_quality → propose_spec_improvements → get_optimization_plan.
3. Rebuild traceability after a refactor
"Sync the spec ↔ test index from the test source — I just renamed a bunch of files."
Chains: auto_link_tests → get_coverage_matrix. Tests need @spec: <ID> docstring tags for auto-link to work; comment-above-function and docstring-inside both supported.
4. Session warmup
"Before we work on specs today: load the spec-knowledge methodology and tell me which source is active."
Chains: get_spec_source_info → get_spec_context. Cheap, sets the methodology + adapter context for everything that follows.
Sample output
get_optimization_plan markdown (excerpt)
# Optimization plan
_Coverage matrix: 23 spec(s) tracked, 4 untested._
_Spec quality: 23 spec(s) analyzed, 17 finding(s)._
_Drift: 2 drifted, 0 stranded, 5 without ac_hash._
## 🔴 Layer 1 — Coverage gaps
**Specs with zero tests** (ranked first — every business risk lives here):
- `LIN-204` — Apply promo code at checkout
- `LIN-211` — Refund flow
## 🟡 Layer 2 — Spec quality
### `LIN-098` — Checkout latency (score: 80/100, findings: 4)
- 🟡 `ac-1`: Quantify (e.g., 'response within 200 ms') (evidence: `fast`)
- 🔴 `ac-3`: Rewrite to describe what the user observes (evidence: `redis`)
## 🔵 Layer 3 — Process drift
**Drifted** (spec changed since link — review affected tests):
- `LIN-123` — Apply discount at checkout · 4 test(s) potentially staleget_coverage_matrix markdown (excerpt)
# Coverage matrix
- Specs tracked: 23
- Specs shown (min_tests=0): 23
- Specs with zero tests: 4
| Spec | Title | Tests | Last status |
|---------|--------------------------------|------:|-------------|
| `LIN-204` | Apply promo code at checkout | 0 | — |
| `LIN-123` | Apply discount at checkout | 4 | passed |Install
uvx mk-spec-master # or: pip install mk-spec-masterAdd to your MCP client config:
{
"mcpServers": {
"mk-spec-master": {
"command": "uvx",
"args": ["mk-spec-master"],
"env": {
"SPEC_SOURCE": "markdown_local",
"SPEC_PROJECT_ROOT": "/path/to/your/project"
}
}
}
}Claude Desktop config lives at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Then in Claude / Cursor / Codex / Gemini CLI:
"Use mk-spec-master to parse SPEC-001, extract scenarios, and hand them to mk-qa-master so we can generate Playwright tests."
Why this is missing from the ecosystem
Tool | Lock-in | What we do differently |
AWS Kiro | AWS IDE only, proprietary | MCP-native, multi-client, open source |
Jama Connect MCP | $50k+/year, enterprise-only | SMB / indie / AI-native segment |
GitHub Spec Kit | spec→code; runtime test coverage out of scope | We add runtime test coverage |
testomat.io / JIRA MCPs | Single source (JIRA), SaaS lock | Multi-source, file-based index, no lock |
See docs/prd.md §4 for the full positioning.
Walkthrough — spec → test → coverage (long form)
Given a Linear ticket LIN-123 "Apply discount at checkout" with 4 acceptance criteria:
You: Use mk-spec-master to fetch LIN-123, extract scenarios, generate
Playwright tests with mk-qa-master, run them, and report coverage.The AI client chains:
mk-spec-master.fetch_spec("LIN-123")
mk-spec-master.parse_spec(spec_id="LIN-123") → 4 AC + ac_hash
mk-spec-master.extract_scenarios(...) → 1 happy + 3 error
mk-spec-master.generate_test_plan(spec_id="LIN-123")
for scenario in plan:
mk-qa-master.generate_test(business_context=scenario.gherkin)
mk-spec-master.link_test_to_spec(spec_id="LIN-123", test_node_id=..., ac_hash=...)
mk-qa-master.run_tests
mk-spec-master.get_coverage_matrixThe traceability index now records all 4 links with their AC hashes. Next sprint, when the spec changes, get_drift_report flags every test whose linked spec has moved — re-run the chain only for those.
Status
Milestone | Target | Status |
v0.1 (MVP — markdown_local + github_issues, 7 tools) | June 2026 | ✅ Shipped |
v0.2 (Linear, JIRA, coverage matrix, spec-quality coach, drift report) | Aug 2026 | ✅ Complete (0.2.3) |
v0.3 (Notion, Figma, auto-link, optimization plan) | Oct 2026 | ✅ Complete (0.3.3) |
v1.0 (production-ready, docs, integration recipes) | Q4 2026 | ⬜ |
Family
mk-qa-master— AI 測試大師, the test-runner sibling. Tests run via mk-qa-master; coverage tracked here.More
mk-*MCPs in design (mk-perf-master,mk-a11y-master).
License
MIT © 2026 Jack Kao — see LICENSE
(中文翻譯參考:LICENSE.zh-TW.md; the English version is authoritative).
Plain-English version: personal use, commercial use, modification, redistribution — all allowed. The only requirement is that you keep the copyright and license notice in your copy. No warranty: if it breaks something in production, you can't come after the author.
If this saved you time, a coffee goes a long way. ☕
Available Tools
18 toolsanalyze_spec_qualityA
Run heuristic checks against a spec's body: vague language without measurable thresholds (fast / easy / intuitive / 現代 / 順暢 ...), implementation-detail leakage in AC ('uses Redis', '透過 X 服務'), and references to roles ('logged-in user', '管理員') without a Preconditions section. Pass spec_id for one spec, raw_text to analyze a freeform draft, or neither to sweep every spec from the active source. Returns {source, specs_analyzed, total_findings, results[]}. Each result has {spec_id, title, ac_count, score (0–100), findings[]} where each finding carries severity (info / warn / error), evidence, and a suggested rewrite. Pair with propose_spec_improvements for the markdown coach plan.
Inputs: spec_id, raw_text.
auto_link_testsA
Scan a directory of test files for @spec: <ID> tags in docstrings or comments and call link_test_to_spec for each (test, spec) pair found. Supports Python (def test_*), JS/TS (it('...') / test('...')), and Go (func TestX(t *testing.T)). For each tag the nearest preceding test function within 30 lines is treated as the owner; test_node_id is <relative-path>::<test-name>. Use when a user says 'rebuild the spec coverage' or 'sync test → spec links after the refactor'. Set dry_run: true to preview without writing. Returns {test_dir, files_scanned, tags_found, links_added, links_updated, skipped, discoveries[], markdown, dry_run}.
Inputs: test_dir, languages, dry_run.
extract_scenariosA
Turn parsed acceptance criteria into testable scenarios. Each scenario is classified as happy / edge / error via keyword heuristics, and split into Given / When / Then where possible. Pass the acceptance_criteria array returned by parse_spec. Returns {count, scenarios[]} where each scenario has {id, ac_id, title, kind, given, when, then}. Best paired with generate_test_plan for a markdown handoff to mk-qa-master.
Inputs: acceptance_criteria (required).
fetch_specA
Pull a single spec by id from the active source. For markdown_local the id is either the id: field in frontmatter or the filename stem; for github_issues it's the issue number as string. Returns the full Spec record {id, title, body, url, status, labels, metadata}. Pair with parse_spec to extract structured acceptance criteria.
Inputs: spec_id (required).
generate_test_planA
One-shot: fetch + parse + extract for a spec, then emit a markdown test plan with a business_context block per scenario ready to hand to mk-qa-master.generate_test(business_context=...). The AI client typically reads this plan, loops the scenarios, and calls mk-qa-master once per scenario. Set target_runner to hint the desired output (pytest / jest / cypress / go / maestro). Returns {spec_id, target_runner, scenario_count, markdown, scenarios[]}.
Inputs: spec_id (required), target_runner.
get_coverage_matrixA
Snapshot of every spec ↔ test link recorded in the local index. Returns both structured rows and a ready-to-paste markdown table — call this when a user asks 'what's tested' or 'which specs have no tests'. Filters: min_tests (default 0; set to 0 to find untested specs, set to 1 to hide them) and include_orphans (default true). Returns {specs_total, specs_shown, specs_untested, orphan_count, rows[], markdown}.
Inputs: min_tests, include_orphans.
get_drift_reportA
For every spec in the index that has a stored ac_hash, fetch the live spec via the active adapter and recompute its ac_hash to detect drift. Buckets the results into fresh (no drift), drifted (linked tests may be stale), unknown (no hash stored — re-link with ac_hash from parse_spec._meta.ac_hash to enable), and stranded (spec_id can no longer be fetched — deleted, closed, or source mismatch). Use when a user asks 'has anything changed' / 'what's out of sync' / 'is my test suite still aligned with specs'. Optional spec_id narrows the check to one spec. Returns counts + per-bucket details + markdown summary.
Inputs: spec_id.
get_drift_signatureA
Scan the recent snapshot history for chronic problems: same spec_id repeatedly appearing in drifted / unknown / low-quality buckets. Specs flagged as 'unstable' (drifts every cycle), 'chronic_low_quality' (vague every cycle), or 'chronic_unhashed' (never gets a hash recorded). Use when a user asks 'which specs keep causing trouble' / 'what's the long-running pain'. Args: window (snapshots to scan, default 5), threshold (min recurrence to flag, default 3). Returns {ready, snapshots_scanned, chronic[], markdown}.
Inputs: window, threshold.
get_optimization_planA
Three-layer coach output that integrates coverage / quality / drift signals into one prioritized markdown plan. Layer 1 surfaces untested + thin-coverage specs; Layer 2 ranks specs by severity-weighted quality findings; Layer 3 surfaces drifted + stranded specs. Use this when a user asks 'what should we fix next' / 'show me the weekly plan' / 'review the suite'. Toggle layers via include_coverage / include_quality / include_drift booleans (all default true). top_n caps per-layer detail rows (default 10). Returns {specs_total, *_count, *[], markdown}.
Inputs: include_coverage, include_quality, include_drift, top_n.
get_spec_contextA
Read SPEC_PROJECT_ROOT/spec-knowledge.md (or fall back to built-in defaults if missing). Call near the start of a session so the same methodology + domain glossary colours every spec interpretation that follows. Optional section filters to a single heading (partial-match, case-insensitive) — e.g. section='actors' returns just the actors block. Returns {source: 'file'|'builtin', content, ...}.
Inputs: section.
get_spec_historyA
Return the last N snapshots archived by get_optimization_plan plus trend deltas (current vs ~7 days ago, vs ~30 days ago) for spec count, untested, quality findings, drift, stranded, and unknown-hash specs. Use when a user asks 'are we improving' / 'show me the trend' / 'how did we do this month'. Requires at least 2 snapshots for trend; degrades gracefully with fewer. Returns {snapshots_total, snapshots[], trend[], markdown}.
Inputs: limit.
get_spec_source_infoA
Return the active spec source (selected via SPEC_SOURCE env var) plus all adapters built into this server. Call first in any session so the AI knows whether to expect markdown / GitHub / (future) Linear / JIRA / Notion semantics. Returns {active, available, version}.
Inputs: no named parameters.
get_telemetryA
Aggregate the tool-usage log written by this server. Surfaces: which tools are called most, which fail most (error rate), p50 / p95 latency per tool, and which declared tools have never been called in the window (dead surface). Records contain only tool name + timing + ok flag — argument values are never logged. Use when a user asks 'what's the AI actually using' / 'which tools are slow' / 'which tools are unused'. Args: days (window, default 30), include_inactive (bool, default true). Returns {records_total, window_days, tools[], inactive[], markdown}.
Inputs: days, include_inactive.
init_spec_knowledgeA
Create SPEC_PROJECT_ROOT/spec-knowledge.md from a starter template. The file carries spec methodology (EARS, INVEST, AC quality rules) plus TODO sections for the team's domain rules / actors / glossary. Other mk-spec-master tools lean on this indirectly via get_spec_context. Idempotent — refuses to overwrite an existing file unless overwrite=true. Optional project_name labels the file.
Inputs: project_name, overwrite.
link_test_to_specA
Record that a test verifies a spec. Writes into SPEC_PROJECT_ROOT/.mk-spec-master/index.json (data ownership stays with the user). Re-linking the same node_id updates the timestamp instead of duplicating. Call this right after mk-qa-master.generate_test returns a node_id so the coverage matrix stays current. Pass spec_title / spec_source / spec_url (typically already known from earlier fetch_spec) to cache them into the index so get_coverage_matrix can render titles without re-fetching from the source. Pass ac_hash (from parse_spec._meta.ac_hash) to enable drift detection via get_drift_report. Returns {action: 'added'|'updated', spec_id, test_node_id, total_links_for_spec}.
Inputs: spec_id (required), test_node_id (required), spec_title, spec_source, +2 more.
list_specsA
Enumerate specs from the active source. For markdown_local this globs SPEC_PROJECT_ROOT/specs/*.md and reads YAML frontmatter; for github_issues it queries the configured owner/repo (set via SPEC_PROJECT_KEY). Optional filters: status (string — adapter-specific: 'in-progress' for markdown, 'open'|'closed'|'all' for GitHub), label (string), limit (int, default 50). Returns {source, count, specs[]}.
Inputs: status, label, limit.
parse_specA
Extract structured acceptance criteria from a spec body. Looks for headings matching 'Acceptance criteria' / 'AC' / '驗收條件' / '驗收標準' (case-insensitive, en + zh-TW + zh-CN) and pulls numbered or bulleted items beneath. Pass spec_id to use the active adapter, or raw_text to parse ad-hoc spec text without going through any source. Returns {spec_id, title, acceptance_criteria[], roles[], preconditions[], _meta}. Roles + preconditions are placeholders in v0.1 — filled by the v0.2 spec-quality coach.
Inputs: spec_id, raw_text.
propose_spec_improvementsA
Take analyze_spec_quality output and produce a PM-facing markdown coach plan grouping findings by spec and issue type, with concrete rewrite suggestions per finding. If analysis is not provided, runs analyze_spec_quality inline with the remaining arguments. Use this when a user says 'how do I improve this spec' or 'review my PRD'. Returns {markdown, actions[]}.
Inputs: analysis, spec_id, raw_text.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a clearly distinct purpose, covering separate phases of the spec lifecycle (fetching, parsing, quality analysis, test generation, linking, coverage, drift, history, etc.). No two tools perform overlapping functions; related tools like analyze_spec_quality and propose_spec_improvements are designed to work sequentially without ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., fetch_spec, parse_spec, get_coverage_matrix). There are no deviations or mixed naming conventions, making the API predictable and easy to navigate.
With 18 tools, the server covers the full spec management process without bloat. Each tool serves a unique and necessary function, and the count is well-scoped for the domain—neither too few to be useful nor too many to be overwhelming.
The tool set covers the core lifecycle: listing, fetching, parsing, quality analysis, test generation, linking (manual and auto), coverage, drift detection, optimization, history, context, source info, and telemetry. Minor gaps exist, such as no explicit tool for unlinking tests from specs or editing the spec-knowledge file, but these do not severely hinder typical workflows.
Maintenance
Related MCP Connectors
Official MCP server for Qase — manage test cases, runs, suites, defects via AI tools.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
Unified 15-tool SEO, SERP, clean Markdown & GEO (LLM citation Share-of-Voice) MCP server.
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Related MCP Servers
- AlicenseAqualityFmaintenanceQA Sphere MCP server that enables Large Language Models to interact directly with test management system test cases, supporting AI-powered development workflows and test case discovery.1528 npm23MIT
- AlicenseNot gradedqualityDmaintenanceAn AI-native specification framework that enables deep requirements analysis and structured project planning through intelligent Q\&A workflows. The MCP server provides tools for project initialization, requirement analysis, and the generation of living documentation like development plans and architecture specs.3 npmApache 2.0
- AlicenseAqualityDmaintenanceMCP server for API test case generation from Swagger/OpenAPI specs. Parses Swagger 2.0 and OpenAPI 3.x, generates test cases across 8 categories (positive, negative, boundary, auth, security, idempotency, pagination, business logic), and exports to Postman, TestRail, Allure, k6, pytest, Gherkin, and CSV. Supports internal corporate APIs with auth headers. Auto-saves export files to your working di1010 npm2MIT
- AlicenseCqualityBmaintenanceAn MCP server implementing Spec-Driven Development workflows for AI-agent CLIs and IDEs like Claude Code and Cursor, enabling spec-first development with automated workflow guidance and quality checks.17137 npm54MIT