feat: implement wiki management #11

Open
opened 2026-06-02 06:57:00 +00:00 by a-limasov · 0 comments
Owner

Context

Gitea's built-in wiki provides per-repository documentation. MCP tools for the wiki
let users read and write documentation pages directly from Claude without switching
to a browser, making it useful for maintaining READMEs, runbooks, and API docs.

Endpoints to implement

Method Path Tool name Description
GET /repos/{owner}/{repo}/wiki/pages list_wiki_pages List all wiki pages
POST /repos/{owner}/{repo}/wiki/new create_wiki_page Create a new wiki page
GET /repos/{owner}/{repo}/wiki/page/{page_name} get_wiki_page Get a wiki page content
PATCH /repos/{owner}/{repo}/wiki/page/{page_name} edit_wiki_page Edit a wiki page
DELETE /repos/{owner}/{repo}/wiki/page/{page_name} delete_wiki_page Delete a wiki page
GET /repos/{owner}/{repo}/wiki/revisions/{page_name} list_wiki_revisions List page revision history

Acceptance Criteria

  • create_wiki_page(owner, repo, title, content, message)content is plain Markdown, auto base64-encoded
  • get_wiki_page returns decoded content (not raw base64) for usability
  • edit_wiki_page(owner, repo, page_name, content, message) updates page
  • delete_wiki_page returns {"success": true} on 204
  • list_wiki_revisions returns revision history with author and date
  • page_name in URL is URL-encoded via _b() helper

Technical Notes

  • Wiki content is base64-encoded in the API (same pattern as file contents) — use base64.b64encode
  • POST /wiki/new body: {"title": "Home", "content": "<base64>", "message": "Initial wiki page"}
  • PATCH /wiki/page/{name} body: same structure as create
  • get_wiki_page response includes content as base64 — decode it before returning for better UX
  • page_name uses _ instead of spaces in URLs (Gitea convention)
## Context Gitea's built-in wiki provides per-repository documentation. MCP tools for the wiki let users read and write documentation pages directly from Claude without switching to a browser, making it useful for maintaining READMEs, runbooks, and API docs. ## Endpoints to implement | Method | Path | Tool name | Description | |--------|------|-----------|-------------| | GET | `/repos/{owner}/{repo}/wiki/pages` | `list_wiki_pages` | List all wiki pages | | POST | `/repos/{owner}/{repo}/wiki/new` | `create_wiki_page` | Create a new wiki page | | GET | `/repos/{owner}/{repo}/wiki/page/{page_name}` | `get_wiki_page` | Get a wiki page content | | PATCH | `/repos/{owner}/{repo}/wiki/page/{page_name}` | `edit_wiki_page` | Edit a wiki page | | DELETE | `/repos/{owner}/{repo}/wiki/page/{page_name}` | `delete_wiki_page` | Delete a wiki page | | GET | `/repos/{owner}/{repo}/wiki/revisions/{page_name}` | `list_wiki_revisions` | List page revision history | ## Acceptance Criteria - [ ] `create_wiki_page(owner, repo, title, content, message)` — `content` is plain Markdown, auto base64-encoded - [ ] `get_wiki_page` returns decoded content (not raw base64) for usability - [ ] `edit_wiki_page(owner, repo, page_name, content, message)` updates page - [ ] `delete_wiki_page` returns `{"success": true}` on 204 - [ ] `list_wiki_revisions` returns revision history with author and date - [ ] `page_name` in URL is URL-encoded via `_b()` helper ## Technical Notes - Wiki content is base64-encoded in the API (same pattern as file contents) — use `base64.b64encode` - `POST /wiki/new` body: `{"title": "Home", "content": "<base64>", "message": "Initial wiki page"}` - `PATCH /wiki/page/{name}` body: same structure as create - `get_wiki_page` response includes `content` as base64 — decode it before returning for better UX - `page_name` uses `_` instead of spaces in URLs (Gitea convention)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: a-limasov/gitea-platform-mcp#11