Skip to content

feat: upgrade MCP tools with ACI design, lifecycle APIs, and tri-state open mode - #9

Merged
jinzcdev merged 3 commits into
mainfrom
feat/upgrade_tools
Aug 4, 2026
Merged

feat: upgrade MCP tools with ACI design, lifecycle APIs, and tri-state open mode#9
jinzcdev merged 3 commits into
mainfrom
feat/upgrade_tools

Conversation

@jinzcdev

@jinzcdev jinzcdev commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Expand the server into a full mindmap lifecycle: Playwright-backed PNG/JPG/SVG export, get_mindmap, safer cleanup_mindmaps (dryRun), and richer list_mindmaps metadata.
  • Make agent/tool UX configuration-first: inject server CLI/env settings into tool descriptions, unify return payloads (path / content / both), and introduce tri-state open mode (always / never / agent).
  • Refresh docs (EN/ZH) and AGENTS guidance, and add broad unit coverage for parsing helpers, lifecycle, and markmap tool result builders.

Test plan

  • npm test passes
  • npm run build succeeds
  • Smoke markdown_to_mindmap for html / png / svg / jpg
  • Verify --open always|never|agent and MARKMAP_OPEN behavior (including per-call open in agent mode)
  • Verify --return-mode path|content|both output shapes (paths JSON vs inline content)
  • Exercise list_mindmaps, get_mindmap, and cleanup_mindmaps (with and without dryRun)
  • Confirm READMEs document the new flags, tools, and return/open modes

- Add server-side image export (PNG/JPG/SVG) via Playwright
- Add `get_mindmap` tool to complete CRUD lifecycle (list/get/cleanup)
- Add `dryRun` parameter to `cleanup_mindmaps` for safe preview
- Add `mtime` (ISO 8601) field to `list_mindmaps` output
- Unify return format: always return `{htmlFilePath, filePath}`
- Dynamically inject server config into tool descriptions
- Add `--open`, `--offline`, `--return-mode` CLI flags
- Add `MARKMAP_OPEN`, `MARKMAP_OFFLINE`, `MARKMAP_RETURN_MODE` env vars
- Change default output directory from temp to `~/.markmap-mcp`
- Extract markmap logic into dedicated modules (escape, exportImage, i18n, lifecycle)
- Add in-browser export toolbar (PNG/JPG/SVG/Copy Markdown) with offline support
- Add `mindmap_from_content` prompt for structured Markdown generation
- Add comprehensive test coverage for markmap creation and lifecycle
- Update READMEs with complete tool documentation and parameter tables
- Remove smithery.yaml, update Dockerfile
- Upgrade `vitest` to version 3.2.6 in `package.json` and `package-lock.json`
- Update `@rollup/rollup-linux-x64-gnu` to version 4.62.2
- Export utility functions `parseBoolean`, `parseReturnMode`, `sanitizeFilename`, and `ensureExtension` for broader usage
- Add comprehensive unit tests for `escapeHtml`, `escapeTextareaContent`, `parseBoolean`, `parseReturnMode`, and lifecycle functions
- Introduce tests for `listMindmaps` and `cleanupMindmaps` functionalities
- Implement tests for `sanitizeFilename` and `ensureExtension` to ensure correct behavior
… tool descriptions

- Refactor open setting from boolean to OpenMode ("always"/"never"/"agent")
- Add "agent" mode: expose `open` parameter on tool, letting LLM decide per call
- Add parseOpenMode() and parseCliOpenMode() with validation and error handling
- Refactor buildHtmlResult() and add buildImageResult() with consistent return modes
- Add ensureMarkmapBasename() for filename discoverability by list/cleanup
- Add ACI tool annotations (title, readOnlyHint, destructiveHint, etc.) to all tools
- Enhance tool descriptions with dynamic mode hints, behavior docs, and response specs
- Update README/README_zh-CN docs with tri-state open mode, return mode tables, and parameter docs
- Add AGENTS.md with architecture overview, commands, and key patterns
- Add .codegraph/.gitignore for CodeGraph data files
- Add comprehensive unit tests for new parseOpenMode, buildHtmlResult, buildImageResult, and helpers
@jinzcdev jinzcdev self-assigned this Aug 4, 2026
@jinzcdev jinzcdev added the enhancement New feature or request label Aug 4, 2026
@jinzcdev
jinzcdev merged commit 807e190 into main Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant