8000 clean up and add readme · github/github-mcp-server@b320e51 · GitHub
[go: up one dir, main page]

Skip to content

Commit b320e51

Browse files
clean up and add readme
1 parent b3781a2 commit b320e51

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ and set it as the GITHUB_PERSONAL_ACCESS_TOKEN environment variable.
122122
- `pull_number`: Pull request number (number, required)
123123

124124
- **get_pull_request_reviews** - Get the reviews on a pull request
125+
125126
- `owner`: Repository owner (string, required)
126127
- `repo`: Repository name (string, required)
127128
- `pull_number`: Pull request number (number, required)
@@ -375,7 +376,7 @@ Run **Preferences: Open User Settings (JSON)**, and create or append to the `mcp
375376
"args": ["stdio"],
376377
"env": {
377378
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:githubpat}"
378-
},
379+
}
379380
}
380381
}
381382
}
@@ -391,6 +392,10 @@ Try something like the following prompt to verify that it works:
391392
I'd like to know more about my GitHub profile.
392393
```
393394
395+
## GitHub Enterprise Server
396+
397+
The flag `--gh-host` and the environment variable `GH_HOST` can be used to set the GitHub Enterprise Server hostname.
398+
394399
## TODO
395400
396401
Testing

cmd/github-mcp-server/main.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"io"
77
stdlog "log"
8-
"net/url"
98
"os"
109
"os/signal"
1110
"syscall"
@@ -110,17 +109,8 @@ func runStdioServer(readOnly bool, logger *log.Logger, logCommands bool, exportT
110109
}
111110

112111
if host != "" {
113-
parsedURL, err := url.Parse(fmt.Sprintf("https://api.%s/", host))
114-
if err != nil {
115-
return fmt.Errorf("failed to parse provided GitHub host URL: %w", err)
116-
}
117-
118-
uploadURL, err := url.Parse(fmt.Sprintf("https://uploads.%s/", host))
119-
if err != nil {
120-
return fmt.Errorf("failed to parse provided GitHub host URL: %w", err)
121-
}
122-
123-
ghClient, err = ghClient.WithEnterpriseURLs(parsedURL.String(), uploadURL.String())
112+
var err error
113+
ghClient, err = ghClient.WithEnterpriseURLs(host, host)
124114
if err != nil {
125115
return fmt.Errorf("failed to create GitHub client with host: %w", err)
126116
}

0 commit comments

Comments
 (0)
0