feat(extension): package as Claude Desktop Extension (.mcpb) #118

Merged
synath merged 0 commits from refs/pull/118/head into main 2026-05-07 20:28:02 +00:00
synath commented 2026-05-06 16:57:33 +00:00 (Migrated from codeberg.org)

What this is

Adds an extension/ directory packaging forgejo-mcp as a Claude Desktop Extension (.mcpb format). Users of the Claude Desktop app can drag-and-drop install this rather than hand-editing claude_desktop_config.json.

Strictly additive — the Go binary and its CLI surface are untouched. Existing usage paths (CLI invocation, mcpServers config blocks, claude mcp add) continue working identically. Risk of breaking existing forgejo-mcp users is essentially zero.

What's in the PR

  • extension/manifest.json — manifest schema 0.3. Includes the full 94-tool inventory (sourced from the binary's actual tools/list response), user_config for URL + access token (with sensitive: true on the token), and reasonable metadata.
  • extension/test_smoke.py — verifies the bundled binary boots and that the manifest's tools array agrees with the binary's tools/list. Catches the most likely drift bug (manifest goes stale relative to evolving binary). Skips cleanly when FORGEJO_ACCESS_TOKEN is unset, so unattended CI without secrets passes.
  • extension/README.md — build flow (go buildnpx @anthropic-ai/mcpb pack), test usage, future-work suggestions.
  • extension/.gitignore — ignores build artifacts.

A note on testing

The smoke test caught real manifest-vs-binary drift while developing this — the README's tool table was missing 14 tools the binary already exposes (orgs, teams, PR reviews, attachments). The manifest now reflects what the binary actually does, so the Extensions UI displays accurate tool discoverability.

We noted that prior PRs to this repo got LLM-generated review comments about lack of testing. The smoke test here is what we could meaningfully automate without overstepping into testing things that aren't testable from outside (sideload UX, configuration form rendering, end-to-end behavior).

Possible follow-ups, left for your call

Documented in extension/README.md rather than pre-implemented:

  • Hook the .mcpb build into .goreleaser.yml so a pre-built archive is produced on each release.
  • Cross-platform binary bundling via server.mcp_config.platform_overrides, populated from goreleaser's per-platform builds.
  • Submit to Anthropic's curated extensions directory once the packaging stabilizes — feels like a maintainer call rather than something a third-party contributor should do unilaterally.
  • Sign the .mcpb (npx @anthropic-ai/mcpb sign).

If you'd like any of these now rather than as follow-ups, happy to extend the PR.

Try it

go build -o extension/bin/forgejo-mcp .
npx @anthropic-ai/mcpb pack extension/ extension/forgejo-mcp.mcpb
# Then drag the .mcpb into Claude Desktop → Settings → Extensions, or use the file picker.

Tested

  • Built the extension locally (macOS arm64).
  • Sideloaded into Claude Desktop and confirmed tools surface in chat.
  • Made a real get_issue_by_index call against whetstone/whetstone#77 — round-trip works.
  • extension/test_smoke.py reports PASS: manifest and binary agree on 94 tools.
## What this is Adds an `extension/` directory packaging `forgejo-mcp` as a [Claude Desktop Extension](https://www.anthropic.com/engineering/desktop-extensions) (`.mcpb` format). Users of the Claude Desktop app can drag-and-drop install this rather than hand-editing `claude_desktop_config.json`. **Strictly additive** — the Go binary and its CLI surface are untouched. Existing usage paths (CLI invocation, `mcpServers` config blocks, `claude mcp add`) continue working identically. Risk of breaking existing forgejo-mcp users is essentially zero. ## What's in the PR - `extension/manifest.json` — manifest schema 0.3. Includes the full 94-tool inventory (sourced from the binary's actual `tools/list` response), `user_config` for URL + access token (with `sensitive: true` on the token), and reasonable metadata. - `extension/test_smoke.py` — verifies the bundled binary boots and that the manifest's `tools` array agrees with the binary's `tools/list`. Catches the most likely drift bug (manifest goes stale relative to evolving binary). Skips cleanly when `FORGEJO_ACCESS_TOKEN` is unset, so unattended CI without secrets passes. - `extension/README.md` — build flow (`go build` → `npx @anthropic-ai/mcpb pack`), test usage, future-work suggestions. - `extension/.gitignore` — ignores build artifacts. ## A note on testing The smoke test caught real manifest-vs-binary drift while developing this — the README's tool table was missing 14 tools the binary already exposes (orgs, teams, PR reviews, attachments). The manifest now reflects what the binary actually does, so the Extensions UI displays accurate tool discoverability. We noted that prior PRs to this repo got LLM-generated review comments about lack of testing. The smoke test here is what we could meaningfully automate without overstepping into testing things that aren't testable from outside (sideload UX, configuration form rendering, end-to-end behavior). ## Possible follow-ups, left for your call Documented in `extension/README.md` rather than pre-implemented: - Hook the `.mcpb` build into `.goreleaser.yml` so a pre-built archive is produced on each release. - Cross-platform binary bundling via `server.mcp_config.platform_overrides`, populated from goreleaser's per-platform builds. - Submit to Anthropic's curated extensions directory once the packaging stabilizes — feels like a maintainer call rather than something a third-party contributor should do unilaterally. - Sign the `.mcpb` (`npx @anthropic-ai/mcpb sign`). If you'd like any of these now rather than as follow-ups, happy to extend the PR. ## Try it ```sh go build -o extension/bin/forgejo-mcp . npx @anthropic-ai/mcpb pack extension/ extension/forgejo-mcp.mcpb # Then drag the .mcpb into Claude Desktop → Settings → Extensions, or use the file picker. ``` ## Tested - Built the extension locally (macOS arm64). - Sideloaded into Claude Desktop and confirmed tools surface in chat. - Made a real `get_issue_by_index` call against `whetstone/whetstone#77` — round-trip works. - `extension/test_smoke.py` reports `PASS: manifest and binary agree on 94 tools`.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp!118
No description provided.