feat: initial scaffold with /healthz

Go module gitea.d-ma.be/mathias/gitea-mcp, minimal HTTP server with a
/healthz probe, Taskfile build targets, and .gitignore/README updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-05-04 20:13:41 +02:00
parent 1eabd5982f
commit a77fa7506b
5 changed files with 47 additions and 1 deletions

2
.gitignore vendored
View File

@@ -25,3 +25,5 @@ go.work.sum
# env file # env file
.env .env
bin/

View File

@@ -1,3 +1,4 @@
# gitea-mcp # gitea-mcp
Custom MCP front door for Gitea — claude.ai connector + Streamable HTTP 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`.

16
Taskfile.yml Normal file
View File

@@ -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 ./...]

24
cmd/gitea-mcp/main.go Normal file
View File

@@ -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)
}
}

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module gitea.d-ma.be/mathias/gitea-mcp
go 1.26.2