diff --git a/.gitignore b/.gitignore index 5b90e79..d72f741 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ go.work.sum # env file .env +bin/ + diff --git a/README.md b/README.md index bff846f..bb010f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # gitea-mcp -Custom MCP front door for Gitea — claude.ai connector + Streamable HTTP \ No newline at end of file +Streamable HTTP MCP service exposing Gitea repo operations to Claude apps. +See `~/dev/AI/infra/docs/superpowers/specs/2026-05-04-gitea-mcp-gitops-workflow-design.md`. diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..b07e391 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,16 @@ +version: '3' + +tasks: + build: + desc: Build the binary + cmds: [go build -o bin/gitea-mcp ./cmd/gitea-mcp] + run: + desc: Run the binary + deps: [build] + cmds: [./bin/gitea-mcp] + test: + desc: Run all tests + cmds: [go test ./... -race -count=1] + lint: + desc: Run golangci-lint + cmds: [golangci-lint run ./...] diff --git a/cmd/gitea-mcp/main.go b/cmd/gitea-mcp/main.go new file mode 100644 index 0000000..4e96112 --- /dev/null +++ b/cmd/gitea-mcp/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "log/slog" + "net/http" + "os" +) + +func main() { + logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + + mux := http.NewServeMux() + mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte("ok")) + }) + + addr := ":8080" + logger.Info("gitea-mcp starting", "addr", addr) + if err := http.ListenAndServe(addr, mux); err != nil { + logger.Error("server stopped", "err", err) + os.Exit(1) + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..16ffd11 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module gitea.d-ma.be/mathias/gitea-mcp + +go 1.26.2