37 Commits

Author SHA1 Message Date
appleboy
ba07925969 refactor: refactor MCP tool registration and pagination handling (#86)
- Add documentation for MCP tool constants and tool registration
- Use configurable default values for pagination arguments in user organization queries
- Introduce registerTools helper to streamline MCP tool registration
- Refactor pagination argument parsing into a reusable getIntArg function
- Add descriptive logging for tool handler execution
- Improve code organization for defining and registering MCP tools

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/86
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-08-23 04:31: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
meestark
feaedaf604 fix: pass body through in create_release (#82)
### What
Ensure `create_release` accepts and forwards a `body` so release notes are created as provided.

### Why
Previously, the `body` parameter wasn’t threaded through, resulting in empty release notes even when a body was supplied.

### How
- Add `body` parameter to the function signature
- Thread `body` through handler/service to the API call
- Light refactor for clarity; no breaking changes

### Testing
- Manual: created a release with a non-empty body and confirmed it appears in the UI and in the releases API response

### Links
Fixes gitea/gitea-mcp#81

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/82
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: meestark <meestark@meestark.net>
Co-committed-by: meestark <meestark@meestark.net>
2025-08-11 01:07:52 +00:00
yp05327
a601d6b698 Remove last empty line in GetFileContentFn (#80)
Normally, each file should be end with a blank line, but git does not consider it as a new line, so we should not return it to llm, or it may generate wrong information when editing the existing file.

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/80
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-08-07 02:18:01 +00:00
Lunny Xiao
62cb6e7830 Use no session id (#75)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/75
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-07-30 01:01:55 +00:00
yp05327
9fff996294 Add withLines option to get_file_content (#76)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/76
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-07-29 18:29:29 +00:00
Bo-Yi Wu
093cddbcb6 feat: configure HTTP server heartbeat interval to 30 seconds
- Import the time package to support time-based configuration
- Set the HTTP server's heartbeat interval to 30 seconds using a new option in its initialization

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-07-18 10:12:26 +08:00
appleboy
5dbfe21127 refactor: refactor logging and server setup for clarity and structure (#64)
- Refactor server initialization calls in Run to use multiline construction style and explicitly pass options in HTTP mode
- Fix logic in Default to prevent redundant logger initialization
- Remove unused Logger function and introduce a Logger struct with Infof and Errorf methods for structured logging
- Add a New function for creating instances of the Logger struct

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/64
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-06-22 10:27:09 +00:00
appleboy
da08718e24 style: refactor code formatting for clarity and conciseness
- Remove extra blank lines for cleaner code formatting
- Combine variable declaration of GetGiteaMCPServerVersionTool into a single line for clarity

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-06-15 19:44:28 +08:00
natchanonnn
52ccf92761 Add edit issue comment and list issue comments tools (#48)
- Add tools:
  - `edit_issue_comment` for edit issue comments
  - `get_issue_comments_by_index` for getting issue's comment by its index

Co-authored-by: hiifong <i@hiif.ong>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/48
Co-authored-by: natchanonnn <natchanon.w@loolootech.com>
Co-committed-by: natchanonnn <natchanon.w@loolootech.com>
2025-06-03 10:24:50 +00:00
ZRE
061ea86b0b feat: add GetDirContent tool for retrieving directory entries (#53)
### 🚀 What's Changed
This PR introduces a new MCP tool `get_dir_content` that allows users to retrieve a list of entries (files and subdirectories) from a specified directory in a Gitea repository.

###  Features Added
- **New Tool**: `GetDirContent` tool for directory listing functionality
- **Tool Registration**: Properly registered as a read operation in the MCP server
- **Parameter Validation**: Comprehensive input validation for required parameters
- **Error Handling**: Robust error handling with descriptive error messages

### 🔧 Technical Details
- **Tool Name**: `get_dir_content`
- **Required Parameters**:
  - `owner`: Repository owner
  - `repo`: Repository name
  - `ref`: Branch, tag, or commit reference
  - `filePath`: Directory path to list

### 📁 Files Modified
- file.go: Added tool definition, registration, and handler function

### 🎯 Use Cases
This tool enables users to:
- Browse repository directory structures
- List files and folders in specific directories
- Navigate repository contents programmatically
- Support file management workflows in MCP clients

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/53
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ZRE <chy853@gmail.com>
Co-committed-by: ZRE <chy853@gmail.com>
2025-05-31 19:37:11 +00:00
appleboy
da49bdeb96 feat: integrate server recovery middleware into MCP server initialization (#49)
- Add server recovery middleware to the MCP server initialization

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/49
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-30 04:21:12 +00:00
Hubert Wawrzyńczyk
a7061f9b64 fix: make API bool parameters in search_repos and list_releases optional (#40) (#44)
Fix #40

Left the `mcp.DefaultBool(false)` for `is_draft` and `is_pre_release` in `list_releases`, because I guess they are default, but it's up to the client whether to set them or not.
11e04b5b8d/operation/repo/release.go (L67-L68)

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/44
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Hubert Wawrzyńczyk <hubert@fit-it.pl>
Co-committed-by: Hubert Wawrzyńczyk <hubert@fit-it.pl>
2025-05-27 12:20:47 +00:00
appleboy
f25cc0de8c feat: add HTTP server mode with updated docs and localization (#45)
- Update download instructions for clarity and consistency in all README files
- Add example configuration for HTTP mode to all README files
- Expand transport type support to include "http" in command-line flags and documentation
- Implement HTTP server mode in the application entrypoint
- Update log output behavior to include "http" mode alongside "sse" for stdout logging
- Refine Chinese README translations for greater accuracy and localization

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/45
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-27 12:17:37 +00:00
Bo-Yi Wu
34ca5d45db refactor(args): request argument access and update dependencies (#42)
- Update dependencies to newer versions in go.mod
- Refactor all request argument accesses to use req.GetArguments() instead of direct access to req.Params.Arguments
- Change variable declaration for ListRepoCommitsTool from a grouped var block to a single var statement for consistency

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/42
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-05-26 06:10:10 +00:00
hiifong
70b9ac5b80 Support read only mode (#36)
Fix: #35
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/36
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-20 09:09:29 +00:00
techknowlogick
59e699aac7 Add get_user_orgs tool (#34)
Fix #33

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/34
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-committed-by: techknowlogick <techknowlogick@gitea.com>
2025-04-18 01:30:44 +00:00
yp05327
966d617670 Add EditIssue (#30)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/30
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-04-11 10:01:41 +00:00
yp05327
fac6e1d8d1 Include error info in some functions (#27)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/27
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-04-11 06:06:16 +00:00
yp05327
f656c92cda Encode content to base64 in UpdateFileFn (#26)
Same to CreateFileFn

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/26
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-04-11 05:03:36 +00:00
yp05327
af0975d93f Add release and tags related funcions (#25)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/25
Reviewed-by: hiifong Mr <i@hiif.ong>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-04-10 08:22:09 +00:00
hiifong
d892b05048 Support custom sse port (#11)
fix: #10
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/11
2025-04-01 08:07:47 +00:00
hiifong
592cf51c9b fix bug (#9)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/9
2025-03-28 03:10:29 +00:00
hiifong
2f17f37053 fix bug (#7)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/7
2025-03-27 07:18:51 +00:00
hiifong
5270d2eb08 Adding more logs (#6)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/6
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: hiifong <i@hiif.ong>
Co-committed-by: hiifong <i@hiif.ong>
2025-03-25 17:22:39 +00:00
yp05327
0e225f21da fix 2025-03-25 04:25:28 +00:00
yp05327
b9e575ad64 fix 2025-03-25 03:42:37 +00:00
hiifong
f4bbd5a09a Update 2025-03-23 21:32:53 +08:00
hiifong
065f65ad2a Update 2025-03-23 15:24:49 +08:00
hiifong
24310675ba Update 2025-03-23 14:53:15 +08:00
hiifong
72d9b5a8dd Add debug mode and upgrade mcp-go to v0.14.1 2025-03-20 23:01:05 +08:00
yp05327
18cb96fc80 add some new tools and adjust format 2025-03-20 08:54:38 +00:00
hiifong
4978621b9b Update 2025-03-19 11:46:20 +08:00
hiifong
bd43811a07 Update 2025-03-19 00:12:03 +08:00
hiifong
59693ffc5d feat: add get issue by index 2025-03-16 16:33:15 +08:00
hiifong
82b02fa9f1 feat: add server version 2025-03-16 15:22:57 +08:00
hiifong
2dd4aa94ad Initialize commit 2025-03-16 00:21:29 +08:00