Support custom sse port (#11)

fix: #10
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/11
This commit is contained in:
hiifong
2025-04-01 08:07:47 +00:00
parent 592cf51c9b
commit d892b05048
4 changed files with 13 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ import (
var (
transport string
host string
port int
token string
debug bool
@@ -37,6 +38,12 @@ func init() {
"https://gitea.com",
"Gitea host",
)
flag.IntVar(
&port,
"port",
8080,
"sse port",
)
flag.StringVar(
&token,
"token",
@@ -66,6 +73,8 @@ func init() {
flagPkg.Host = "https://gitea.com"
}
flagPkg.Port = port
flagPkg.Token = token
if flagPkg.Token == "" {
flagPkg.Token = os.Getenv("GITEA_ACCESS_TOKEN")