Skip to content

Commit bf4f6d8

Browse files
committed
adding default toolset group, splitting up stargazers from repos
1 parent 6793b9d commit bf4f6d8

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

README.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ The following sets of tools are available (all are on by default):
293293
| `repos` | GitHub Repository related tools |
294294
| `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
295295
| `security_advisories` | Security advisories related tools |
296+
| `stargazers` | GitHub Stargazers related tools |
296297
| `users` | GitHub User related tools |
297298
<!-- END AUTOMATED TOOLSETS -->
298299

@@ -940,13 +941,6 @@ The following sets of tools are available (all are on by default):
940941
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
941942
- `repo`: Repository name (string, required)
942943

943-
- **list_starred_repositories** - List starred repositories
944-
- `direction`: The direction to sort the results by. (string, optional)
945-
- `page`: Page number for pagination (min 1) (number, optional)
946-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
947-
- `sort`: How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to). (string, optional)
948-
- `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
949-
950944
- **list_tags** - List tags
951945
- `owner`: Repository owner (string, required)
952946
- `page`: Page number for pagination (min 1) (number, optional)
@@ -973,14 +967,6 @@ The following sets of tools are available (all are on by default):
973967
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
974968
- `query`: Repository search query. Examples: 'machine learning in:name stars:>1000 language:python', 'topic:react', 'user:facebook'. Supports advanced search syntax for precise filtering. (string, required)
975969

976-
- **star_repository** - Star repository
977-
- `owner`: Repository owner (string, required)
978-
- `repo`: Repository name (string, required)
979-
980-
- **unstar_repository** - Unstar repository
981-
- `owner`: Repository owner (string, required)
982-
- `repo`: Repository name (string, required)
983-
984970
</details>
985971

986972
<details>
@@ -1038,6 +1024,27 @@ The following sets of tools are available (all are on by default):
10381024

10391025
<details>
10401026

1027+
<summary>Stargazers</summary>
1028+
1029+
- **list_starred_repositories** - List starred repositories
1030+
- `direction`: The direction to sort the results by. (string, optional)
1031+
- `page`: Page number for pagination (min 1) (number, optional)
1032+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1033+
- `sort`: How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to). (string, optional)
1034+
- `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
1035+
1036+
- **star_repository** - Star repository
1037+
- `owner`: Repository owner (string, required)
1038+
- `repo`: Repository name (string, required)
1039+
1040+
- **unstar_repository** - Unstar repository
1041+
- `owner`: Repository owner (string, required)
1042+
- `repo`: Repository name (string, required)
1043+
1044+
</details>
1045+
1046+
<details>
1047+
10411048
<summary>Users</summary>
10421049

10431050
- **search_users** - Search users

docs/remote-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
3434
| Repositories | GitHub Repository related tools | https://api.githubcopilot.com/mcp/x/repos | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/repos/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%2Freadonly%22%7D) |
3535
| Secret Protection | Secret protection related tools, such as GitHub Secret Scanning | https://api.githubcopilot.com/mcp/x/secret_protection | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/secret_protection/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%2Freadonly%22%7D) |
3636
| Security Advisories | Security advisories related tools | https://api.githubcopilot.com/mcp/x/security_advisories | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/security_advisories/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%2Freadonly%22%7D) |
37+
| Stargazers | GitHub Stargazers related tools | https://api.githubcopilot.com/mcp/x/stargazers | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/stargazers/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%2Freadonly%22%7D) |
3738
| Users | GitHub User related tools | https://api.githubcopilot.com/mcp/x/users | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/users/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%2Freadonly%22%7D) |
3839

3940
<!-- END AUTOMATED TOOLSETS -->

pkg/github/tools.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
type GetClientFn func(context.Context) (*github.Client, error)
1515
type GetGQLClientFn func(context.Context) (*githubv4.Client, error)
1616

17-
var DefaultTools = []string{"all"}
17+
var DefaultTools = []string{"context", "repos", "issues", "pull_requests", "users"}
1818

1919
func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup {
2020
tsg := toolsets.NewToolsetGroup(readOnly)
@@ -34,7 +34,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
3434
toolsets.NewServerTool(ListReleases(getClient, t)),
3535
toolsets.NewServerTool(GetLatestRelease(getClient, t)),
3636
toolsets.NewServerTool(GetReleaseByTag(getClient, t)),
37-
toolsets.NewServerTool(ListStarredRepositories(getClient, t)),
3837
).
3938
AddWriteTools(
4039
toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)),
@@ -43,8 +42,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
4342
toolsets.NewServerTool(CreateBranch(getClient, t)),
4443
toolsets.NewServerTool(PushFiles(getClient, t)),
4544
toolsets.NewServerTool(DeleteFile(getClient, t)),
46-
toolsets.NewServerTool(StarRepository(getClient, t)),
47-
toolsets.NewServerTool(UnstarRepository(getClient, t)),
4845
).
4946
AddResourceTemplates(
5047
toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)),
@@ -204,6 +201,14 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
204201
toolsets.NewServerTool(DeleteProjectItem(getClient, t)),
205202
toolsets.NewServerTool(UpdateProjectItem(getClient, t)),
206203
)
204+
stargazers := toolsets.NewToolset("stargazers", "GitHub Stargazers related tools").
205+
AddReadTools(
206+
toolsets.NewServerTool(ListStarredRepositories(getClient, t)),
207+
).
208+
AddWriteTools(
209+
toolsets.NewServerTool(StarRepository(getClient, t)),
210+
toolsets.NewServerTool(UnstarRepository(getClient, t)),
211+
)
207212

208213
// Add toolsets to the group
209214
tsg.AddToolset(contextTools)
@@ -222,6 +227,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
222227
tsg.AddToolset(gists)
223228
tsg.AddToolset(securityAdvisories)
224229
tsg.AddToolset(projects)
230+
tsg.AddToolset(stargazers)
225231

226232
return tsg
227233
}

0 commit comments

Comments
 (0)