feat: upgrade MCP tools with ACI design, lifecycle APIs, and tri-state open mode - #9
Merged
Conversation
- 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
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
get_mindmap, safercleanup_mindmaps(dryRun), and richerlist_mindmapsmetadata.path/content/both), and introduce tri-state open mode (always/never/agent).Test plan
npm testpassesnpm run buildsucceedsmarkdown_to_mindmapforhtml/png/svg/jpg--open always|never|agentandMARKMAP_OPENbehavior (including per-callopenin agent mode)--return-mode path|content|bothoutput shapes (paths JSON vs inline content)list_mindmaps,get_mindmap, andcleanup_mindmaps(with and withoutdryRun)