Supporting go install #49

Closed
opened 2025-12-28 18:29:53 +00:00 by simenandre · 3 comments
simenandre commented 2025-12-28 18:29:53 +00:00 (Migrated from codeberg.org)

Hello, thank you for this! It's really nice to be able to organise issues with GitHub with the their MCP server, so getting similar for Codeberg is very nice.

When setting up new projects, we typically use a Makefile or more often, Taskfile. In that file, we try to create a setup task that has idempotent commands to install the required commands. I love to use go install for that, because we can list all the command line utilities along with their version.

All this is to say, it would be nice to be able to install this MCP server with go install (or be able to download a release binary).

Hello, thank you for this! It's really nice to be able to organise issues with GitHub with the their MCP server, so getting similar for Codeberg is very nice. When setting up new projects, we typically use a Makefile or more often, Taskfile. In that file, we try to create a setup task that has idempotent commands to install the required commands. I love to use `go install` for that, because we can list all the command line utilities along with their version. All this is to say, it would be nice to be able to install this MCP server with `go install` (or be able to download a release binary).
goern commented 2025-12-28 19:37:43 +00:00 (Migrated from codeberg.org)

@simenandre hey, thanks for raising this. Do you want to/can you add the go bits needed for this, or shall I have a look at it?

@simenandre hey, thanks for raising this. Do you want to/can you add the go bits needed for this, or shall I have a look at it?
goern commented 2025-12-29 10:43:36 +00:00 (Migrated from codeberg.org)

User Story

As a developer setting up new projects with Makefiles or Taskfiles,
I want to install forgejo-mcp using go install or download pre-built release binaries,
So that I can use idempotent commands to install required CLI utilities with explicit version control.

Acceptance Criteria

  • go install codeberg.org/goern/forgejo-mcp@latest works correctly
  • go install codeberg.org/goern/forgejo-mcp@v0.x.x installs specific versions
  • Pre-built binaries are available for download on release pages
  • Version information is embedded in the binary (forgejo-mcp --version)
  • README documents both installation methods

Implementation Plan

1. Ensure Go Module Compatibility

  • Verify go.mod module path is codeberg.org/goern/forgejo-mcp
  • Ensure main.go is in the repository root (or use appropriate package path)
  • Test go install from source works locally

2. Add Version Information

  • Embed version info using -ldflags at build time
  • Add --version flag to the CLI if not present
  • Use git tags for version identification

3. Set Up CI/CD for Releases

  • Create Woodpecker CI / Codeberg Actions workflow for releases
  • Build binaries for multiple platforms:
    • linux/amd64, linux/arm64
    • darwin/amd64, darwin/arm64
    • windows/amd64
  • Attach binaries to Codeberg releases

4. Documentation

  • Update README with go install instructions
  • Add binary download instructions
  • Include example Taskfile/Makefile snippets for users

This approach gives users two options: go install for those with Go installed, and direct binary downloads for others.

## User Story **As a** developer setting up new projects with Makefiles or Taskfiles, **I want to** install forgejo-mcp using `go install` or download pre-built release binaries, **So that** I can use idempotent commands to install required CLI utilities with explicit version control. ## Acceptance Criteria - [ ] `go install codeberg.org/goern/forgejo-mcp@latest` works correctly - [ ] `go install codeberg.org/goern/forgejo-mcp@v0.x.x` installs specific versions - [ ] Pre-built binaries are available for download on release pages - [ ] Version information is embedded in the binary (`forgejo-mcp --version`) - [ ] README documents both installation methods ## Implementation Plan ### 1. Ensure Go Module Compatibility - Verify `go.mod` module path is `codeberg.org/goern/forgejo-mcp` - Ensure `main.go` is in the repository root (or use appropriate package path) - Test `go install` from source works locally ### 2. Add Version Information - Embed version info using `-ldflags` at build time - Add `--version` flag to the CLI if not present - Use git tags for version identification ### 3. Set Up CI/CD for Releases - Create Woodpecker CI / Codeberg Actions workflow for releases - Build binaries for multiple platforms: - `linux/amd64`, `linux/arm64` - `darwin/amd64`, `darwin/arm64` - `windows/amd64` - Attach binaries to Codeberg releases ### 4. Documentation - Update README with `go install` instructions - Add binary download instructions - Include example Taskfile/Makefile snippets for users --- This approach gives users two options: `go install` for those with Go installed, and direct binary downloads for others.
goern commented 2025-12-29 14:19:46 +00:00 (Migrated from codeberg.org)

