Plugin not installable from marketplace yet; image upload only via undocumented REST endpoint (field is `image`, not `file`)

未關閉
#3 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
56/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
markdown, python
領域
api, documentation

研究方向

Read skills/hackmd-mcp-usage/reference/capability-gaps.md and check the README and linked MCP setup docs for the marketplace installation instructions. Confirm the documented multipart field against the working request described here, then update the affected documentation to explain the plugin's marketplace status and correct the upload example. Done when both documentation gaps raised in the issue are addressed; endpoint support and plans for an MCP upload tool need maintainer input.

由索引模型根據 Issue 內容生成。

描述

Summary

Two things I ran into while trying to automate "publish an Obsidian markdown note with images to HackMD" from Claude Code:

  1. The documented plugin install does not work (plugin is not in the marketplace yet).
  2. Neither the MCP server nor the API docs offer image upload, but an undocumented REST endpoint does work, with one correction to the hint in this repo.

1. /plugin install hackmd@claude-community fails

Following the README / MCP server setup docs:

/plugin marketplace add anthropics/claude-plugins-community   # ok
/plugin marketplace update claude-community                    # ✔ Updated 1 marketplace
/plugin install hackmd@claude-community
# -> Plugin "hackmd" not found in marketplace "claude-community"

The local marketplace clone has no hackmd directory (only eli5, html-plan, next-steps, quickdesign, testdino, tres-finance-plugin). I assume the directory submission is still pending. It would help to state that on the docs page and in the README until it lands, or to offer claude --plugin-dir / a manual .mcp.json snippet as the primary path in the meantime.

Claude Code version: 2.1.306 (Claude Code)

2. Image upload: not possible via MCP, works via undocumented REST endpoint

Use case: an Obsidian note with ~20 ![[img.webp]] embeds. Pasting each image through the web editor by hand is the only documented way. mcp.hackmd.io has no upload tool, hackmd-cli has none, and the public API docs do not list one.

skills/hackmd-mcp-usage/reference/capability-gaps.md in this repo mentions:

curl -X POST "https://api.hackmd.io/v1/notes/<noteId>/images" \
  -H "Authorization: Bearer <user-api-token>" \
  -F "file=@/path/to/image.png"

That exact call returns 400 {"message":"Invalid upload request"}. The multipart field has to be image, not file:

curl -X POST "https://api.hackmd.io/v1/notes/<noteId>/images" \
  -H "Authorization: Bearer $HACKMD_API_TOKEN" \
  -F "[email protected];type=image/webp"
# 201 {"data":{"link":"https://hackmd.io/_uploads/<id>.webp"}}

With that, the whole flow (upload 22 webp files, rewrite the markdown links, PATCH /v1/notes/<id> with the new content) runs unattended from Claude Code. Bytes are stored unchanged (verified against S3), webp is accepted.

Questions

  • Is POST /v1/notes/<noteId>/images a supported endpoint, or something that could change without notice? If supported, could it be added to the public API docs (with the correct image field name) and fixed in capability-gaps.md?
  • Any plans to expose image upload through the MCP server (e.g. an upload-image tool taking a local path or base64), so the push-to-hackmd skill can handle notes with images end to end? Right now the skill's "MCP-only, do not fall back to API tokens" rule makes it unusable for any note that has images.

Happy to test a pre-release or send a PR for the docs fix.

主要語言
Python
星號
3
分支
0
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。