Commit Graph

12 Commits

Author SHA1 Message Date
3c3f23cf19 Support read only mode
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 19s
check-and-test / Run govulncheck (pull_request) Successful in 24s
Fix: #35
2025-04-20 16:52:42 +08:00
7bfc596a58 fix debug mode default value (#29)
All checks were successful
release-nightly / release-image (push) Successful in 2m51s
Reviewed-on: #29
2025-04-11 10:01:59 +00:00
f1b4a208a7 fix(cmd): ensure GITEA_HOST can be read (#23)
Some checks failed
release-nightly / release-image (push) Has been cancelled
release / release-image (push) Has been cancelled
release / release (push) Has been cancelled
## 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: #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
8dc9ed9299 feat: add support for insecure mode in Gitea client configuration (#20)
All checks were successful
release / release (push) Successful in 36s
release-nightly / release-image (push) Successful in 3m12s
release / release-image (push) Successful in 3m14s
- 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: #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>
2025-04-08 01:16:37 +00:00
e3307adbdf Add Dockerfile (#16)
All checks were successful
release-nightly / release-image (push) Successful in 2m54s
release / release-image (push) Successful in 2m56s
release / release (push) Successful in 6m17s
Reviewed-on: #16 Co-authored-by: hiifong <f@ilo.nz> Co-committed-by: hiifong <f@ilo.nz>
2025-04-06 04:54:56 +00:00
d892b05048 Support custom sse port (#11)
All checks were successful
release / release (push) Successful in 33s
fix: #10 Reviewed-on: #11
2025-04-01 08:07:47 +00:00
4f781f2ddb Fix bug 2025-03-23 21:48:41 -07:00
479991ef9a set debug flag default value 2025-03-20 23:12:37 +08:00
72d9b5a8dd Add debug mode and upgrade mcp-go to v0.14.1 2025-03-20 23:01:05 +08:00
c900e6b4c3 feat: add context management and cancellation handling in Execute function
- Import the `context` package - Add context cancellation handling with log message and return in `Execute` function Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-16 14:20:55 +08:00
c52f8649a2 refactor: add hot reloading and improve logging functions
- Add command to install `air` for hot reloading in `Makefile` - Add `dev` command to run the application with hot reload in `Makefile` - Add `vendor` command to tidy and verify module dependencies in `Makefile` - Update log synchronization method to use `log.Default().Sync()` in `cmd/cmd.go` - Change variadic parameter type from `interface{}` to `any` in logging functions - Remove `Sync` function from `pkg/log/log.go` ref: https://github.com/uber-go/zap/issues/880 Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-16 14:18:58 +08:00
2dd4aa94ad Initialize commit 2025-03-16 00:21:29 +08:00