Add MCP server with 7 tools + Quarto output (Issues #212 and #216 in klausagnoletti/malware-and-monsters)#1
Open
klausagnoletti wants to merge 5 commits intoArcanum-Sec:mainfrom
Conversation
Converts the TabletopExercise skill into an MCP server so AI coding agents can enrich M&M scenario cards in a schema-validated, additive-only way. New files: - generators/schema.ts — Zod v3 schemas as single source of truth for types, MCP validation, and the tabletop://schema resource - generators/mcp-server.ts — MCP server (StdioServerTransport) with 6 tools and 3 resources - generators/test-mcp.ts — integration tests via InMemoryTransport (39/39 passing) - CLAUDE.md — project coding standards (security, TypeScript, MCP tool design, code quality) - .gitignore — excludes node_modules and generated test HTML Modified files: - generators/generate-pdf.ts — exports generateTabletopHTML(data, mode) wrapper; existing generatePDF and CLI entry point untouched - generators/package.json — adds @modelcontextprotocol/sdk, zod, zod-to-json-schema; adds mcp and test scripts Tools: check_scenario_completeness, validate_exercise_data, generate_exercise, merge_exercise_data, validate_m_and_m_formatting, list_scenario_cards Resources: tabletop://schema, tabletop://atomics, tabletop://template Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and-monsters) Implements native Quarto markdown output for the M&M handbook: - generate-qmd.ts: formatting helpers, guards (safeQmd, validateTestNetIPs, validateContemporaryReadAloud), variation block wrapping, section renderers for Inject Sequence / NPC Dialogue / Red Herrings / Gap Analysis, handout renderer with verified CSS block - mcp-server.ts: registers generate_exercise_qmd as Tool 6; populates MALMON_FAMILIES with all 13 canonical names from M&M scenario-cards - schema.ts: extends all sub-schemas with QMD-specific fields (trigger, read_aloud, artifact_inline, hint_if_stuck, NPCDialogueLinesQMD union, RedHerringSchema, handout artifact fields, etc.) - test-mcp.ts: adds 6 new integration tests (Tests 13-18) covering basic generation, handout output, em dash guard, contemporary read_aloud violation, TEST-NET IP validation, path traversal; 63/63 pass Verified: quarto render on lockbit/hospital-emergency fixture produces clean HTML with no warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…stral Vibe Documents setup for all four CLIs with correct config formats: - Claude Code: claude mcp add CLI command - Gemini CLI: ~/.gemini/settings.json (JSON mcpServers block) - OpenAI Codex CLI: codex mcp add command + config.toml format - Mistral Vibe: ~/.vibe/config.toml TOML format Also adds v3.0 version entry and updated file structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements two issues from klausagnoletti/malware-and-monsters:
generate_exercise_qmdtool for native Quarto markdown output, enabling direct integration with the M&M handbook's Quarto book structure without an HTML conversion stepNew files
schema.ts— Zod v3 schemas as single source of truth for TypeScript types, MCP validation, and thetabletop://schemaresource. Extended with all QMD-specific fields.mcp-server.ts— MCP server withStdioServerTransportand exportedcreateServer()factory for testing. 7 tools + 3 resources.generate-qmd.ts— QMD generator with formatting helpers, guards (safeQmd,validateTestNetIPs,validateContemporaryReadAloud), variation block wrapping, four section renderers, and a handout renderer.test-mcp.ts— 18 integration tests (63 assertions) usingInMemoryTransport— all pass.Tools registered
check_scenario_completenessvalidate_exercise_datagenerate_exercisefacilitator.html+participant.htmlmerge_exercise_datavalidate_m_and_m_formattinggenerate_exercise_qmdlist_scenario_cardsResources
tabletop://schematabletop://atomicstabletop://templateVerification
bun run test-mcp.ts)quarto renderon a lockbit/hospital-emergency fixture produces clean HTML with no warningsstuxnet/historical-foundation/handout-a-scada-diagnostics.qmdMALMON_FAMILIESpopulated with all 13 canonical names from M&M scenario-cards