Skip to content

feat: enable go run execution by moving main to root #630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SchulteDev
Copy link

feat: enable go run execution by moving main to root

  • Move main.go to project root to enable go run github.com/github/github-mcp-server@latest
  • Delegate execution to cmd/github-mcp-server package
  • Update build configurations (Dockerfile, .goreleaser.yaml)
  • Fix ldflags paths and import aliases
  • Maintain backwards compatibility with existing cmd structure

@SchulteDev SchulteDev requested a review from a team as a code owner July 3, 2025 08:47
@SchulteDev SchulteDev force-pushed the main branch 2 times, most recently from c62d5da to e23b402 Compare July 4, 2025 12:08
@SamMorrowDrums
Copy link
Collaborator

Thank you for the contribution, historically we considered this a feature as for general usage we want the LD flags set and for end users to use the prebuilt binaries and docker images, while developers have the local code and can run it easily.

Curious what others think but not strongly against this, I just don't think we want people reaching for Go Install as a supported installation method because of the unspecified LD flags etc.

- Move main.go to project root to enable `go run github.com/github/github-mcp-server@latest`
- Delegate execution to cmd/github-mcp-server package
- Update build configurations (Dockerfile, .goreleaser.yaml)
- Fix ldflags paths and import aliases
- Maintain backwards compatibility with existing cmd structure
- Replace all occurrences of `SchulteDev/github_github-mcp-server` with `github/github-mcp-server`
- Update import paths, documentation, and build configurations for new repository location
- Shortened ldflags paths in Dockerfile and .goreleaser.yaml for clarity.
- Updated .gitignore to cover binaries more broadly (`github-mcp-server*`).
@SchulteDev
Copy link
Author

Ok, I see.

As far as I understand the linker flags it's
(a) for optimizing binary size - which is not relevant in case of "go run" usage
(b) having version, commit, date as part of the compiled program - this would be missing in case of "go run" usage. Maybe I can change the defaults in root_command.go?

At least in my opinion it would be a benefit having the "go run" option additionally to Docker/binary artifacts.

@SamMorrowDrums
Copy link
Collaborator

version, commit, date

So mostly commit and version are significant because we have this as part of the API user agent string so if requests keep failing we can understand which version it is and fix it.

We don't mind for development, but for actual usage we want to know at least the commit.

This isn't a hard no though, I think the current usage patterns are entrenched enough that enabling this pathway won't necessarily be a problem but need to check with @toby a d others internally.

@SchulteDev
Copy link
Author

Just an idea: When doing a release using goreleaser, the defaults in root_command.go could be set to the current version/commit/date for the specific release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants