Commit Graph

71 Commits

Author SHA1 Message Date
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
hiifong
f377f06478 fix typo 2025-04-06 14:47:37 +00:00
appleboy
02fd91da86 build: switch Docker images to Debian and optimize build process (#19)
- Switch base image from `golang:1.24-alpine` to `golang:1.24-bullseye` for the build stage
- Update working directory from `/build` to `/app`
- Separate the copying of go.mod and go.sum files before downloading dependencies
- Add comments for build stages and process steps
- Switch final stage base image from `ubuntu:24.04` to `debian:bullseye-slim`
- Improve installation of ca-certificates and clean up the apt lists afterward
- Create and switch to a non-root user named `gitea-mcp`
- Change the file copy command to `--chown=1000:1000 /app/gitea-mcp`
- Update `CMD` to use an absolute path `/app/gitea-mcp`

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/19
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-04-06 14:45:30 +00:00
appleboy
55f32ef4f5 docs: localize README with Chinese translations (#18)
- Add links to traditional and simplified Chinese versions of the README.
- Add README in Simplified Chinese with installation, usage, and troubleshooting instructions.
- Add README in Traditional Chinese with installation, usage, and troubleshooting instructions.

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

Co-authored-by: hiifong <i@hiif.ong>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/18
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-04-06 14:07:17 +00:00
appleboy
c9cada1a8d docs: improve build system with enhanced targets and descriptions (#17)
- Add a `help` target to print a help message.
- Add descriptions for the `build`, `air`, `dev`, and `vendor` targets.
- Remove inline comments for the `air`, `dev`, and `vendor` targets.

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/17
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-04-06 14:06:53 +00:00
hiifong
a784029828 Update Dockerfile v0.1.6 2025-04-06 15:30:28 +08:00
hiifong
f27c4c622d Update Dockerfile 2025-04-06 15:28:05 +08:00
hiifong
df47a0c9eb Add Dockerfile v0.1.5 2025-04-06 13:09:14 +08:00
hiifong
e3307adbdf Add Dockerfile (#16)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/16
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
v0.1.4
2025-04-06 04:54:56 +00:00
hiifong
afada4435e Add Dockerfile (#15)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/15
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-06 04:46:27 +00:00
hiifong
6285bd2467 test (#14)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/14
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-06 04:12:06 +00:00
hiifong
5bbf8e0afb Add Dockerfile (#13)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/13
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-06 04:06:34 +00:00
appleboy
0535f5bab7 docs: improve documentation with new sections and better readability (#12)
- Add a "What is Gitea?" section explaining Gitea
- Add a "What is MCP?" section describing Model Context Protocol
- Reformat the MCP server configuration instructions for better readability
- Correct the markdown table for tool support
- Add a Troubleshooting section with common steps to resolve issues

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

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/12
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-04-05 05:06:34 +00:00
hiifong
d892b05048 Support custom sse port (#11)
fix: #10
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/11
v0.1.3
2025-04-01 08:07:47 +00:00
hiifong
592cf51c9b fix bug (#9)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/9
v0.1.2
2025-03-28 03:10:29 +00:00
hiifong
2a9504fc5d update (#8)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/8
v0.1.1
2025-03-27 07:31:39 +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
Lunny Xiao
97b98c3fc2 Merge pull request 'Add SHA to update file, convert get_file into get_file_content' (#5) from yp05327/gitea-mcp:add-sha-to-update-file into main
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/5
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-03-25 04:30:18 +00:00
hiifong
58328680a6 Merge branch 'main' into add-sha-to-update-file 2025-03-25 04:29:07 +00:00
Lunny Xiao
28947a030e Merge pull request 'Update README' (#4) from yp05327/gitea-mcp:update-readme into main
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/4
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-03-25 04:28:34 +00:00
yp05327
d48e233fba update readme 2025-03-25 04:26:47 +00:00
yp05327
0e225f21da fix 2025-03-25 04:25:28 +00:00
yp05327
b9e575ad64 fix 2025-03-25 03:42:37 +00:00
yp05327
8395957553 update 2025-03-25 03:11:33 +00:00
yp05327
0aa33e0d62 change the emoji 2025-03-25 03:10:06 +00:00
yp05327
7d2a0985a3 change the emoji 2025-03-25 03:09:12 +00:00
yp05327
6f86512a7d update 2025-03-25 02:56:56 +00:00
hiifong
7845a84c4e fix bug (#3)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/3
v0.1.0
2025-03-24 05:23:50 +00:00
Lunny Xiao
4f781f2ddb Fix bug 2025-03-23 21:48:41 -07:00
Lunny Xiao
d6ca289f03 Add arm64 releases 2025-03-23 18:17:12 -07:00
Lunny Xiao
e0d34fe7d1 Add release tag ci 2025-03-23 14:52:35 -07:00
Lunny Xiao
09e0275952 Add vul check 2025-03-23 12:25:48 -07:00
Lunny Xiao
721889e586 Add ci for pull request 2025-03-23 12:16:05 -07:00
hiifong
f4bbd5a09a Update 2025-03-23 21:32:53 +08:00
hiifong
065f65ad2a Update 2025-03-23 15:24:49 +08:00
hiifong
4917cb1328 Update 2025-03-23 14:59:10 +08:00
hiifong
24310675ba Update 2025-03-23 14:53:15 +08:00
hiifong
c99f1306e3 Add k8s ptr 2025-03-23 14:53:03 +08:00
hiifong
10ebaa1964 Update go.mod 2025-03-23 14:52:47 +08:00
techknowlogick
f2b1bfdc7f fix typo 2025-03-21 06:57:35 +00:00
hiifong
479991ef9a set debug flag default value 2025-03-20 23:12:37 +08:00
hiifong
3def51ffd1 Update README.md 2025-03-20 23:03:43 +08:00