Commit Graph

3 Commits

Author SHA1 Message Date
Daniel
f6b45fdf6e feat(org): add MCP tools for organization-level labels (list/create/edit/delete) (#99) (#102)
This PR adds full support for managing organization-level labels via MCP. It uses the newly added SDK APIs now available on main branch, see https://gitea.com/gitea/go-sdk/issues/732.

Registers following tools under label module and wires them into the MCP server as read/write tools:

- list_org_labels: list labels defined at the organization level (pagination supported)
- create_org_label: create a label in an organization (name, color, description, exclusive)
- edit_org_label: edit an organization label (name, color, description, exclusive)
- delete_org_label: delete an organization label by ID

Dependency note:
go.mod/go.sum updated to use the SDK main branch pseudo-version that includes the org-label APIs.

If you prefer to merge only after a tagged SDK release, I can bump the dependency to the new tag as soon as it’s available.

Thanks for considering!

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/102
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Daniel <danielwichers@gmail.com>
Co-committed-by: Daniel <danielwichers@gmail.com>
2025-10-20 01:43:39 +00:00
Darren Hoo
d7addd56c4 feat: read token from header in http/sse mode (#89)
this PR introduces support for per-request authentication tokens in HTTP and SSE modes. The server now inspects incoming requests for an `Authorization: Bearer <token>` header.

Previously, the server operated with a single, globally configured Gitea token. This change allows different clients to use their own tokens when communicating with the MCP server, enhancing security and flexibility.

To support this, the Gitea API client initialization has been refactored:
- The global singleton Gitea client has been removed.
-  A new `ClientFromContext` function creates a Gitea client on-demand, using a token from the request context if available, and falling back to the globally configured token otherwise.
- All tool functions now retrieve the client from the context for each call.

The README has also been updated to reflect the new configuration option.

Update: #59
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/89
Reviewed-by: hiifong <i@hiif.ong>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Darren Hoo <darren.hoo@gmail.com>
Co-committed-by: Darren Hoo <darren.hoo@gmail.com>
2025-09-12 03:57:57 +00:00
meestark
5c2ff6dcb2 feat: Add support for managing repository and issue labels (#83)
## **What:**
Adds full label management capabilities to the Gitea CLI for both repositories and issues. Users can now create, edit, delete, list, and assign labels without leaving the terminal.

## **Why:**
Labels are a core part of keeping repositories and issues organized. Previously, `gitea-mcp` lacked CLI support for label management, forcing users to rely on the web UI or custom scripts. This update closes that gap, enabling smoother automation and more efficient workflows.

## **How:**
Implemented new `label` subcommands:

* **Repository Labels:**
  * `list_repo_labels` — Lists all labels for a repository.
  * `get_repo_label` — Retrieves a label by ID.
  * `create_repo_label` — Creates a new label.
  * `edit_repo_label` — Updates an existing label.
  * `delete_repo_label` — Removes a label.

* **Issue Labels:**
  * `add_issue_labels` — Adds one or more labels to an issue.
  * `replace_issue_labels` — Replaces all labels on an issue.
  * `clear_issue_labels` — Removes all labels from an issue.
  * `remove_issue_label` — Removes a single label from an issue.

## **Testing:**
User acceptance testing was performed across all new commands, confirming correct behavior for creating, editing, deleting, listing, and applying labels.  Also looped through 20 issues in roo Orchestrator mode and assigned different labels to each without issue.

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/83
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: meestark <meestark@meestark.net>
Co-committed-by: meestark <meestark@meestark.net>
2025-08-11 07:33:07 +00:00