Add support for wiki #32

Closed
opened 2025-10-10 16:38:31 +00:00 by BoBeR182 · 8 comments
BoBeR182 commented 2025-10-10 16:38:31 +00:00 (Migrated from codeberg.org)
Add support from upstream to allow the MCP to provide Wiki https://gitea.com/gitea/gitea-mcp/src/branch/main/README.md?display=source#L206 https://gitea.com/gitea/gitea-mcp/src/branch/main/operation/wiki/wiki.go
goern commented 2025-12-14 09:13:06 +00:00 (Migrated from codeberg.org)

Wiki Support Status

Status: Pending upstream dependency

Why Wiki Support Is Not Yet Available

Wiki tools (list, get, create, update, delete wiki pages) are planned but currently blocked by a missing dependency in the forgejo-sdk.

The SDK (v2.0.0-v2.2.0) does not yet include wiki API methods. Rather than implementing a workaround with raw HTTP calls, we prefer to:

  1. Contribute the wiki methods upstream to forgejo-sdk
  2. Integrate them cleanly into forgejo-mcp once released

This approach ensures better maintainability and consistency with other operations.

Tracking

  • Feature request: See wiki-support.md for the full implementation plan
  • Upstream contribution: Pending PR to forgejo-sdk

Workaround

If you need wiki functionality now, you can use the Forgejo API directly:

  • GET /api/v1/repos/{owner}/{repo}/wiki/pages
  • GET /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}
  • POST /api/v1/repos/{owner}/{repo}/wiki/new
  • PATCH /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}
  • DELETE /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}
# Wiki Support Status **Status**: Pending upstream dependency ## Why Wiki Support Is Not Yet Available Wiki tools (list, get, create, update, delete wiki pages) are planned but currently blocked by a missing dependency in the [forgejo-sdk](https://codeberg.org/mvdkleijn/forgejo-sdk). The SDK (v2.0.0-v2.2.0) does not yet include wiki API methods. Rather than implementing a workaround with raw HTTP calls, we prefer to: 1. Contribute the wiki methods upstream to forgejo-sdk 2. Integrate them cleanly into forgejo-mcp once released This approach ensures better maintainability and consistency with other operations. ## Tracking - **Feature request**: See [wiki-support.md](./wiki-support.md) for the full implementation plan - **Upstream contribution**: Pending PR to forgejo-sdk ## Workaround If you need wiki functionality now, you can use the Forgejo API directly: - `GET /api/v1/repos/{owner}/{repo}/wiki/pages` - `GET /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}` - `POST /api/v1/repos/{owner}/{repo}/wiki/new` - `PATCH /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}` - `DELETE /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}`
goern commented 2025-12-30 10:52:05 +00:00 (Migrated from codeberg.org)

Investigation Update

The wiki tools have already been implemented in operation/wiki/wiki.go but are not registered with the MCP server.

Current State

Component Status Location
Tool constants Defined operation/wiki/wiki.go:17-21
list_wiki_pages tool Implemented ListWikiPagesFn handler
create_wiki_page tool Implemented CreateWikiPageFn handler
update_wiki_page tool Implemented UpdateWikiPageFn handler
Registration Missing operation/operation.go

What's Missing

The wiki package needs to be wired up in operation/operation.go:

  1. Add import: "codeberg.org/goern/forgejo-mcp/v2/operation/wiki"
  2. Add registration call: wiki.RegisterTool(s)

Next Steps

This issue can be unblocked - the upstream forgejo-sdk now supports wiki operations (the code already uses forgejo_sdk.CreateWikiPageOption and forgejo_sdk.EditWikiPageOption). Just need to register the tools to make them available.

