{"_id":"@404man/docx-to-md","name":"@404man/docx-to-md","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@404man/docx-to-md","version":"0.1.0","description":"Batch convert .docx to Markdown with pandoc, extract images, and expose an MCP tool for AI agents","keywords":["docx","markdown","pandoc","mcp","cli","spec"],"license":"MIT","author":{"name":"404man"},"repository":{"type":"git","url":"git+https://github.com/404man/docx-to-md.git"},"bugs":{"url":"https://github.com/404man/docx-to-md/issues"},"homepage":"https://github.com/404man/docx-to-md#readme","type":"commonjs","main":"./src/lib.js","bin":{"docx-to-md":"bin/docx-to-md.js"},"scripts":{"test":"node --test test/*.test.js","start":"node bin/docx-to-md.js","mcp":"node bin/docx-to-md.js mcp"},"engines":{"node":">=18.0.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","zod":"^3.24.2"},"publishConfig":{"access":"public"},"gitHead":"95efa31a181d6f78980037f94c3812024b0067d0","_id":"@404man/docx-to-md@0.1.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-Vf6n8/KqtsrmzIVT5QJpaEG0k+0JZeytzA6KbIk0Kgm3AX1sskEkQxt0pdJjZxSKJi7PWnclAoaxlwqoijM7pQ==","shasum":"962a6281fc51a50cf8245234b842d4dcb426722d","tarball":"https://registry.npmjs.org/@404man/docx-to-md/-/docx-to-md-0.1.0.tgz","fileCount":6,"unpackedSize":15508,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICvA4BHBEZK8332cwLZF8V3UnsCR+RGI20koVl/Q0Cc/AiAqvJMOm7tVTolntanOOzCVour0LmejtNDS71vKUvgQOg=="}]},"_npmUser":{"name":"404man","email":"weizhijie924@gmail.com"},"directories":{},"maintainers":[{"name":"404man","email":"weizhijie924@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/docx-to-md_0.1.0_1783599158407_0.7056619174243155"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-09T12:12:38.238Z","0.1.0":"2026-07-09T12:12:38.580Z","modified":"2026-07-09T12:12:38.751Z"},"maintainers":[{"name":"404man","email":"weizhijie924@gmail.com"}],"description":"Batch convert .docx to Markdown with pandoc, extract images, and expose an MCP tool for AI agents","homepage":"https://github.com/404man/docx-to-md#readme","keywords":["docx","markdown","pandoc","mcp","cli","spec"],"repository":{"type":"git","url":"git+https://github.com/404man/docx-to-md.git"},"author":{"name":"404man"},"bugs":{"url":"https://github.com/404man/docx-to-md/issues"},"license":"MIT","readme":"# @404man/docx-to-md\n\nBatch-convert `.docx` files to Markdown with [pandoc](https://pandoc.org/), extract images into per-document `.assets` folders, rewrite image paths to relative URLs, and expose an MCP tool for AI agents.\n\n## Requirements\n\n- Node.js `>= 18`\n- `pandoc` installed and available on `PATH`\n\n```bash\nbrew install pandoc\n```\n\n## Install\n\n```bash\nnpm install -D @404man/docx-to-md\n```\n\nOr run without installing:\n\n```bash\nnpx @404man/docx-to-md --input ./docs/raw --output ./docs/md\n```\n\n## CLI\n\n```bash\ndocx-to-md --input <path> --output <path> [--overwrite] [--dry-run]\ndocx-to-md mcp\ndocx-to-md --help\n```\n\n### Examples\n\n```bash\n# Single file\ndocx-to-md --input ./prd.docx --output ./docs/md --overwrite\n\n# Directory (recursive)\ndocx-to-md --input ./docs/raw --output ./docs/md\n\n# Preview only\ndocx-to-md --input ./docs/raw --output ./docs/md --dry-run\n```\n\n### Output layout\n\n```text\ndocs/md/\n  foo.md\n  foo.assets/\n    media/\n      image1.png\n  nested/\n    bar.md\n    bar.assets/\n      media/\n        image1.jpeg\n```\n\n## MCP (for Cursor / other agents)\n\nStart the MCP stdio server:\n\n```bash\ndocx-to-md mcp\n# or\nnpx @404man/docx-to-md mcp\n```\n\n### Tool: `convert_docx_to_md`\n\n| Argument    | Type    | Required | Description                                      |\n|-------------|---------|----------|--------------------------------------------------|\n| `input`     | string  | yes      | Source `.docx` file or directory                 |\n| `output`    | string  | yes      | Output directory                                 |\n| `overwrite` | boolean | no       | Replace existing outputs (default `false`)       |\n| `dryRun`    | boolean | no       | Preview without writing files (default `false`)  |\n\n### Cursor MCP config\n\nAdd to Cursor MCP settings (e.g. `~/.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"docx-to-md\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@404man/docx-to-md\", \"mcp\"]\n    }\n  }\n}\n```\n\nAfter publishing, agents can call `convert_docx_to_md` with `input` / `output`.\n\n## Programmatic API\n\n```js\nconst { execute } = require('@404man/docx-to-md');\n\nconst result = await execute({\n  input: '/abs/path/to/docs',\n  output: '/abs/path/to/out',\n  overwrite: true,\n  dryRun: false,\n});\n```\n\n## Publish (maintainers)\n\n### 1. Create GitHub repo\n\n```bash\ncd /path/to/docx-to-md\ngit init\ngit add .\ngit commit -m \"feat: initial @404man/docx-to-md CLI and MCP server\"\ngh repo create 404man/docx-to-md --public --source=. --remote=origin --push\n```\n\nOr create `https://github.com/404man/docx-to-md` in the GitHub UI, then:\n\n```bash\ngit remote add origin git@github.com:404man/docx-to-md.git\ngit branch -M main\ngit push -u origin main\n```\n\n### 2. Publish to public npm\n\nUse the **public** registry (not a private company mirror):\n\n```bash\nnpm login --registry https://registry.npmjs.org/\n# Ensure scope @404man exists / you own it\nnpm publish --access public --registry https://registry.npmjs.org/\n```\n\n### 3. Verify\n\n```bash\nnpx @404man/docx-to-md --help\nnpm test\n```\n\n## Development\n\n```bash\nnpm install --registry https://registry.npmjs.org/\nnpm test\nnode bin/docx-to-md.js --help\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-226258c84e8a39e0fc28a35a23d71dc1"}