{"number":26,"state":"closed","title":"feat: expose ntfy via NPM...","html_url":"..."}
Required token permission
write:issue scope on the Gitea API token.
Risk classification
issue_close: LOW — reversible via issue_reopen. issue_reopen: LOW — reversible.
Implementation notes
Both tools use the same PATCH endpoint with different state values
Consider a single issue_set_state tool with a state enum param instead of two tools — cleaner API, same implementation cost
Follow pattern of issue_get.go for struct and Call() layout
Test cases: close open issue, reopen closed issue, issue not found (404), allowlist rejection
Motivation
Discovered 2026-05-14: after completing infra issue #26 (ntfy via NPM), could not
close it programmatically from claude.ai. Had to leave it open or close manually
in web UI. Agents should be able to close issues as part of task completion flow —
e.g. after merging a PR that resolves an issue.
Related
Pairs with issue_get (#20) — read state before changing it
Part of gitea-mcp v0.3 batch
## Summary
Add `issue_close` and `issue_reopen` tools to allow agents to change issue state programmatically — closing completed issues and reopening them if needed.
## Gitea API
`PATCH /api/v1/repos/{owner}/{repo}/issues/{index}`
Body: `{"state": "closed"}` or `{"state": "open"}`
## Tool spec
```
tool: issue_close
params:
owner: string
name: string // repo name
number: integer // issue number >= 1
tool: issue_reopen
params:
owner: string
name: string
number: integer
```
## Returns
```json
{
"number": 26,
"state": "closed",
"title": "feat: expose ntfy via NPM...",
"html_url": "..."
}
```
## Required token permission
`write:issue` scope on the Gitea API token.
## Risk classification
`issue_close`: **LOW** — reversible via issue_reopen.
`issue_reopen`: **LOW** — reversible.
## Implementation notes
- Both tools use the same PATCH endpoint with different state values
- Consider a single `issue_set_state` tool with a `state` enum param instead of two tools — cleaner API, same implementation cost
- Follow pattern of `issue_get.go` for struct and Call() layout
- Test cases: close open issue, reopen closed issue, issue not found (404), allowlist rejection
## Motivation
Discovered 2026-05-14: after completing infra issue #26 (ntfy via NPM), could not
close it programmatically from claude.ai. Had to leave it open or close manually
in web UI. Agents should be able to close issues as part of task completion flow —
e.g. after merging a PR that resolves an issue.
## Related
- Pairs with `issue_get` (#20) — read state before changing it
- Part of gitea-mcp v0.3 batch
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add
issue_closeandissue_reopentools to allow agents to change issue state programmatically — closing completed issues and reopening them if needed.Gitea API
PATCH /api/v1/repos/{owner}/{repo}/issues/{index}Body:
{"state": "closed"}or{"state": "open"}Tool spec
Returns
Required token permission
write:issuescope on the Gitea API token.Risk classification
issue_close: LOW — reversible via issue_reopen.issue_reopen: LOW — reversible.Implementation notes
issue_set_statetool with astateenum param instead of two tools — cleaner API, same implementation costissue_get.gofor struct and Call() layoutMotivation
Discovered 2026-05-14: after completing infra issue #26 (ntfy via NPM), could not
close it programmatically from claude.ai. Had to leave it open or close manually
in web UI. Agents should be able to close issues as part of task completion flow —
e.g. after merging a PR that resolves an issue.
Related
issue_get(#20) — read state before changing it