Commit Graph

113 Commits

Author SHA1 Message Date
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>
v0.3.1
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
appleboy
4c3f5149d8 feat: set custom user agent for Gitea client using server version (#74)
- Import the fmt package to enable string formatting
- Set a custom user agent for the Gitea client using the current server version

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/74
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-07-27 10:31:48 +00:00
appleboy
eb6b5a8f92 chore: upgrade Go dependencies to latest stable versions (#73)
- Bump github.com/mark3labs/mcp-go dependency to v0.35.0
- Update github.com/spf13/cast to v1.9.2
- Upgrade golang.org/x/crypto to v0.40.0
- Upgrade golang.org/x/sys to v0.34.0

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/73
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-07-27 06:23:38 +00:00
hiifong
1d9bdb5b44 fix bug 2025-07-21 09:04:37 +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
Alex Kirhenshtein
b85a523983 Bump go-mcp version to 0.32.0 to mitigate Claude desktop connectivity issue (#63)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/63
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Alex Kirhenshtein <alk@netxms.org>
Co-committed-by: Alex Kirhenshtein <alk@netxms.org>
2025-06-21 03:34:17 +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>
v0.3.0
2025-06-15 19:44:28 +08:00
Bo-Yi Wu
44ea8969f4 refactor: migrate environment config from GITEA_MODE to MCP_MODE (#62)
- Remove the GITEA_MODE environment variable from the Dockerfile
- Switch environment variable usage from GITEA_MODE to MCP_MODE in the Go command initialization

fix https://gitea.com/gitea/gitea-mcp/issues/55

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/62
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-06-15 11:40:59 +00:00
Bo-Yi Wu
94aa8dc572 fix: harden log directory creation and path resolution (#61)
- Ensure the log directory is created with secure permissions, falling back to the temp directory if creation fails
- Update log file path to use the resolved log directory

fix https://gitea.com/gitea/gitea-mcp/issues/58

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/61
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-06-13 19:30:14 +00:00
appleboy
05194ffc1c chore: add live reload config and update editor and git settings (#57)
- Add .air.toml configuration file for Air live reloading with specific build and file watch settings
- Ignore the tmp directory in .gitignore
- Rename the gitea server configuration to gitea-mcp-stdio in the VSCode config and add separate configuration for gitea-mcp-http

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/57
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-06-08 03:55:10 +00:00
appleboy
5c329129f8 docs: standardize server configuration naming in documentation (#56)
- Rename the example "github" server configuration to "gitea-mcp" in all README files

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/56
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-06-08 02:51:32 +00: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
f14b60fe56 build: update base image to distroless/static-debian12:nonroot (#52)
- Update base image from distroless/static-debian11:nonroot to distroless/static-debian12:nonroot

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/52
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-30 07:47:50 +00:00
appleboy
94782a85b6 build: streamline container configuration and metadata (#51)
- Remove the container healthcheck definition
- Delete the image authors label from the build

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/51
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-30 06:47:28 +00:00
appleboy
e94dd26b30 build: refactor Dockerfile for security, performance, and flexibility (#50)
- Switch build base image to Alpine and set platform dynamically
- Use distroless nonroot image for final stage to enhance security
- Add build arguments for VERSION, TARGETOS, and TARGETARCH with defaults
- Cache Go module and build dependencies to improve build performance
- Remove manual installation of ca-certificates and user creation (handled by base image)
- Set nonroot user for running the application
- Add healthcheck for the built binary
- Add OCI-compliant author and version labels

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/50
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-30 04:58:24 +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
appleboy
3f61299f72 refactor: refactor HTTP client setup to enhance configuration flexibility (#47)
- Refactor HTTP client initialization to always create a custom http.Client
- Move TLS config modification into the default HTTP client when insecure flag is set
- Ensure the HTTP client is always included in client options

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/47
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-05-27 12:52:19 +00:00
appleboy
5308fbfb2b docs: add Table of Contents to all README translations (#46)
- Add a Table of Contents section to the README files in English, Simplified Chinese, and Traditional Chinese for improved navigation.

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/46
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
v0.2.0
2025-05-27 12:32:27 +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
417ef26da0 build: add VS Code server config and enable versioning of settings (#43)
- Remove .vscode directory from .gitignore to allow versioning of VS Code settings
- Add a VS Code server configuration file with prompts for Gitea host, access token, and insecure connection option
- Configure a stdio-based server launch for gitea-mcp with relevant environment variables

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/43
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-05-27 04:15:22 +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
Bo-Yi Wu
796fd4682d docs: document get_user_orgs tool in Chinese guides (#41)
- Add get_user_orgs tool to the list of supported tools in both Simplified and Traditional Chinese documentation

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/41
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-05-26 06:01:59 +00:00
hiifong
95c036bf3a docker sse (#37)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/37
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
v0.1.9
2025-04-20 09:14:14 +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
26c50d53bd Add gitlens to vscode extentions (#31)
Co-authored-by: hiifong <i@hiif.ong>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/31
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2025-04-11 11:54:12 +00:00
hiifong
7bfc596a58 fix debug mode default value (#29)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/29
2025-04-11 10:01:59 +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
hiifong
af27b685d4 feat: Add debug (#28)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/28
Reviewed-by: yp05327 <576951401@qq.com>
Co-authored-by: hiifong <i@hiif.ong>
Co-committed-by: hiifong <i@hiif.ong>
2025-04-11 06:48:01 +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
001383142f fix typo v0.1.8 2025-04-08 14:01:14 +00:00
appleboy
b35919989f ci: update CI environment variables for better token management
- Replace `GITHUB_TOKEN` with `GITEA_TOKEN` and add `GORELEASER_FORCE_TOKEN` environment variable

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-04-08 21:41:04 +08:00
appleboy
d0225c4c24 build: enhance build process and release configuration
- Add build flags and ldflags for Go builds
- Add Gitea URLs and force token configuration for release

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-04-08 21:39:21 +08:00
appleboy
6993bb2b5d ci: integrate GoReleaser for streamlined release management
- Rename job from `release` to `goreleaser` in `release-tag.yml`
- Change the tag pattern from `' * '` to `" * "` in `release-tag.yml`
- Update job steps to better describe their actions in `release-tag.yml`
- Replace build steps with GoReleaser action steps in `release-tag.yml`
- Add configuration file `.goreleaser.yaml` for GoReleaser
- Include hooks, builds, archives, changelog sorting, and release footer in `.goreleaser.yaml`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-04-08 21:34:03 +08:00
Flynn Hou
f1b4a208a7 fix(cmd): ensure GITEA_HOST can be read (#23)
## Why

With the following configuration:

```bash
docker run -i --rm -e GITEA_HOST=<gitea_host> -e GITEA_ACCESS_TOKEN=<gitea_access_token_for_host> docker.gitea.com/gitea-mcp-server:latest
```

after mcp-client calling a tool, the gitea client will encounter the following fatal error:

```
FATAL gitea/gitea.go:47 create gitea client err: user does not exist [uid: 0, name: ]
  gitea.com/gitea/gitea-mcp/pkg/gitea.Client.func1
    /app/pkg/gitea/gitea.go:47
  sync.(*Once).doSlow
    /usr/local/go/src/sync/once.go:78
  sync.(*Once).Do
    /usr/local/go/src/sync/once.go:69
  gitea.com/gitea/gitea-mcp/pkg/gitea.Client
    /app/pkg/gitea/gitea.go:21
  gitea.com/gitea/gitea-mcp/operation/search.SearchReposFn
    /app/operation/search/search.go:161
  github.com/mark3labs/mcp-go/server.(*MCPServer).handleToolCall
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/server.go:717
  github.com/mark3labs/mcp-go/server.(*MCPServer).HandleMessage
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/request_handler.go:264
  github.com/mark3labs/mcp-go/server.(*StdioServer).processMessage
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/stdio.go:228
  github.com/mark3labs/mcp-go/server.(*StdioServer).processInputStream
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/stdio.go:143
  github.com/mark3labs/mcp-go/server.(*StdioServer).Listen
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/stdio.go:209
  github.com/mark3labs/mcp-go/server.ServeStdio
    /go/pkg/mod/github.com/mark3labs/mcp-go@v0.18.0/server/stdio.go:282
  gitea.com/gitea/gitea-mcp/operation.Run
    /app/operation/operation.go:48
  gitea.com/gitea/gitea-mcp/cmd.Execute
    /app/cmd/cmd.go:119
  main.main
    /app/main.go:12
  runtime.main
    /usr/local/go/src/runtime/proc.go:283
```

Turns out the root cause was because the `GITEA_HOST` environment variable wasn't overriding the default flag value, resulting in mismatch of host and access token.

The if statement won't be entered
7cfa1fa218/cmd/cmd.go (L74-L77)

Due to `host` could never be evaluated as an empty string from the default value `"http://gitea.com"`
7cfa1fa218/cmd/cmd.go (L35-L40)

Unless user specify `gitea-mcp ... --host <empty_string> ...` with environment `GITEA_HOST=<non_empty_string>` at the same time, which is very unlikely IMHO.

## How

- Set `host` flag default value from `GITEA_HOST` environment variable value
- Remove possible dead code if-statement

Co-authored-by: hiifong <i@hiif.ong>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/23
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: Flynn Hou <flynnhou7@gmail.com>
Co-committed-by: Flynn Hou <flynnhou7@gmail.com>
2025-04-08 13:08:50 +00:00
appleboy
d76f02a234 chore: refactor Docker configuration and update exclusion rules
- Add a `.dockerignore` file for Docker configuration
- Ignore git-related files and directories
- Exclude Dockerfile and `.dockerignore`
- Ignore build artifacts including binaries and shared libraries
- Add rules for Go-specific files and directories
- Exclude testing-related files and folders
- Ignore files from IDEs and editors
- Exclude OS-specific and temporary files
- Ignore documentation files and directories
- Add development tools configuration files
- Exclude debug files and directories

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-04-08 21:06:52 +08:00
appleboy
b2bde61882 chore: improve code quality and streamline configuration files
- Compact the features object in the devcontainer configuration

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-04-08 20:36:27 +08:00
Flynn Hou
7cfa1fa218 docs(readme): rename interactive with insecure (#22)
After https://gitea.com/gitea/gitea-mcp/pulls/20, `GITEA_INSECURE` flag is introduced. However, the READMEs referred to the wrong name.

Replace GITEA_INTERACTIVE terms with `GITEA_INSECURE`.

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/22
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: Flynn Hou <flynnhou7@gmail.com>
Co-committed-by: Flynn Hou <flynnhou7@gmail.com>
2025-04-08 05:20:16 +00:00
Bo-Yi Wu
1fecc1df30 build: standardize build and installation process in documentation and Makefile (#21)
- Add install, uninstall, and clean targets to the Makefile
- Change README instructions from `make build` to `make install`
- Update README.zh-cn instructions from `make build` to `make install`
- Update README.zh-tw instructions from `make build` to `make install`

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/21
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-04-08 01:33:33 +00:00
Bo-Yi Wu
8dc9ed9299 feat: add support for insecure mode in Gitea client configuration (#20)
- Add `GITEA_INTERACTIVE` configuration example in README files
- Add `insecure` flag to ignore TLS certificate errors in `cmd.go`
- Set insecure mode based on `GITEA_INSECURE` environment variable in `cmd.go`
- Add `Insecure` boolean variable in `pkg/flag/flag.go`
- Import `crypto/tls` and `net/http` in `pkg/gitea/gitea.go`
- Modify Gitea client creation to support insecure HTTP client in `pkg/gitea/gitea.go`

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/20
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
v0.1.7
2025-04-08 01:16:37 +00:00
hiifong
1965c9830b fix bug 2025-04-06 14:59:06 +00:00