Add full read/write mode: give the AI complete access to the Gitea environment #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Today AegisGitea-MCP is read-only by design. This issue tracks adding write capability so the AI can not only inspect but also act on the Gitea environment — with the intent of giving it as complete access as possible through MCP tool calls.
Requested change
Expose write tools alongside the existing read-only ones, covering as much of the Gitea surface as practical:
The aim is that the AI can drive a full workflow end-to-end, not just read state.
Design notes / considerations
This deliberately reverses the original read-only posture, so it's worth being explicit about how to do it safely rather than just flipping a flag:
writemode toggle (env var / config) so read-only stays the default and full access is a conscious choice, not the baseline.Acceptance
Verified done — closing
Checked the current
mainagainst all four acceptance criteria. All met:tools/write_tools.py;WRITE_MODE=falseby default; scopewrite:repository; policy enforced viais_write=tool_def.write_operation.audit.log_tool_invocation/log_access_deniedon the hash-chained audit log._verify_user_repository_accessruns before any service-PAT use plus theservice_pat_requires_repository_targetguard (server.py:1210-1237);is_redirect_uri_allowedallowlist enforced on the authorize proxy, callback and DCR registration (server.py:842/888/990). Path-traversal on ref/sha/base/head also fixed (#18).docs/write-mode.md(Threat Model, Default Posture, Risk Tradeoffs).Implemented write tools: create/update_issue (incl. state = close/reopen), issue/PR comments + edit, add/remove/create/update_label, assign_issue, create_pull_request, create/edit_release, create_branch, create_milestone.
Deliberately out of scope (not gaps)
The formal acceptance checklist is fully satisfied. Two items from the broader "complete access" wishlist were intentionally not implemented:
docs/write-mode.mdexplicitly forbids merge / force-push / branch-deletion by design.tools/repository.pyis read-only.If these are wanted later they belong in a dedicated follow-up issue. Minor doc lag:
docs/write-mode.md"Supported Write Tools" lists 6 while 16 are implemented.Closing as all acceptance criteria are met.