Adds a create_label write-mode tool so labels can be created in a repository
through the MCP server (previously there was no way to define labels, which
blocked attaching labels to issues). Follows the full tool checklist:
- arguments.py: CreateLabelArgs (name, hex color, optional description/exclusive),
with extra=forbid and a hex-color pattern.
- gitea_client.py: create_label() POSTing to /repos/{owner}/{repo}/labels with
url-encoded path segments.
- write_tools.py: create_label_tool handler; normalizes the color to a leading
'#', bounds text output, and lets auth/authz errors surface.
- mcp_protocol.py: register create_label (write_operation=True).
- server.py: wire create_label into TOOL_HANDLERS.
- docs/api-reference.md: document create_label.
- tests: success path, color normalization, and invalid-color rejection.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolves the long-standing problem that label tools passed names while Gitea's
API requires numeric label ids.
- gitea_client: add _resolve_label_ids() helper; create_issue and add_labels now
resolve label names to ids (case-insensitive) and raise a clear "Unknown
label(s)" error instead of a generic 500.
- New tools: remove_labels (by name) and update_label (located by current name).
- Register both write tools and document the name-based label contract.
- Tests: resolver mapping + unknown-label error, add_labels id translation,
update_label and remove_labels handlers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds a create_label write-mode tool so labels can be created in a repository through the MCP server (previously there was no way to define labels, which blocked attaching labels to issues). Follows the full tool checklist: - arguments.py: CreateLabelArgs (name, hex color, optional description/exclusive), with extra=forbid and a hex-color pattern. - gitea_client.py: create_label() POSTing to /repos/{owner}/{repo}/labels with url-encoded path segments. - write_tools.py: create_label_tool handler; normalizes the color to a leading '#', bounds text output, and lets auth/authz errors surface. - mcp_protocol.py: register create_label (write_operation=True). - server.py: wire create_label into TOOL_HANDLERS. - docs/api-reference.md: document create_label. - tests: success path, color normalization, and invalid-color rejection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Adds six opt-in write tools (write-mode + policy + per-user permission still enforced; no destructive or admin actions): - create_pull_request (POST /pulls) - create_release / edit_release (POST/PATCH /releases) - create_branch (POST /branches; create only, no deletion) - create_milestone (POST /milestones) - edit_issue_comment (PATCH /issues/comments/{id}) Each: arg schema (extra=forbid, GitRef on branch/ref-like fields), Gitea client method with url-encoded path segments, handler that surfaces auth errors, MCP registration (write_operation=True), server wiring, docs, and success tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>