## Investigation Update The wiki tools have already been implemented in `operation/wiki/wiki.go` but are **not registered** with the MCP server. ### Current State | Component | Status | Location | |-----------|--------|----------| | Tool constants | ✅ Defined | `operation/wiki/wiki.go:17-21` | | `list_wiki_pages` tool | ✅ Implemented | `ListWikiPagesFn` handler | | `create_wiki_page` tool | ✅ Implemented | `CreateWikiPageFn` handler | | `update_wiki_page` tool | ✅ Implemented | `UpdateWikiPageFn` handler | | Registration | ❌ Missing | `operation/operation.go` | ### What's Missing The wiki package needs to be wired up in `operation/operation.go`: 1. Add import: `"codeberg.org/goern/forgejo-mcp/v2/operation/wiki"` 2. Add registration call: `wiki.RegisterTool(s)` ### Next Steps This issue can be **unblocked** - the upstream forgejo-sdk now supports wiki operations (the code already uses `forgejo_sdk.CreateWikiPageOption` and `forgejo_sdk.EditWikiPageOption`). Just need to register the tools to make them available.
goern commented 2025-12-30 10:53:41 +00:00 (Migrated from codeberg.org)

Correction: Still Blocked

Attempted to register the wiki tools but the build failed:

operation/wiki/wiki.go:64:40: forgejo.Client().ListWikiPages undefined
operation/wiki/wiki.go:84:21: undefined: forgejo_sdk.CreateWikiPageOption
operation/wiki/wiki.go:90:39: forgejo.Client().CreateWikiPage undefined
operation/wiki/wiki.go:116:21: undefined: forgejo_sdk.EditWikiPageOption
operation/wiki/wiki.go:122:39: forgejo.Client().EditWikiPage undefined

The current forgejo-sdk (v2.0.0) does not have wiki page methods - only ExternalWiki struct.

Status Update

Component Status
Tool definitions in operation/wiki/ Ready
forgejo-sdk wiki methods Not available
Status/Blocked label Correct

This issue remains blocked on upstream forgejo-sdk adding wiki page support (ListWikiPages, CreateWikiPage, EditWikiPage).

## Correction: Still Blocked Attempted to register the wiki tools but the build failed: ``` operation/wiki/wiki.go:64:40: forgejo.Client().ListWikiPages undefined operation/wiki/wiki.go:84:21: undefined: forgejo_sdk.CreateWikiPageOption operation/wiki/wiki.go:90:39: forgejo.Client().CreateWikiPage undefined operation/wiki/wiki.go:116:21: undefined: forgejo_sdk.EditWikiPageOption operation/wiki/wiki.go:122:39: forgejo.Client().EditWikiPage undefined ``` The current forgejo-sdk (`v2.0.0`) does not have wiki page methods - only `ExternalWiki` struct. ### Status Update | Component | Status | |-----------|--------| | Tool definitions in `operation/wiki/` | ✅ Ready | | forgejo-sdk wiki methods | ❌ Not available | | **Status/Blocked label** | ✅ Correct | This issue remains blocked on upstream forgejo-sdk adding wiki page support (`ListWikiPages`, `CreateWikiPage`, `EditWikiPage`).
goern commented 2025-12-30 10:56:49 +00:00 (Migrated from codeberg.org)

Upstream SDK Status Check

Checked mvdkleijn/forgejo-sdk for wiki support progress:

Findings

Check Result
Wiki-related issues None found
Wiki-related PRs None found
wiki.go file in main branch Does not exist
wiki.go in feature branches Not found
Gitea go-sdk wiki.go Also does not exist

Notable Activity

There's an active WIP PR #94: feat: move to generated models using go-swagger which may eventually auto-generate wiki methods from the Forgejo OpenAPI spec, but it's still in progress.

Current SDK Version

The SDK is at v2.0.0 with no wiki support. Open feature requests include:

  • #84: Organization and Repository Variables
  • #81: Quota support
  • #85: Listing/creating/deleting other users' tokens

Recommendation: Consider opening a feature request on the forgejo-sdk repo for wiki API support, or contributing the implementation directly.

