diff --git a/.gitignore b/.gitignore index 0ad709cbf..9cf7e3821 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ vendor bin/ # macOS -.DS_Store \ No newline at end of file +.DS_Store + +# binary +github-mcp-server \ No newline at end of file diff --git a/README.md b/README.md index 46eef3b4b..acedb34f3 100644 --- a/README.md +++ b/README.md @@ -875,6 +875,13 @@ The following sets of tools are available (all are on by default): - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `repo`: Repository name (string, required) +- **list_starred_repositories** - List starred repositories + - `direction`: The direction to sort the results by. (string, optional) + - `page`: Page number for pagination (min 1) (number, optional) + - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) + - `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) + - `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional) + - **list_tags** - List tags - `owner`: Repository owner (string, required) - `page`: Page number for pagination (min 1) (number, optional) @@ -901,6 +908,14 @@ The following sets of tools are available (all are on by default): - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `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) +- **star_repository** - Star repository + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + +- **unstar_repository** - Unstar repository + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) +
diff --git a/github-mcp-server b/github-mcp-server deleted file mode 100755 index 864242c24..000000000 Binary files a/github-mcp-server and /dev/null differ diff --git a/pkg/github/__toolsnaps__/list_starred_repositories.snap b/pkg/github/__toolsnaps__/list_starred_repositories.snap new file mode 100644 index 000000000..b02563ae2 --- /dev/null +++ b/pkg/github/__toolsnaps__/list_starred_repositories.snap @@ -0,0 +1,44 @@ +{ + "annotations": { + "title": "List starred repositories", + "readOnlyHint": true + }, + "description": "List starred repositories", + "inputSchema": { + "properties": { + "direction": { + "description": "The direction to sort the results by.", + "enum": [ + "asc", + "desc" + ], + "type": "string" + }, + "page": { + "description": "Page number for pagination (min 1)", + "minimum": 1, + "type": "number" + }, + "perPage": { + "description": "Results per page for pagination (min 1, max 100)", + "maximum": 100, + "minimum": 1, + "type": "number" + }, + "sort": { + "description": "How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to).", + "enum": [ + "created", + "updated" + ], + "type": "string" + }, + "username": { + "description": "Username to list starred repositories for. Defaults to the authenticated user.", + "type": "string" + } + }, + "type": "object" + }, + "name": "list_starred_repositories" +} \ No newline at end of file diff --git a/pkg/github/__toolsnaps__/star_repository.snap b/pkg/github/__toolsnaps__/star_repository.snap new file mode 100644 index 000000000..983ea6fcb --- /dev/null +++ b/pkg/github/__toolsnaps__/star_repository.snap @@ -0,0 +1,25 @@ +{ + "annotations": { + "title": "Star repository", + "readOnlyHint": false + }, + "description": "Star a GitHub repository", + "inputSchema": { + "properties": { + "owner": { + "description": "Repository owner", + "type": "string" + }, + "repo": { + "description": "Repository name", + "type": "string" + } + }, + "required": [ + "owner", + "repo" + ], + "type": "object" + }, + "name": "star_repository" +} \ No newline at end of file diff --git a/pkg/github/__toolsnaps__/unstar_repository.snap b/pkg/github/__toolsnaps__/unstar_repository.snap new file mode 100644 index 000000000..0bf52dc63 --- /dev/null +++ b/pkg/github/__toolsnaps__/unstar_repository.snap @@ -0,0 +1,25 @@ +{ + "annotations": { + "title": "Unstar repository", + "readOnlyHint": false + }, + "description": "Unstar a GitHub repository", + "inputSchema": { + "properties": { + "owner": { + "description": "Repository owner", + "type": "string" + }, + "repo": { + "description": "Repository name", + "type": "string" + } + }, + "required": [ + "owner", + "repo" + ], + "type": "object" + }, + "name": "unstar_repository" +} \ No newline at end of file diff --git a/pkg/github/repositories.go b/pkg/github/repositories.go index cc68375b4..0622f3101 100644 --- a/pkg/github/repositories.go +++ b/pkg/github/repositories.go @@ -1683,3 +1683,231 @@ func resolveGitReference(ctx context.Context, githubClient *github.Client, owner sha = reference.GetObject().GetSHA() return &raw.ContentOpts{Ref: ref, SHA: sha}, nil } + +// ListStarredRepositories creates a tool to list starred repositories for the authenticated user or a specified user. +func ListStarredRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) { + return mcp.NewTool("list_starred_repositories", + mcp.WithDescription(t("TOOL_LIST_STARRED_REPOSITORIES_DESCRIPTION", "List starred repositories")), + mcp.WithToolAnnotation(mcp.ToolAnnotation{ + Title: t("TOOL_LIST_STARRED_REPOSITORIES_USER_TITLE", "List starred repositories"), + ReadOnlyHint: ToBoolPtr(true), + }), + mcp.WithString("username", + mcp.Description("Username to list starred repositories for. Defaults to the authenticated user."), + ), + mcp.WithString("sort", + mcp.Description("How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to)."), + mcp.Enum("created", "updated"), + ), + mcp.WithString("direction", + mcp.Description("The direction to sort the results by."), + mcp.Enum("asc", "desc"), + ), + WithPagination(), + ), + func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { + username, err := OptionalParam[string](request, "username") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + sort, err := OptionalParam[string](request, "sort") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + direction, err := OptionalParam[string](request, "direction") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + pagination, err := OptionalPaginationParams(request) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + opts := &github.ActivityListStarredOptions{ + ListOptions: github.ListOptions{ + Page: pagination.Page, + PerPage: pagination.PerPage, + }, + } + if sort != "" { + opts.Sort = sort + } + if direction != "" { + opts.Direction = direction + } + + client, err := getClient(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get GitHub client: %w", err) + } + + var repos []*github.StarredRepository + var resp *github.Response + if username == "" { + // List starred repositories for the authenticated user + repos, resp, err = client.Activity.ListStarred(ctx, "", opts) + } else { + // List starred repositories for a specific user + repos, resp, err = client.Activity.ListStarred(ctx, username, opts) + } + + if err != nil { + return ghErrors.NewGitHubAPIErrorResponse(ctx, + fmt.Sprintf("failed to list starred repositories for user '%s'", username), + resp, + err, + ), nil + } + defer func() { _ = resp.Body.Close() }() + + if resp.StatusCode != 200 { + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %w", err) + } + return mcp.NewToolResultError(fmt.Sprintf("failed to list starred repositories: %s", string(body))), nil + } + + // Convert to minimal format + minimalRepos := make([]MinimalRepository, 0, len(repos)) + for _, starredRepo := range repos { + repo := starredRepo.Repository + minimalRepo := MinimalRepository{ + ID: repo.GetID(), + Name: repo.GetName(), + FullName: repo.GetFullName(), + Description: repo.GetDescription(), + HTMLURL: repo.GetHTMLURL(), + Language: repo.GetLanguage(), + Stars: repo.GetStargazersCount(), + Forks: repo.GetForksCount(), + OpenIssues: repo.GetOpenIssuesCount(), + Private: repo.GetPrivate(), + Fork: repo.GetFork(), + Archived: repo.GetArchived(), + DefaultBranch: repo.GetDefaultBranch(), + } + + if repo.UpdatedAt != nil { + minimalRepo.UpdatedAt = repo.UpdatedAt.Format("2006-01-02T15:04:05Z") + } + + minimalRepos = append(minimalRepos, minimalRepo) + } + + r, err := json.Marshal(minimalRepos) + if err != nil { + return nil, fmt.Errorf("failed to marshal starred repositories: %w", err) + } + + return mcp.NewToolResultText(string(r)), nil + } +} + +// StarRepository creates a tool to star a repository. +func StarRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) { + return mcp.NewTool("star_repository", + mcp.WithDescription(t("TOOL_STAR_REPOSITORY_DESCRIPTION", "Star a GitHub repository")), + mcp.WithToolAnnotation(mcp.ToolAnnotation{ + Title: t("TOOL_STAR_REPOSITORY_USER_TITLE", "Star repository"), + ReadOnlyHint: ToBoolPtr(false), + }), + mcp.WithString("owner", + mcp.Required(), + mcp.Description("Repository owner"), + ), + mcp.WithString("repo", + mcp.Required(), + mcp.Description("Repository name"), + ), + ), + func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { + owner, err := RequiredParam[string](request, "owner") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + repo, err := RequiredParam[string](request, "repo") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + client, err := getClient(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get GitHub client: %w", err) + } + + resp, err := client.Activity.Star(ctx, owner, repo) + if err != nil { + return ghErrors.NewGitHubAPIErrorResponse(ctx, + fmt.Sprintf("failed to star repository %s/%s", owner, repo), + resp, + err, + ), nil + } + defer func() { _ = resp.Body.Close() }() + + if resp.StatusCode != 204 { + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %w", err) + } + return mcp.NewToolResultError(fmt.Sprintf("failed to star repository: %s", string(body))), nil + } + + return mcp.NewToolResultText(fmt.Sprintf("Successfully starred repository %s/%s", owner, repo)), nil + } +} + +// UnstarRepository creates a tool to unstar a repository. +func UnstarRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) { + return mcp.NewTool("unstar_repository", + mcp.WithDescription(t("TOOL_UNSTAR_REPOSITORY_DESCRIPTION", "Unstar a GitHub repository")), + mcp.WithToolAnnotation(mcp.ToolAnnotation{ + Title: t("TOOL_UNSTAR_REPOSITORY_USER_TITLE", "Unstar repository"), + ReadOnlyHint: ToBoolPtr(false), + }), + mcp.WithString("owner", + mcp.Required(), + mcp.Description("Repository owner"), + ), + mcp.WithString("repo", + mcp.Required(), + mcp.Description("Repository name"), + ), + ), + func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { + owner, err := RequiredParam[string](request, "owner") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + repo, err := RequiredParam[string](request, "repo") + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + client, err := getClient(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get GitHub client: %w", err) + } + + resp, err := client.Activity.Unstar(ctx, owner, repo) + if err != nil { + return ghErrors.NewGitHubAPIErrorResponse(ctx, + fmt.Sprintf("failed to unstar repository %s/%s", owner, repo), + resp, + err, + ), nil + } + defer func() { _ = resp.Body.Close() }() + + if resp.StatusCode != 204 { + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %w", err) + } + return mcp.NewToolResultError(fmt.Sprintf("failed to unstar repository: %s", string(body))), nil + } + + return mcp.NewToolResultText(fmt.Sprintf("Successfully unstarred repository %s/%s", owner, repo)), nil + } +} diff --git a/pkg/github/repositories_test.go b/pkg/github/repositories_test.go index 468d7c29b..11f11493c 100644 --- a/pkg/github/repositories_test.go +++ b/pkg/github/repositories_test.go @@ -2866,3 +2866,329 @@ func Test_resolveGitReference(t *testing.T) { }) } } + +func Test_ListStarredRepositories(t *testing.T) { + // Verify tool definition once + mockClient := github.NewClient(nil) + tool, _ := ListStarredRepositories(stubGetClientFn(mockClient), translations.NullTranslationHelper) + require.NoError(t, toolsnaps.Test(tool.Name, tool)) + + assert.Equal(t, "list_starred_repositories", tool.Name) + assert.NotEmpty(t, tool.Description) + assert.Contains(t, tool.InputSchema.Properties, "username") + assert.Contains(t, tool.InputSchema.Properties, "sort") + assert.Contains(t, tool.InputSchema.Properties, "direction") + assert.Contains(t, tool.InputSchema.Properties, "page") + assert.Contains(t, tool.InputSchema.Properties, "perPage") + assert.Empty(t, tool.InputSchema.Required) // All parameters are optional + + // Setup mock starred repositories + starredAt := time.Now().Add(-24 * time.Hour) + updatedAt := time.Now().Add(-2 * time.Hour) + mockStarredRepos := []*github.StarredRepository{ + { + StarredAt: &github.Timestamp{Time: starredAt}, + Repository: &github.Repository{ + ID: github.Ptr(int64(12345)), + Name: github.Ptr("awesome-repo"), + FullName: github.Ptr("owner/awesome-repo"), + Description: github.Ptr("An awesome repository"), + HTMLURL: github.Ptr("https://github.com/owner/awesome-repo"), + Language: github.Ptr("Go"), + StargazersCount: github.Ptr(100), + ForksCount: github.Ptr(25), + OpenIssuesCount: github.Ptr(5), + UpdatedAt: &github.Timestamp{Time: updatedAt}, + Private: github.Ptr(false), + Fork: github.Ptr(false), + Archived: github.Ptr(false), + DefaultBranch: github.Ptr("main"), + }, + }, + { + StarredAt: &github.Timestamp{Time: starredAt.Add(-12 * time.Hour)}, + Repository: &github.Repository{ + ID: github.Ptr(int64(67890)), + Name: github.Ptr("cool-project"), + FullName: github.Ptr("user/cool-project"), + Description: github.Ptr("A very cool project"), + HTMLURL: github.Ptr("https://github.com/user/cool-project"), + Language: github.Ptr("Python"), + StargazersCount: github.Ptr(500), + ForksCount: github.Ptr(75), + OpenIssuesCount: github.Ptr(10), + UpdatedAt: &github.Timestamp{Time: updatedAt.Add(-1 * time.Hour)}, + Private: github.Ptr(false), + Fork: github.Ptr(true), + Archived: github.Ptr(false), + DefaultBranch: github.Ptr("master"), + }, + }, + } + + tests := []struct { + name string + mockedClient *http.Client + requestArgs map[string]interface{} + expectError bool + expectedErrMsg string + expectedCount int + }{ + { + name: "successful list for authenticated user", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.GetUserStarred, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write(mock.MustMarshal(mockStarredRepos)) + }), + ), + ), + requestArgs: map[string]interface{}{}, + expectError: false, + expectedCount: 2, + }, + { + name: "successful list for specific user", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.GetUsersStarredByUsername, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write(mock.MustMarshal(mockStarredRepos)) + }), + ), + ), + requestArgs: map[string]interface{}{ + "username": "testuser", + }, + expectError: false, + expectedCount: 2, + }, + { + name: "list fails", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.GetUserStarred, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNotFound) + _, _ = w.Write([]byte(`{"message": "Not Found"}`)) + }), + ), + ), + requestArgs: map[string]interface{}{}, + expectError: true, + expectedErrMsg: "failed to list starred repositories", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Setup client with mock + client := github.NewClient(tc.mockedClient) + _, handler := ListStarredRepositories(stubGetClientFn(client), translations.NullTranslationHelper) + + // Create call request + request := createMCPRequest(tc.requestArgs) + + // Call handler + result, err := handler(context.Background(), request) + + // Verify results + if tc.expectError { + require.NotNil(t, result) + textResult, ok := result.Content[0].(mcp.TextContent) + require.True(t, ok, "Expected text content") + assert.Contains(t, textResult.Text, tc.expectedErrMsg) + } else { + require.NoError(t, err) + require.NotNil(t, result) + + // Parse the result and get the text content + textContent := getTextResult(t, result) + + // Unmarshal and verify the result + var returnedRepos []MinimalRepository + err = json.Unmarshal([]byte(textContent.Text), &returnedRepos) + require.NoError(t, err) + + assert.Len(t, returnedRepos, tc.expectedCount) + if tc.expectedCount > 0 { + assert.Equal(t, "awesome-repo", returnedRepos[0].Name) + assert.Equal(t, "owner/awesome-repo", returnedRepos[0].FullName) + } + } + }) + } +} + +func Test_StarRepository(t *testing.T) { + // Verify tool definition once + mockClient := github.NewClient(nil) + tool, _ := StarRepository(stubGetClientFn(mockClient), translations.NullTranslationHelper) + require.NoError(t, toolsnaps.Test(tool.Name, tool)) + + assert.Equal(t, "star_repository", tool.Name) + assert.NotEmpty(t, tool.Description) + assert.Contains(t, tool.InputSchema.Properties, "owner") + assert.Contains(t, tool.InputSchema.Properties, "repo") + assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "repo"}) + + tests := []struct { + name string + mockedClient *http.Client + requestArgs map[string]interface{} + expectError bool + expectedErrMsg string + }{ + { + name: "successful star", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.PutUserStarredByOwnerByRepo, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNoContent) + }), + ), + ), + requestArgs: map[string]interface{}{ + "owner": "testowner", + "repo": "testrepo", + }, + expectError: false, + }, + { + name: "star fails", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.PutUserStarredByOwnerByRepo, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNotFound) + _, _ = w.Write([]byte(`{"message": "Not Found"}`)) + }), + ), + ), + requestArgs: map[string]interface{}{ + "owner": "testowner", + "repo": "nonexistent", + }, + expectError: true, + expectedErrMsg: "failed to star repository", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Setup client with mock + client := github.NewClient(tc.mockedClient) + _, handler := StarRepository(stubGetClientFn(client), translations.NullTranslationHelper) + + // Create call request + request := createMCPRequest(tc.requestArgs) + + // Call handler + result, err := handler(context.Background(), request) + + // Verify results + if tc.expectError { + require.NotNil(t, result) + textResult, ok := result.Content[0].(mcp.TextContent) + require.True(t, ok, "Expected text content") + assert.Contains(t, textResult.Text, tc.expectedErrMsg) + } else { + require.NoError(t, err) + require.NotNil(t, result) + + // Parse the result and get the text content + textContent := getTextResult(t, result) + assert.Contains(t, textContent.Text, "Successfully starred repository") + } + }) + } +} + +func Test_UnstarRepository(t *testing.T) { + // Verify tool definition once + mockClient := github.NewClient(nil) + tool, _ := UnstarRepository(stubGetClientFn(mockClient), translations.NullTranslationHelper) + require.NoError(t, toolsnaps.Test(tool.Name, tool)) + + assert.Equal(t, "unstar_repository", tool.Name) + assert.NotEmpty(t, tool.Description) + assert.Contains(t, tool.InputSchema.Properties, "owner") + assert.Contains(t, tool.InputSchema.Properties, "repo") + assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "repo"}) + + tests := []struct { + name string + mockedClient *http.Client + requestArgs map[string]interface{} + expectError bool + expectedErrMsg string + }{ + { + name: "successful unstar", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.DeleteUserStarredByOwnerByRepo, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNoContent) + }), + ), + ), + requestArgs: map[string]interface{}{ + "owner": "testowner", + "repo": "testrepo", + }, + expectError: false, + }, + { + name: "unstar fails", + mockedClient: mock.NewMockedHTTPClient( + mock.WithRequestMatchHandler( + mock.DeleteUserStarredByOwnerByRepo, + http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNotFound) + _, _ = w.Write([]byte(`{"message": "Not Found"}`)) + }), + ), + ), + requestArgs: map[string]interface{}{ + "owner": "testowner", + "repo": "nonexistent", + }, + expectError: true, + expectedErrMsg: "failed to unstar repository", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Setup client with mock + client := github.NewClient(tc.mockedClient) + _, handler := UnstarRepository(stubGetClientFn(client), translations.NullTranslationHelper) + + // Create call request + request := createMCPRequest(tc.requestArgs) + + // Call handler + result, err := handler(context.Background(), request) + + // Verify results + if tc.expectError { + require.NotNil(t, result) + textResult, ok := result.Content[0].(mcp.TextContent) + require.True(t, ok, "Expected text content") + assert.Contains(t, textResult.Text, tc.expectedErrMsg) + } else { + require.NoError(t, err) + require.NotNil(t, result) + + // Parse the result and get the text content + textContent := getTextResult(t, result) + assert.Contains(t, textContent.Text, "Successfully unstarred repository") + } + }) + } +} diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 10a3f3eca..6987c447a 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -34,6 +34,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(ListReleases(getClient, t)), toolsets.NewServerTool(GetLatestRelease(getClient, t)), toolsets.NewServerTool(GetReleaseByTag(getClient, t)), + toolsets.NewServerTool(ListStarredRepositories(getClient, t)), ). AddWriteTools( toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)), @@ -42,6 +43,8 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(CreateBranch(getClient, t)), toolsets.NewServerTool(PushFiles(getClient, t)), toolsets.NewServerTool(DeleteFile(getClient, t)), + toolsets.NewServerTool(StarRepository(getClient, t)), + toolsets.NewServerTool(UnstarRepository(getClient, t)), ). AddResourceTemplates( toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)),