Adds the gitea skill to kyberforge — a dispatch skill for managing Defame1297/holocron via Gitea MCP from within Claude Code. Covers issues, PRs, milestones, labels, branches, and status. Owner/repo derived from git remote at runtime; no config required. Also adds research docs (api-reference, data-model, examples, overview, troubleshooting) and token-access reference used during authoring and available for runtime scope lookups. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
5.0 KiB
topic, source_keys
| topic | source_keys | ||
|---|---|---|---|
| troubleshooting |
|
Gitea MCP — Troubleshooting
Known gotchas, source-level bugs, and error patterns for skill authors.
Source-level typo: review_scomments
The pull_request_read method: "get" response includes a field called review_scomments (not review_comments). This is a misspelling in the slim.go source code of gitea-mcp v1.3.0. Do not expect review_comments to be present — the field is review_scomments. This is the count of inline review comments.
Label ID vs name confusion
issue_write (methods: add_labels, replace_labels) takes labels as an array of numbers (IDs). Issue and PR read responses return labels as an array of name strings. These are never interchangeable.
If you pass name strings to labels, the call will either fail validation or silently apply no labels. Always resolve names to IDs first via label_read method: "list_repo_labels".
Milestone representation inconsistency
The milestone field in responses differs by entity type:
issue_readresponse:milestone: {id: 1, title: "v1.0"}— objectpull_request_readresponse:milestone: "v1.0"— string (title only)
You cannot get a milestone's ID from a PR response. If you need the ID, call milestone_read method: "list" and match by title.
File update requires current SHA
create_or_update_file and delete_file both require the file's current content SHA. Without it:
- Updating: Gitea treats the call as a create. If the file exists, returns HTTP 409 (Conflict).
- Deleting: returns HTTP 422 (Unprocessable entity) — the SHA is a required field.
Always call get_file_contents first to retrieve the SHA. The SHA is in the sha field of the response (not content.sha — it's top-level).
list_my_repos requires read:user scope
With only write:issue and write:repository scopes, list_my_repos returns an error. Use search_repos with an ownerID filter instead. The ownerID is the numeric user ID — you cannot get it from get_me either (same read:user requirement). If ownerID is unknown, use search_repos with the username in the query.
get_me requires read:user scope
There is no way to discover the current user's identity (login, ID) with write:issue + write:repository scopes only. Hardcode the owner/username in the skill or require it as an input parameter.
Method dispatch: "update" vs "edit" on milestones
milestone_write accepts both "update" and "edit" as method values for updating a milestone — they map to the same operation. Use "update" for consistency with the issue and PR tools.
Draft PR behavior
pull_request_write method: "create" with draft: true implements draft by prepending "WIP:" to the PR title (not via a dedicated Gitea API flag). This means:
- The title returned by the API will have the
"WIP:"prefix - To un-draft, use
"update"and pass the title without the prefix
This differs from GitHub's draft PR mechanism; draft state is not a first-class boolean field.
delete_release takes numeric ID, not tag name
delete_release requires the numeric id from the release object, not the tag_name string. Call list_releases or get_release first to get the numeric ID.
Cross-repo PR head format
For PRs originating from a fork, head must be "fork-owner:branch-name". Using just the branch name will result in Gitea looking for the branch in the base repo and failing with 422.
Pagination is not automatic
List tools return one page at a time. There is no cursor, Link header, or auto-pagination in the MCP layer. When you need complete results (e.g., all labels to build a name→ID map), iterate page: 1, page: 2, etc. until the result count is less than per_page.
HTTP error patterns
The MCP server surfaces HTTP error codes from the Gitea REST API:
| Code | Meaning in this context |
|---|---|
| 401 | Token is invalid, expired, or missing entirely |
| 403 | Token lacks the required scope for this operation |
| 404 | Resource not found — also returned by some endpoints when scope is insufficient |
| 409 | Conflict — file already exists (create without SHA), branch already exists, duplicate PR |
| 422 | Unprocessable entity — missing required field (e.g. SHA on file ops), invalid enum value |
| 500 | Gitea server error — usually transient |
404 can mask a permissions error: some Gitea endpoints return 404 instead of 403 when the token has insufficient scope, to avoid leaking resource existence.
list_issues with milestones filter
The milestones parameter on list_issues accepts milestone names or IDs as an array. Using IDs is more reliable — milestone names are mutable. Always prefer filtering by milestone ID when programmatically filtering.
per_page defaults vary
Not all endpoints share the same default per_page:
- Most tools: 30
list_releases,list_tags: 20list_org_repos: 100
When building result-count-aware logic, do not assume 30 — check the tool's documented default.