## Upstream SDK Status Check Checked [mvdkleijn/forgejo-sdk](https://codeberg.org/mvdkleijn/forgejo-sdk) for wiki support progress: ### Findings | Check | Result | |-------|--------| | Wiki-related issues | ❌ None found | | Wiki-related PRs | ❌ None found | | `wiki.go` file in main branch | ❌ Does not exist | | `wiki.go` in feature branches | ❌ Not found | | Gitea go-sdk wiki.go | ❌ Also does not exist | ### Notable Activity There's an active WIP PR [#94: feat: move to generated models using go-swagger](https://codeberg.org/mvdkleijn/forgejo-sdk/pulls/94) which may eventually auto-generate wiki methods from the Forgejo OpenAPI spec, but it's still in progress. ### Current SDK Version The SDK is at `v2.0.0` with no wiki support. Open feature requests include: - #84: Organization and Repository Variables - #81: Quota support - #85: Listing/creating/deleting other users' tokens **Recommendation**: Consider opening a feature request on the forgejo-sdk repo for wiki API support, or contributing the implementation directly.
goern commented 2026-03-27 23:27:31 +00:00 (Migrated from codeberg.org)

Status Update (2026-03-28): Still Blocked on SDK

Re-assessed with forgejo-sdk v3.0.0 — still no wiki methods.

What exists

  • Forgejo Wiki API is live on Codeberg with 4 endpoints:
    • GET /repos/{owner}/{repo}/wiki/pages
    • GET /repos/{owner}/{repo}/wiki/page/{pageName}
    • GET /repos/{owner}/{repo}/wiki/revisions/{pageName}
    • POST /repos/{owner}/{repo}/wiki/new
    • PATCH/DELETE on /wiki/page/{pageName}

What's missing

  • forgejo-sdk v3.0.0: No wiki.go, no wiki types, no wiki methods — only HasWiki bool on repo structs
  • forgejo-sdk main branch: Same — no wiki support has been added

Summary

The API exists and works, but the SDK has no wrapper for it. This is the same blocker pattern as #98 (reply to review comment). An upstream contribution to forgejo-sdk adding wiki methods would unblock both issues.

Keeping as blocked until forgejo-sdk adds wiki support.

## Status Update (2026-03-28): Still Blocked on SDK Re-assessed with forgejo-sdk v3.0.0 — **still no wiki methods**. ### What exists - **Forgejo Wiki API is live** on Codeberg with 4 endpoints: - `GET /repos/{owner}/{repo}/wiki/pages` - `GET /repos/{owner}/{repo}/wiki/page/{pageName}` - `GET /repos/{owner}/{repo}/wiki/revisions/{pageName}` - `POST /repos/{owner}/{repo}/wiki/new` - `PATCH/DELETE` on `/wiki/page/{pageName}` ### What's missing - **forgejo-sdk v3.0.0**: No `wiki.go`, no wiki types, no wiki methods — only `HasWiki` bool on repo structs - **forgejo-sdk main branch**: Same — no wiki support has been added ### Summary The API exists and works, but the SDK has no wrapper for it. This is the same blocker pattern as #98 (reply to review comment). An upstream contribution to forgejo-sdk adding wiki methods would unblock both issues. Keeping as blocked until forgejo-sdk adds wiki support.
goern commented 2026-05-31 12:54:09 +00:00 (Migrated from codeberg.org)

Minutes — OpenSpec drafted, blocker reframed

Investigated the block. Root cause: operation/wiki/wiki.go is gated behind //go:build wiki and calls client.ListWikiPages / CreateWikiPage / EditWikiPage + CreateWikiPageOption / EditWikiPageOptionnone of which exist in forgejo-sdk/forgejo/v3 (no wiki*.go, no wiki types). So the package never compiled; the tag exists only to keep make build green. The earlier plan waited on an upstream SDK contribution.

