Skip to content

Commit cb919d5

Browse files
committed
Merge branch 'main' of ssh://github.com/github/github-mcp-server into juruen/create-issue
2 parents 31e72be + 031dd74 commit cb919d5

File tree

12 files changed

+302
-33
lines changed

12 files changed

+302
-33
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@juruen @sammorrowdrums @williammartin @toby

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Contributing
2+
3+
[fork]: https://github.com/github/github-mcp-server/fork
4+
[pr]: https://github.com/github/github-mcp-server/compare
5+
[style]: https://github.com/github/github-mcp-server/blob/main/.golangci.yaml
6+
7+
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
8+
9+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.txt).
10+
11+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
12+
13+
## Prerequisites for running and testing code
14+
15+
These are one time installations required to be able to test your changes locally as part of the pull request (PR) submission process.
16+
17+
1. install Go [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
18+
1. [install golangci-lint](https://golangci-lint.run/welcome/install/#local-installation)
19+
20+
## Submitting a pull request
21+
22+
1. [Fork][fork] and clone the repository
23+
1. Make sure the tests pass on your machine: `go test -v ./...`
24+
1. Make sure linter passes on your machine: `golangci-lint run`
25+
1. Create a new branch: `git checkout -b my-branch-name`
26+
1. Make your change, add tests, and make sure the tests and linter still pass
27+
1. Push to your fork and [submit a pull request][pr]
28+
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.
29+
30+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
31+
32+
- Follow the [style guide][style].
33+
- Write tests.
34+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
35+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
36+
37+
## Resources
38+
39+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
40+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
41+
- [GitHub Help](https://help.github.com)

README.md

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,59 @@ and set it as the GITHUB_PERSONAL_ACCESS_TOKEN environment variable.
190190
- `state`: Alert state (string, optional)
191191
- `severity`: Alert severity (string, optional)
192192

193+
## Resources
194+
195+
### Repository Content
196+
197+
- **Get Repository Content**
198+
Retrieves the content of a repository at a specific path.
199+
200+
- **Template**: `repo://{owner}/{repo}/contents{/path*}`
201+
- **Parameters**:
202+
- `owner`: Repository owner (string, required)
203+
- `repo`: Repository name (string, required)
204+
- `path`: File or directory path (string, optional)
205+
206+
- **Get Repository Content for a Specific Branch**
207+
Retrieves the content of a repository at a specific path for a given branch.
208+
209+
- **Template**: `repo://{owner}/{repo}/refs/heads/{branch}/contents{/path*}`
210+
- **Parameters**:
211+
- `owner`: Repository owner (string, required)
212+
- `repo`: Repository name (string, required)
213+
- `branch`: Branch name (string, required)
214+
- `path`: File or directory path (string, optional)
215+
216+
- **Get Repository Content for a Specific Commit**
217+
Retrieves the content of a repository at a specific path for a given commit.
218+
219+
- **Template**: `repo://{owner}/{repo}/sha/{sha}/contents{/path*}`
220+
- **Parameters**:
221+
- `owner`: Repository owner (string, required)
222+
- `repo`: Repository name (string, required)
223+
- `sha`: Commit SHA (string, required)
224+
- `path`: File or directory path (string, optional)
225+
226+
- **Get Repository Content for a Specific Tag**
227+
Retrieves the content of a repository at a specific path for a given tag.
228+
229+
- **Template**: `repo://{owner}/{repo}/refs/tags/{tag}/contents{/path*}`
230+
- **Parameters**:
231+
- `owner`: Repository owner (string, required)
232+
- `repo`: Repository name (string, required)
233+
- `tag`: Tag name (string, required)
234+
- `path`: File or directory path (string, optional)
235+
236+
- **Get Repository Content for a Specific Pull Request**
237+
Retrieves the content of a repository at a specific path for a given pull request.
238+
239+
- **Template**: `repo://{owner}/{repo}/refs/pull/{pr_number}/head/contents{/path*}`
240+
- **Parameters**:
241+
- `owner`: Repository owner (string, required)
242+
- `repo`: Repository name (string, required)
243+
- `pr_number`: Pull request number (string, required)
244+
- `path`: File or directory path (string, optional)
245+
193246
## Standard input/output server
194247

195248
```sh
@@ -225,7 +278,7 @@ GitHub MCP Server running on stdio
225278
226279
## Testing on VS Code Insiders
227280
228-
First of all, install `github-mcp-server` with:
281+
First of all, install `github-mcp-server` with:
229282
230283
```bash
231284
go install ./cmd/github-mcp-server
@@ -240,18 +293,16 @@ Go to settings, find the MCP related settings, and set them to:
240293
241294
```json
242295
{
243-
"mcp": {
244-
"inputs": [],
245-
"servers": {
246-
"mcp-github-server": {
247-
"command": "path-to-your/github-mcp-server",
248-
"args": [
249-
"stdio"
250-
],
251-
"env": {}
252-
}
253-
}
296+
"mcp": {
297+
"inputs": [],
298+
"servers": {
299+
"mcp-github-server": {
300+
"command": "path-to-your/github-mcp-server",
301+
"args": ["stdio"],
302+
"env": {}
303+
}
254304
}
305+
}
255306
}
256307
```
257308
@@ -261,10 +312,9 @@ Reload, and you should be good to go.
261312
Try something like the following prompt to verify that it works:
262313
263314
```
264-
I'd like like to know more about my GitHub profile.
315+
I'd like to know more about my GitHub profile.
265316
```
266317
267-
268318
## TODO
269319
270320
Lots of things!

SECURITY.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Thanks for helping make GitHub safe for everyone.
2+
3+
# Security
4+
5+
GitHub takes the security of our software products and services seriously, including all of the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub).
6+
7+
Even though [open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope) and therefore not eligible for bounty rewards, we will ensure that your finding gets passed along to the appropriate maintainers for remediation.
8+
9+
## Reporting Security Issues
10+
11+
If you believe you have found a security vulnerability in any GitHub-owned repository, please report it to us through coordinated disclosure.
12+
13+
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
14+
15+
Instead, please send an email to opensource-security[@]github.com.
16+
17+
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
18+
19+
* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
20+
* Full paths of source file(s) related to the manifestation of the issue
21+
* The location of the affected source code (tag/branch/commit or direct URL)
22+
* Any special configuration required to reproduce the issue
23+
* Step-by-step instructions to reproduce the issue
24+
* Proof-of-concept or exploit code (if possible)
25+
* Impact of the issue, including how an attacker might exploit the issue
26+
27+
This information will help us triage your report more quickly.
28+
29+
## Policy
30+
31+
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)

SUPPORT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Support
2+
3+
## How to file issues and get help
4+
5+
This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
6+
7+
For help or questions about using this project, please open an issue.
8+
9+
- The `github-mcp-server` is under active development and maintained by GitHub staff **AND THE COMMUNITY**. We will do our best to respond to support, feature requests, and community questions in a timely manner.
10+
11+
## GitHub Support Policy
12+
13+
Support for this project is limited to the resources listed above.

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23.7
55
require (
66
github.com/aws/smithy-go v1.22.3
77
github.com/google/go-github/v69 v69.2.0
8-
github.com/mark3labs/mcp-go v0.11.2
8+
github.com/mark3labs/mcp-go v0.14.1
99
github.com/migueleliasweb/go-github-mock v1.1.0
1010
github.com/sirupsen/logrus v1.9.3
1111
github.com/spf13/cobra v1.9.1
@@ -34,10 +34,11 @@ require (
3434
github.com/spf13/cast v1.6.0 // indirect
3535
github.com/spf13/pflag v1.0.6 // indirect
3636
github.com/subosito/gotenv v1.6.0 // indirect
37+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
3738
go.uber.org/atomic v1.9.0 // indirect
3839
go.uber.org/multierr v1.9.0 // indirect
39-
golang.org/x/sys v0.18.0 // indirect
40-
golang.org/x/text v0.19.0 // indirect
40+
golang.org/x/sys v0.28.0 // indirect
41+
golang.org/x/text v0.21.0 // indirect
4142
golang.org/x/time v0.5.0 // indirect
4243
gopkg.in/ini.v1 v1.67.0 // indirect
4344
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
3232
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
3333
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
3434
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
35-
github.com/mark3labs/mcp-go v0.11.2 h1:mCxWFUTrcXOtJIn9t7F8bxAL8rpE/ZZTTnx3PU/VNdA=
36-
github.com/mark3labs/mcp-go v0.11.2/go.mod h1:cjMlBU0cv/cj9kjlgmRhoJ5JREdS7YX83xeIG9Ko/jE=
35+
github.com/mark3labs/mcp-go v0.14.1 h1:NsieyFbuWQaeZSWSHPvJ5TwJdQwu+1jmivAIVljeouY=
36+
github.com/mark3labs/mcp-go v0.14.1/go.mod h1:xBB350hekQsJAK7gJAii8bcEoWemboLm2mRm5/+KBaU=
3737
github.com/migueleliasweb/go-github-mock v1.1.0 h1:GKaOBPsrPGkAKgtfuWY8MclS1xR6MInkx1SexJucMwE=
3838
github.com/migueleliasweb/go-github-mock v1.1.0/go.mod h1:pYe/XlGs4BGMfRY4vmeixVsODHnVDDhJ9zoi0qzSMHc=
3939
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
@@ -77,17 +77,19 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
7777
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7878
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
7979
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
80+
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
81+
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
8082
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
8183
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
8284
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
8385
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
8486
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
8587
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
8688
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
87-
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
88-
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
89-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
90-
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
89+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
90+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
91+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
92+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
9193
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
9294
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
9395
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

pkg/github/issues.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func getIssue(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerF
6060
// addIssueComment creates a tool to add a comment to an issue.
6161
func addIssueComment(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
6262
return mcp.NewTool("add_issue_comment",
63-
mcp.WithDescription("Add a comment to an issue"),
63+
mcp.WithDescription("Add a comment to an existing issue"),
6464
mcp.WithString("owner",
6565
mcp.Required(),
6666
mcp.Description("Repository owner"),
@@ -114,7 +114,7 @@ func addIssueComment(client *github.Client) (tool mcp.Tool, handler server.ToolH
114114
// searchIssues creates a tool to search for issues and pull requests.
115115
func searchIssues(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
116116
return mcp.NewTool("search_issues",
117-
mcp.WithDescription("Search for issues and pull requests"),
117+
mcp.WithDescription("Search for issues and pull requests across GitHub repositories"),
118118
mcp.WithString("q",
119119
mcp.Required(),
120120
mcp.Description("Search query using GitHub issues search syntax"),

pkg/github/repositories.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
// listCommits creates a tool to get commits of a branch in a repository.
1717
func listCommits(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
1818
return mcp.NewTool("list_commits",
19-
mcp.WithDescription("Gets commits of a branch in a repository"),
19+
mcp.WithDescription("Get list of commits of a branch in a GitHub repository"),
2020
mcp.WithString("owner",
2121
mcp.Required(),
2222
mcp.Description("Repository owner"),
@@ -85,7 +85,7 @@ func listCommits(client *github.Client) (tool mcp.Tool, handler server.ToolHandl
8585
// createOrUpdateFile creates a tool to create or update a file in a GitHub repository.
8686
func createOrUpdateFile(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
8787
return mcp.NewTool("create_or_update_file",
88-
mcp.WithDescription("Create or update a single file in a repository"),
88+
mcp.WithDescription("Create or update a single file in a GitHub repository"),
8989
mcp.WithString("owner",
9090
mcp.Required(),
9191
mcp.Description("Repository owner (username or organization)"),
@@ -164,7 +164,7 @@ func createOrUpdateFile(client *github.Client) (tool mcp.Tool, handler server.To
164164
// createRepository creates a tool to create a new GitHub repository.
165165
func createRepository(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
166166
return mcp.NewTool("create_repository",
167-
mcp.WithDescription("Create a new GitHub repository"),
167+
mcp.WithDescription("Create a new GitHub repository in your account"),
168168
mcp.WithString("name",
169169
mcp.Required(),
170170
mcp.Description("Repository name"),
@@ -227,7 +227,7 @@ func createRepository(client *github.Client) (tool mcp.Tool, handler server.Tool
227227
// getFileContents creates a tool to get the contents of a file or directory from a GitHub repository.
228228
func getFileContents(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
229229
return mcp.NewTool("get_file_contents",
230-
mcp.WithDescription("Get contents of a file or directory"),
230+
mcp.WithDescription("Get the contents of a file or directory from a GitHub repository"),
231231
mcp.WithString("owner",
232232
mcp.Required(),
233233
mcp.Description("Repository owner (username or organization)"),
@@ -287,7 +287,7 @@ func getFileContents(client *github.Client) (tool mcp.Tool, handler server.ToolH
287287
// forkRepository creates a tool to fork a repository.
288288
func forkRepository(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
289289
return mcp.NewTool("fork_repository",
290-
mcp.WithDescription("Fork a repository"),
290+
mcp.WithDescription("Fork a GitHub repository to your account or specified organization"),
291291
mcp.WithString("owner",
292292
mcp.Required(),
293293
mcp.Description("Repository owner"),
@@ -344,7 +344,7 @@ func forkRepository(client *github.Client) (tool mcp.Tool, handler server.ToolHa
344344
// createBranch creates a tool to create a new branch.
345345
func createBranch(client *github.Client) (tool mcp.Tool, handler server.ToolHandlerFunc) {
346346
return mcp.NewTool("create_branch",
347-
mcp.WithDescription("Create a new branch"),
347+
mcp.WithDescription("Create a new branch in a GitHub repository"),
348348
mcp.WithString("owner",
349349
mcp.Required(),
350350
mcp.Description("Repository owner"),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy