diff --git a/github-mcp-server b/github-mcp-server new file mode 100755 index 000000000..80d8e296c Binary files /dev/null and b/github-mcp-server differ diff --git a/pkg/github/repositories.go b/pkg/github/repositories.go index 4403e2a19..72c9beaac 100644 --- a/pkg/github/repositories.go +++ b/pkg/github/repositories.go @@ -149,7 +149,23 @@ func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (t return mcp.NewToolResultError(fmt.Sprintf("failed to list commits: %s", string(body))), nil } - r, err := json.Marshal(commits) + // Filter commit data to include only required fields + filteredCommits := make([]map[string]interface{}, 0, len(commits)) + for _, commit := range commits { + filteredCommit := map[string]interface{}{ + "sha": commit.GetSHA(), + "node_id": commit.GetNodeID(), + "commit": map[string]interface{}{ + "message": commit.GetCommit().GetMessage(), + "author": map[string]interface{}{ + "name": commit.GetCommit().GetAuthor().GetName(), + }, + }, + } + filteredCommits = append(filteredCommits, filteredCommit) + } + + r, err := json.Marshal(filteredCommits) if err != nil { return nil, fmt.Errorf("failed to marshal response: %w", err) }