We don't need to wait. pkg/forgejo/rawhttp.go already provides authenticated raw-REST helpers (DoJSON/DoJSONList), added for issue attachments when the SDK fell short. Wiki is the same situation, so the OpenSpec change proposes implementing all wiki ops directly against the Forgejo REST API — no SDK dependency, no external wait.

Drafted OpenSpec change add-wiki-support (PR pending) covering:

  • 6 toolslist_wiki_pages, get_wiki_page, get_wiki_revisions, create_wiki_page, update_wiki_page, delete_wiki_page, all output-bounded per docs/design/output-bounding.md.
  • Resource template forgejo://repo/{owner}/{repo}/wiki/{pageName} so a page can be referenced by URI (auto-resolved by resource-aware clients, no tool call).
  • Discovery — README tool + resource tables, AGENTS.md, rich descriptions.
  • Showboat demo — full end-to-end walkthrough.

One load-bearing detail to verify live before merge: the content_base64 encoding and page-name URL rule (captured as an explicit task).

Keeping Status/Blocked until the implementation lands and the live API check passes; the blocker is now "implement the spec", not "wait on upstream SDK".

## Minutes — OpenSpec drafted, blocker reframed Investigated the block. Root cause: `operation/wiki/wiki.go` is gated behind `//go:build wiki` and calls `client.ListWikiPages` / `CreateWikiPage` / `EditWikiPage` + `CreateWikiPageOption` / `EditWikiPageOption` — **none of which exist in `forgejo-sdk/forgejo/v3`** (no `wiki*.go`, no wiki types). So the package never compiled; the tag exists only to keep `make build` green. The earlier plan waited on an upstream SDK contribution. **We don't need to wait.** `pkg/forgejo/rawhttp.go` already provides authenticated raw-REST helpers (`DoJSON`/`DoJSONList`), added for issue attachments when the SDK fell short. Wiki is the same situation, so the OpenSpec change proposes implementing all wiki ops directly against the Forgejo REST API — no SDK dependency, no external wait. Drafted OpenSpec change `add-wiki-support` (PR pending) covering: - **6 tools** — `list_wiki_pages`, `get_wiki_page`, `get_wiki_revisions`, `create_wiki_page`, `update_wiki_page`, `delete_wiki_page`, all output-bounded per `docs/design/output-bounding.md`. - **Resource template** `forgejo://repo/{owner}/{repo}/wiki/{pageName}` so a page can be referenced by URI (auto-resolved by resource-aware clients, no tool call). - **Discovery** — README tool + resource tables, `AGENTS.md`, rich descriptions. - **Showboat demo** — full end-to-end walkthrough. One load-bearing detail to verify live before merge: the `content_base64` encoding and page-name URL rule (captured as an explicit task). Keeping `Status/Blocked` until the implementation lands and the live API check passes; the blocker is now "implement the spec", not "wait on upstream SDK".
woozar commented 2026-07-18 22:06:38 +00:00 (Migrated from codeberg.org)

Wiki support is implemented and proposed in PR #379: https://codeberg.org/goern/forgejo-mcp/pulls/379. The change adds six output-bounded wiki tools plus the forgejo://repo/{owner}/{repo}/wiki/{pageName} resource, with live Forgejo verification and a captured end-to-end demo.

Wiki support is implemented and proposed in PR #379: https://codeberg.org/goern/forgejo-mcp/pulls/379. The change adds six output-bounded wiki tools plus the `forgejo://repo/{owner}/{repo}/wiki/{pageName}` resource, with live Forgejo verification and a captured end-to-end demo.
woozar commented 2026-07-19 22:11:40 +00:00 (Migrated from codeberg.org)

some rule seems to forbid merging main into the feature branch, before merging the feature branch to main. As i have very limited time at the moment, I cannot spend more time, trying to figure things out. Please can someone take care of the merge?

some rule seems to forbid merging main into the feature branch, before merging the feature branch to main. As i have very limited time at the moment, I cannot spend more time, trying to figure things out. Please can someone take care of the merge?
Sign in to join this conversation.
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#32
No description provided.