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:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,3 +25,5 @@ go.work.sum
|
|||||||
# env file
|
# env file
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
bin/
|
||||||
|
|
||||||
|
|||||||
@@ -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
16
Taskfile.yml
Normal 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
24
cmd/gitea-mcp/main.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user