Implementation Plan

Root Cause

The current module path forgejo.org/forgejo/forgejo-mcp in go.mod doesn't resolve via Go's module proxy. For go install codeberg.org/goern/forgejo-mcp@latest to work, the module path must match the repository URL.

Solution

Change module path from forgejo.org/forgejo/forgejo-mcp to codeberg.org/goern/forgejo-mcp.

Implementation Steps

  1. Update go.mod - Change module declaration
  2. Update imports in 16 Go files - Replace all import paths
  3. Run go mod tidy - Ensure dependencies resolve
  4. Update README.md - Add go install as primary installation method
  5. Test build - Verify everything compiles

Files to Modify

File Changes
go.mod Module path
main.go 1 import
cmd/cmd.go 3 imports
operation/operation.go 9 imports
operation/issue/issue.go 4 imports
operation/pull/pull.go 4 imports
operation/repo/repo.go 5 imports
operation/repo/branch.go 4 imports
operation/repo/commit.go 4 imports
operation/repo/file.go 4 imports
operation/search/search.go 4 imports
operation/user/user.go 3 imports
operation/version/version.go 3 imports
operation/wiki/wiki.go 4 imports
pkg/forgejo/forgejo.go 2 imports
pkg/log/log.go 1 import
pkg/to/to.go 1 import
README.md Documentation

README Addition

### Install with Go

​```bash
go install codeberg.org/goern/forgejo-mcp@latest
​```

Ensure `$GOPATH/bin` (typically `~/go/bin`) is in your PATH.

Already Complete

  • Version embedding via LDFLAGS in Makefile
  • Pre-built binaries on release pages via CI/CD
  • --version flag support

Risk Assessment

This is a breaking change for anyone importing this module as a library. However, since this is an end-user CLI tool (not a library), impact should be minimal.

## Implementation Plan ### Root Cause The current module path `forgejo.org/forgejo/forgejo-mcp` in `go.mod` doesn't resolve via Go's module proxy. For `go install codeberg.org/goern/forgejo-mcp@latest` to work, the module path must match the repository URL. ### Solution Change module path from `forgejo.org/forgejo/forgejo-mcp` to `codeberg.org/goern/forgejo-mcp`. ### Implementation Steps 1. **Update `go.mod`** - Change module declaration 2. **Update imports in 16 Go files** - Replace all import paths 3. **Run `go mod tidy`** - Ensure dependencies resolve 4. **Update `README.md`** - Add `go install` as primary installation method 5. **Test build** - Verify everything compiles ### Files to Modify | File | Changes | |------|---------| | `go.mod` | Module path | | `main.go` | 1 import | | `cmd/cmd.go` | 3 imports | | `operation/operation.go` | 9 imports | | `operation/issue/issue.go` | 4 imports | | `operation/pull/pull.go` | 4 imports | | `operation/repo/repo.go` | 5 imports | | `operation/repo/branch.go` | 4 imports | | `operation/repo/commit.go` | 4 imports | | `operation/repo/file.go` | 4 imports | | `operation/search/search.go` | 4 imports | | `operation/user/user.go` | 3 imports | | `operation/version/version.go` | 3 imports | | `operation/wiki/wiki.go` | 4 imports | | `pkg/forgejo/forgejo.go` | 2 imports | | `pkg/log/log.go` | 1 import | | `pkg/to/to.go` | 1 import | | `README.md` | Documentation | ### README Addition ```markdown ### Install with Go ​```bash go install codeberg.org/goern/forgejo-mcp@latest ​``` Ensure `$GOPATH/bin` (typically `~/go/bin`) is in your PATH. ``` ### Already Complete - ✅ Version embedding via LDFLAGS in Makefile - ✅ Pre-built binaries on release pages via CI/CD - ✅ `--version` flag support ### Risk Assessment This is a breaking change for anyone importing this module as a library. However, since this is an end-user CLI tool (not a library), impact should be minimal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp#49
No description provided.